找回密码
 加入我们
搜索
      
查看: 1050|回复: 18

[软件] 有没有一个电脑软件/网页 展示时间进度流逝的

[复制链接]
发表于 2025-5-26 14:34 | 显示全部楼层 |阅读模式
大概这样的

有没有这样的东西 能一直展示的 开一个电脑网页 或者应用

谢谢
2025 年每个人都被赋予了相同的财富_1_OhMyDom_来自小红书网页版.jpg
发表于 2025-5-27 10:48 | 显示全部楼层
本帖最后由 梦素 于 2025-5-27 15:59 编辑

保存成html文件,打开就行,也可以用Wallpaper Engine的添加自定义html功能把它设为桌面背景。

放到Wallpaper Engine试了下,发现始终居中有点笨,而且太大了,把组件缩小了,增加半透明模糊并且使得它可拖动,配合Wallpaper Engine用起来有MacOS桌面组件那味道了
效果:

代码:
  1. <!DOCTYPE html>
  2. <html lang="en">

  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Progress Tracker</title>
  6.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  7.     <style>
  8.         :root {
  9.             --top-color: #6A6A6F;
  10.             --bottom-color: #101014;
  11.         }

  12.         body {
  13.             background: linear-gradient(to bottom, var(--top-color), var(--bottom-color));
  14.             color: white;
  15.             font-family: 'PingFang SC', 'PingFang TC', 'San Francisco', 'MiSans', sans-serif;
  16.             display: flex;
  17.             flex-direction: column;
  18.             align-items: center;
  19.             justify-content: center;
  20.             height: 100vh;
  21.             margin: 0;
  22.         }

  23.         .section-box {
  24.             position: absolute;
  25.             z-index: 1;
  26.             background: rgba(17, 17, 17, 0.8);
  27.             border-radius: 1rem;
  28.             padding: 14px;
  29.             margin-bottom: 10px;
  30.             text-align: center;
  31.             user-select: none;
  32.             backdrop-filter: blur(4px);
  33.             box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  34.         }

  35.         #dots-container {
  36.             display: grid;
  37.             grid-template-columns: repeat(12, 16px);
  38.             grid-gap: 7px;
  39.             margin-bottom: 8px;
  40.         }

  41.         .dot {
  42.             width: 16px;
  43.             height: 16px;
  44.             border-radius: 50%;
  45.             background: rgba(48, 48, 48, 0.5);
  46.         }

  47.         .dot.active {
  48.             background: rgb(78, 255, 55);
  49.         }

  50.         .dot.partial {
  51.             background: rgb(255, 230, 0);
  52.         }

  53.         #dots-remaining {
  54.             color: rgba(130, 130, 130, 0.9);
  55.             ;
  56.             font-size: 12px;
  57.             margin-top: 5px;
  58.             -webkit-touch-callout: none;
  59.             -webkit-user-select: none;
  60.             -khtml-user-select: none;
  61.             -moz-user-select: none;
  62.             -ms-user-select: none;
  63.             user-select: none;
  64.         }

  65.         .circle-group {
  66.             display: flex;
  67.             gap: 8px;
  68.             justify-content: center;
  69.             align-items: center;
  70.             height: 80px;
  71.         }

  72.         .circle {
  73.             position: relative;
  74.             bottom: 10px;
  75.             width: 60px;
  76.             height: 60px;
  77.         }

  78.         .circle svg {
  79.             transform: rotate(-90deg);
  80.         }

  81.         .circle-label {
  82.             text-align: center;
  83.             position: absolute;
  84.             top: 50%;
  85.             left: 50%;
  86.             transform: translate(-50%, -50%);
  87.             font-size: 14px;
  88.             font-weight: normal;
  89.             -webkit-touch-callout: none;
  90.             -webkit-user-select: none;
  91.             -khtml-user-select: none;
  92.             -moz-user-select: none;
  93.             -ms-user-select: none;
  94.             user-select: none;
  95.         }

  96.         .circle-percent {
  97.             text-align: center;
  98.             position: absolute;
  99.             bottom: -20px;
  100.             left: 50%;
  101.             transform: translateX(-50%);
  102.             font-size: 12px;
  103.             font-weight: normal;
  104.             -webkit-touch-callout: none;
  105.             -webkit-user-select: none;
  106.             -khtml-user-select: none;
  107.             -moz-user-select: none;
  108.             -ms-user-select: none;
  109.             user-select: none;
  110.         }

  111.         @keyframes fillRing {
  112.             0% {
  113.                 stroke-dashoffset: 251.2;
  114.             }

  115.             100% {
  116.                 stroke-dashoffset: var(--final-offset);
  117.             }
  118.         }

  119.         @keyframes dotWave {
  120.             0% {
  121.                 transform: scale(0.6);
  122.                 opacity: 0.3;
  123.             }

  124.             50% {
  125.                 transform: scale(1.2);
  126.                 opacity: 1;
  127.             }

  128.             100% {
  129.                 transform: scale(1);
  130.                 opacity: 1;
  131.             }
  132.         }

  133.         .dot.animate {
  134.             animation: dotWave 0.8s ease-out forwards;
  135.         }
  136.     </style>
  137. </head>

  138. <body>
  139.     <div class="section-box" style="top: 50px; left: 80px;">
  140.         <div id="dots-container"></div>
  141.         <div id="dots-remaining"></div>
  142.     </div>
  143.     <div class="section-box" style="top: 50px; left: 180px;">
  144.         <div class="circle-group">
  145.             <div class="circle" data-unit="day" data-color="#DAAF00" data-bg="#262004"></div>
  146.             <div class="circle" data-unit="week" data-color="#906F4C" data-bg="#1F1B10"></div>
  147.             <div class="circle" data-unit="month" data-color="#E1790A" data-bg="#1A0C0B"></div>
  148.             <div class="circle" data-unit="year" data-color="#E61F22" data-bg="#26130C"></div>
  149.         </div>
  150.     </div>
  151.     <script>
  152.         let lastDotState = '';
  153.         let zCounter = 100;
  154.         function createDots(firstLoad = false) {
  155.             const now = new Date();
  156.             const minsPassed = now.getHours() * 60 + now.getMinutes();
  157.             const currentDot = Math.floor(minsPassed / 10);
  158.             const totalRows = 12;
  159.             const totalCols = 12;
  160.             const newDotState = currentDot;

  161.             const shouldAnimate = firstLoad || newDotState !== lastDotState;
  162.             lastDotState = newDotState;

  163.             $("#dots-container").empty();
  164.             for (let row = totalRows - 1; row >= 0; row--) {
  165.                 for (let col = totalCols - 1; col >= 0; col--) {
  166.                     const index = row * totalCols + col;
  167.                     let cls = 'dot';
  168.                     if (index < currentDot) cls += ' active';
  169.                     else if (index === currentDot) cls += ' partial';
  170.                     const animateClass = shouldAnimate ? ' animate' : '';
  171.                     const $dot = $(`<div class="${cls}" data-index="${index}" style="animation-delay: ${(row + col) * 20}ms"></div>`);
  172.                     $("#dots-container").append($dot);
  173.                 }
  174.             }
  175.             const remaining = 1440 - minsPassed;
  176.             $("#dots-remaining").text(`本日还剩 ${remaining} 分钟`);
  177.         }

  178.         function renderCircle($el, percent, label, color, bg, animate = false) {
  179.             const radius = 25;
  180.             const circumference = 2 * Math.PI * radius;
  181.             const offset = circumference * (1 - percent);
  182.             let circleMarkup = animate ?
  183.                 `<circle cx="30" cy="30" r="25" stroke="${color}" stroke-width="6" fill="none" stroke-linecap="round" stroke-dasharray="${circumference}" stroke-dashoffset="0">
  184.           <animate attributeName="stroke-dashoffset" from="${circumference}" to="${offset}" dur="1s" fill="freeze" />
  185.         </circle>` :
  186.                 `<circle cx="30" cy="30" r="25" stroke="${color}" stroke-width="6" fill="none" stroke-linecap="round" stroke-dasharray="${circumference}" stroke-dashoffset="${offset}" />`;
  187.             const svg = `
  188.         <svg width="60" height="60">
  189.           <circle cx="30" cy="30" r="25" stroke="${bg}" stroke-width="6" fill="none" />
  190.           ${circleMarkup}
  191.         </svg>
  192.         <div class="circle-label" style="color: ${color};">${label}</div>
  193.         <div class="circle-percent" style="color: ${color};">${(percent * 100).toFixed(1)}%</div>
  194.       `;
  195.             $el.html(svg);
  196.         }

  197.         function updateProgressCircles(animate = false) {
  198.             const now = new Date();
  199.             const startOfYear = new Date(now.getFullYear(), 0, 1);
  200.             const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
  201.             const startOfWeek = new Date(now);
  202.             startOfWeek.setDate(now.getDate() - now.getDay());
  203.             const startOfDay = new Date(now);
  204.             startOfDay.setHours(0, 0, 0, 0);
  205.             const totalDay = 24 * 60 * 60 * 1000;
  206.             const totalWeek = 7 * totalDay;
  207.             const totalMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate() * totalDay;
  208.             const totalYear = new Date(now.getFullYear() + 1, 0, 1) - new Date(now.getFullYear(), 0, 1);
  209.             const elapsedDay = now - startOfDay;
  210.             const elapsedWeek = now - startOfWeek;
  211.             const elapsedMonth = now - startOfMonth;
  212.             const elapsedYear = now - startOfYear;
  213.             $(".circle").each(function () {
  214.                 const unit = $(this).data("unit");
  215.                 const color = $(this).data("color");
  216.                 const bg = $(this).data("bg");
  217.                 let percent = 0;
  218.                 let label = '';
  219.                 switch (unit) {
  220.                     case 'day': percent = elapsedDay / totalDay; label = '日'; break;
  221.                     case 'week': percent = elapsedWeek / totalWeek; label = '周'; break;
  222.                     case 'month': percent = elapsedMonth / totalMonth; label = '月'; break;
  223.                     case 'year': percent = elapsedYear / totalYear; label = '年'; break;
  224.                 }
  225.                 renderCircle($(this), percent, label, color, bg, animate);
  226.             });
  227.         }

  228.         function triggerDotWave(centerIndex) {
  229.             const totalCols = 12;
  230.             const centerRow = Math.floor(centerIndex / totalCols);
  231.             const centerCol = centerIndex % totalCols;

  232.             $("#dots-container .dot").each(function () {
  233.                 const index = parseInt($(this).data("index"));
  234.                 const row = Math.floor(index / totalCols);
  235.                 const col = index % totalCols;

  236.                 const dx = row - centerRow;
  237.                 const dy = col - centerCol;
  238.                 const distance = Math.sqrt(dx * dx + dy * dy);

  239.                 $(this).removeClass("animate"); // 重置动画
  240.                 void this.offsetWidth; // 强制重绘
  241.                 $(this).addClass("animate").css("animation-delay", `${distance * 40}ms`);
  242.             });
  243.         }

  244.         function makeDraggable($el) {
  245.             let isDragging = false;
  246.             let offsetX = 0;
  247.             let offsetY = 0;

  248.             $el.on("mousedown", function (e) {
  249.                 isDragging = true;
  250.                 const pos = $el.offset();
  251.                 offsetX = e.pageX - pos.left;
  252.                 offsetY = e.pageY - pos.top;
  253.                 $el.css("z-index", ++zCounter);
  254.                 e.preventDefault();
  255.             });

  256.             $(document).on("mousemove", function (e) {
  257.                 if (isDragging) {
  258.                     $el.css({
  259.                         left: e.pageX - offsetX,
  260.                         top: e.pageY - offsetY
  261.                     });
  262.                 }
  263.             });

  264.             $(document).on("mouseup", function () {
  265.                 isDragging = false;
  266.             });
  267.         }

  268.         $(".section-box").each(function () {
  269.             makeDraggable($(this));
  270.         });
  271.         $(document).on("click", ".dot", function () {
  272.             const index = parseInt($(this).data("index"));
  273.             triggerDotWave(index);
  274.         });

  275.         $(function () {
  276.             function refreshPage(firstLoad = false) {
  277.                 createDots(firstLoad);
  278.                 updateProgressCircles(firstLoad);
  279.             }
  280.             refreshPage(true);
  281.             setInterval(() => refreshPage(false), 15000);
  282.         });
  283.     </script>
  284. </body>

  285. </html>
