index.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Xaf Pet</title>
  6. <link rel="stylesheet" href="animations.css" />
  7. <style>
  8. html, body {
  9. width: 100%; height: 100%; margin: 0; overflow: hidden;
  10. background: transparent !important;
  11. -webkit-app-region: no-drag;
  12. }
  13. #pet-stage {
  14. position: fixed; inset: 0; display: flex; align-items: flex-end;
  15. justify-content: center; pointer-events: none;
  16. background: transparent !important;
  17. }
  18. #pet {
  19. width: 120px; height: 140px; pointer-events: auto;
  20. cursor: grab; user-select: none;
  21. -webkit-app-region: no-drag;
  22. }
  23. #pet img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
  24. #bubble {
  25. position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%);
  26. background: rgba(255,255,255,0.95); border: 2px solid #4A9BD7;
  27. border-radius: 12px; padding: 6px 12px;
  28. font: 13px/1.4 'PingFang SC', sans-serif; color: #333;
  29. white-space: nowrap; display: none; box-shadow: 0 2px 8px rgba(0,0,0,.12);
  30. pointer-events: none;
  31. }
  32. #bubble::after {
  33. content: ''; position: absolute; top: 100%; left: 50%;
  34. transform: translateX(-50%);
  35. border: 6px solid transparent; border-top-color: #4A9BD7;
  36. }
  37. /* 右键菜单 */
  38. #context-menu {
  39. position: absolute; display: none;
  40. background: #fff; border: 1px solid #ccc; border-radius: 6px;
  41. box-shadow: 0 2px 12px rgba(0,0,0,.15); padding: 4px 0;
  42. min-width: 120px; z-index: 9999; pointer-events: auto;
  43. }
  44. #context-menu .item {
  45. padding: 6px 16px; font-size: 13px; cursor: pointer; color: #333;
  46. }
  47. #context-menu .item:hover { background: #f0f6ff; }
  48. #context-menu .divider { height: 1px; background: #e0e0e0; margin: 4px 0; }
  49. </style>
  50. </head>
  51. <body>
  52. <div id="pet-stage">
  53. <div id="pet">
  54. <img id="pet-img" src="" alt="pet" draggable="false" />
  55. <div id="bubble"></div>
  56. </div>
  57. </div>
  58. <!-- 右键菜单 -->
  59. <div id="context-menu">
  60. <div class="item" data-action="settings">设置</div>
  61. <div class="item" data-action="passthrough">鼠标穿透</div>
  62. <div class="divider"></div>
  63. <div class="item" data-action="quit">退出</div>
  64. </div>
  65. <script src="animation-gen.js"></script>
  66. <script src="pet-engine.js"></script>
  67. <script src="bridge.js"></script>
  68. <script src="interactions.js"></script>
  69. </body>
  70. </html>