led.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  6. <title>LED 滚动文字</title>
  7. <style>
  8. /* LED 滚动窗口:透明背景,整行可拖动 */
  9. * { box-sizing: border-box; }
  10. html, body {
  11. margin: 0;
  12. height: 100%;
  13. overflow: hidden;
  14. background: transparent !important; /* 强制透明:窗口无底色 */
  15. -webkit-user-select: none;
  16. user-select: none;
  17. }
  18. .led-wrap {
  19. position: relative;
  20. width: 100vw;
  21. height: 100vh;
  22. display: flex;
  23. align-items: center;
  24. background: transparent !important;
  25. --wails-draggable: drag; /* 整行可拖动窗口 */
  26. cursor: move;
  27. }
  28. /* 点阵画布:透明底,点阵由 requestAnimationFrame 驱动 */
  29. #led-canvas {
  30. display: block;
  31. background: transparent;
  32. width: 100%;
  33. height: 100%;
  34. }
  35. /* 关闭按钮:不触发拖动 */
  36. .led-close {
  37. position: absolute;
  38. top: 6px;
  39. right: 6px;
  40. width: 24px;
  41. height: 24px;
  42. border: 1px solid rgba(255, 255, 255, 0.22);
  43. border-radius: 6px;
  44. background: rgba(0, 0, 0, 0.45);
  45. color: #fff;
  46. font-size: 15px;
  47. line-height: 1;
  48. cursor: pointer;
  49. --wails-draggable: no-drag;
  50. z-index: 10;
  51. }
  52. .led-close:hover { background: rgba(255, 77, 77, 0.6); }
  53. </style>
  54. </head>
  55. <body>
  56. <div class="led-wrap" id="led-wrap">
  57. <canvas id="led-canvas"></canvas>
  58. <button class="led-close" id="led-close" title="关闭">×</button>
  59. </div>
  60. <script type="module" src="/src/led.js"></script>
  61. </body>
  62. </html>