复制代码
发表于 2025-5-26 14:35 | 显示全部楼层
自己做一个
发表于 2025-5-26 16:47 | 显示全部楼层
这个东西应该不难,随便用编程语言写一个程序就好了,不过图形界面需要花点设计

如果你需要定时器,win11日历上有专注设置。

如果你这种需求多的话,我想厂家不会不生产这种东西来赚钱,比如oled摆件,或者app什么的,你这是苹果手机上的吧,如果是安卓app还有模拟器
发表于 2025-5-26 17:02 | 显示全部楼层

你说的是类似这种?
发表于 2025-5-26 17:04 | 显示全部楼层
iShot_2025-05-26_16.56.51.jpeg
最近论坛上传图片老是失败,也不知道啥原因
发表于 2025-5-26 18:09 | 显示全部楼层
网页去chrome/edge商店搜refresh有很多。。。应用布吉岛。。。

refresh.jpg
r.jpg
发表于 2025-5-26 18:58 | 显示全部楼层
这个需求是有什么用途?
发表于 2025-5-26 19:21 来自手机 | 显示全部楼层
yakeyyy 发表于 2025-5-26 08:47
这个东西应该不难,随便用编程语言写一个程序就好了,不过图形界面需要花点设计

如果你需要定时器,win11 ...

