|
- <!DOCTYPE html>
- <html>
- <head>
- <title>显示时间</title>
- <style>
- body {
- background-color: #1e1e1e;
- font-family: 'Roboto', 'Arial', sans-serif;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100vh;
- margin: 0;
- overflow: hidden; /* 添加了隐藏滚动条的样式 */
- }
- #clock {
- font-size: 150px;
- color: #ffffff;
- text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
- }
- #particles {
- position: absolute;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- z-index: -1;
- }
- </style>
- </head>
- <body>
- <div id="clock"></div>
- <div id="particles"></div>
- <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
- <script>
- var clock = document.getElementById('clock');
- function updateClock() {
- var now = new Date();
- var hours = now.getHours().toString().padStart(2, '0');
- var minutes = now.getMinutes().toString().padStart(2, '0');
- var seconds = now.getSeconds().toString().padStart(2, '0');
- var time = hours + ':' + minutes + ':' + seconds;
- clock.textContent = time;
- }
- setInterval(updateClock, 1000);
- particlesJS('particles', {
- particles: {
- number: {
- value: 80,
- density: {
- enable: true,
- value_area: 800
- }
- },
- color: {
- value: '#ffffff'
- },
- shape: {
- type: ['circle', 'triangle', 'polygon'],
- stroke: {
- width: 0,
- color: '#000000'
- },
- polygon: {
- nb_sides: 5
- },
- },
- opacity: {
- value: 0.8,
- random: true,
- anim: {
- enable: false,
- speed: 1,
- opacity_min: 0.1,
- sync: false
- }
- },
- size: {
- value: 5,
- random: true,
- anim: {
- enable: false,
- speed: 40,
- size_min: 0.1,
- sync: false
- }
- },
- line_linked: {
- enable: true,
- distance: 150,
- color: '#ffffff',
- opacity: 0.6,
- width: 1
- },
- move: {
- enable: true,
- speed: 3,
- direction: ['none', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left'],
- random: true,
- straight: false,
- out_mode: 'out',
- bounce: false,
- attract: {
- enable: false,
- rotateX: 600,
- rotateY: 1200
- }
- }
- },
- interactivity: {
- detect_on: 'canvas',
- events: {
- onhover: {
- enable: true,
- mode: 'grab'
- },
- onclick: {
- enable: true,
- mode: 'push'
- },
- resize: true
- },
- modes: {
- grab: {
- distance: 200,
- line_linked: {
- opacity: 1
- }
- },
- push: {
- particles_nb: 4
- },
- }
- },
- retina_detect: true
- });
- // 添加双击全屏功能
- var isFullScreen = false;
- document.addEventListener('dblclick', toggleFullScreen);
- function toggleFullScreen() {
- var doc = window.document;
- var docEl = doc.documentElement;
- var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
- var exitFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;
- if (!isFullScreen) {
- if (requestFullScreen) {
- requestFullScreen.call(docEl);
- }
- } else {
- if (exitFullScreen) {
- exitFullScreen.call(doc);
- }
- }
- isFullScreen = !isFullScreen;
- }
- </script>
- </body>
- </html>
复制代码
|
盘基地论坛免责声明
1、本站资源来自互联网用户收集发布,仅供用于学习和交流。
2、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。
3、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决。
4、联系邮箱:admin@panjdzy.com
5、官方网址:www.panjdzy.com
6、备用网址:www.panjd.top
上一篇:1dfde80250901-GBA模拟器下一篇:nes gba nds psp 3ds switch 游戏下载网站
|