看到我愣了一下 难不成还可以用纸笔写吗 哈哈哈哈哈哈
发表于 2025-5-26 20:09 | 显示全部楼层
powerduke 发表于 2025-5-26 18:58
这个需求是有什么用途?

给自己制造焦虑
 楼主| 发表于 2025-5-27 09:51 | 显示全部楼层

说的对
 楼主| 发表于 2025-5-27 09:51 | 显示全部楼层
ONEChoy 发表于 2025-5-26 18:09
网页去chrome/edge商店搜refresh有很多。。。应用布吉岛。。。

全屏的那种
发表于 2025-5-27 10:59 来自手机 | 显示全部楼层
梦素 发表于 2025-5-27 10:48
保存成html文件,打开就行。 另:请及时结清60%尾款

尾款666
发表于 2025-5-27 11:00 | 显示全部楼层
powerduke 发表于 2025-5-26 18:58
这个需求是有什么用途?

就是日历
发表于 2025-5-27 11:27 | 显示全部楼层
让DS给你写一个呗
 楼主| 发表于 2025-5-27 11:33 | 显示全部楼层
梦素 发表于 2025-5-27 10:48
保存成html文件,打开就行,也可以用Wallpaper Engine的添加自定义html功能把它设为桌面背景。 另:请及时 ...

真正的高手
发表于 2025-5-27 11:52 | 显示全部楼层
YsHaNg 发表于 2025-5-26 19:21
看到我愣了一下 难不成还可以用纸笔写吗 哈哈哈哈哈哈

有点奇怪,那么你看到我的回复当时想到了什么,好奇
发表于 2025-5-27 15:29 | 显示全部楼层
梦素 发表于 2025-5-27 10:48
保存成html文件,打开就行,也可以用Wallpaper Engine的添加自定义html功能把它设为桌面背景。 另:请及时 ...

前端大佬就是厉害,这种需求确实用js写代码更合适。
发表于 2025-5-27 17:03 来自手机 | 显示全部楼层
yakeyyy 发表于 2025-5-27 03:52
有点奇怪,那么你看到我的回复当时想到了什么,好奇

literally我的第一个回复
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

Archiver|手机版|小黑屋|Chiphell ( 沪ICP备12027953号-5 )沪公网备310112100042806 上海市互联网违法与不良信息举报中心

GMT+8, 2025-5-28 15:41 , Processed in 0.015107 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2007-2024 Chiphell.com All rights reserved.

快速回复 返回顶部 返回列表