chatbot-fix copy.css 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /**
  2. * ChatBotPage 小屏幕修复
  3. * 解决宽度 < 280px 或高度 < 500px 时的白屏问题
  4. */
  5. /* 极小屏幕降级:允许滚动 */
  6. html[data-too-small="true"] .chatbot-container,
  7. body[data-too-small="true"] .chatbot-container,
  8. #root[data-too-small="true"] .chatbot-container {
  9. overflow-y: auto !important;
  10. overflow-x: hidden !important;
  11. min-height: 600px;
  12. height: auto;
  13. /* 确保背景始终覆盖 */
  14. background: linear-gradient(to bottom, #25232E, #2B2A2F) !important;
  15. }
  16. /* 确保内层容器也能正确显示 */
  17. html[data-too-small="true"] .chatbot-container > div,
  18. body[data-too-small="true"] .chatbot-container > div,
  19. #root[data-too-small="true"] .chatbot-container > div {
  20. min-height: 600px;
  21. }
  22. /* 极小屏幕时,确保背景图片可见 */
  23. html[data-too-small="true"] .chatbot-bg,
  24. body[data-too-small="true"] .chatbot-bg,
  25. #root[data-too-small="true"] .chatbot-bg {
  26. position: absolute;
  27. min-height: 600px;
  28. }
  29. .energy-stone-layer {
  30. position: absolute;
  31. inset: 0;
  32. pointer-events: none;
  33. }
  34. .energy-stone {
  35. position: absolute;
  36. border: none;
  37. background: transparent;
  38. padding: 0;
  39. cursor: pointer;
  40. pointer-events: auto;
  41. transition: opacity 1.5s ease-out, transform 1.5s ease-out;
  42. filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
  43. /* 移除浮动动画,因为现在由容器处理 */
  44. animation: none;
  45. }
  46. .energy-stone img {
  47. width: 100%;
  48. height: 100%;
  49. display: block;
  50. pointer-events: none;
  51. }
  52. .energy-stone[data-type='mission'] {
  53. animation-duration: 8s;
  54. }
  55. /* 能量石容器:应用浮动动画,让光晕和能量石按钮一起浮动 */
  56. /* 关闭能量石的浮动动画,保持静止,避免路径被叠加 */
  57. .energy-stone-container {
  58. animation: none !important;
  59. }
  60. /* 调试生成的能量石允许恢复浮动动画 */
  61. .energy-stone-container.debug-float {
  62. animation: energyStoneContainerFloat 6s ease-in-out infinite !important;
  63. }
  64. .energy-stone-container[data-fading='true'][data-anim-ready='true'][data-stone-id] {
  65. /* 移除浮动动画,应用移动动画 */
  66. animation: energyStoneMoveToAvatar 1s ease-in-out forwards !important;
  67. /* 确保 transform 能够正确应用 */
  68. transform-origin: center center !important;
  69. /* 使用 fixed 定位,以便正确使用像素值进行动画 */
  70. position: fixed !important;
  71. z-index: 10000 !important;
  72. pointer-events: none !important;
  73. }
  74. /* 正式能量石动画时,保持大小,仅透明度渐隐 */
  75. .energy-stone-container[data-fading='true'][data-anim-ready='true'][data-stone-id] .energy-stone {
  76. animation: energyStoneShrink 1.4s ease-in-out forwards !important;
  77. }
  78. .energy-stone-container[data-fading='true'][data-anim-ready='true'][data-stone-id] .energy-stone-hint {
  79. animation: energyStoneHintShrink 1.4s ease-in-out forwards !important;
  80. }
  81. /* 正式能量石移动到动画形象中心的动画 - 从当前位置移动到终点 */
  82. /* 使用 CSS 变量来设置起点和终点,支持横向和纵向移动 */
  83. @keyframes energyStoneMoveToAvatar {
  84. 0% {
  85. /* 起点:使用 transform 位移为 0,位置由元素当前 left/top 决定 */
  86. transform: translate(-50%, -50%) translate3d(0, 0, 0) !important;
  87. opacity: 1 !important;
  88. }
  89. 85% {
  90. /* 大部分时间保持可见,降低提前消失感知 */
  91. transform: translate(-50%, -50%) translate3d(
  92. var(--animation-dx, 0),
  93. var(--animation-dy, 0),
  94. 0
  95. ) !important;
  96. opacity: 1 !important;
  97. }
  98. 100% {
  99. /* 终点:在 transform 中叠加位移,避免依赖 left/top 动画 */
  100. transform: translate(-50%, -50%) translate3d(
  101. var(--animation-dx, 0),
  102. var(--animation-dy, 0),
  103. 0
  104. ) !important;
  105. opacity: 0 !important;
  106. }
  107. }
  108. /* 正式能量石缩小动画 - 从 48px 缩小到 4.8px (10%) */
  109. @keyframes energyStoneShrink {
  110. 0% {
  111. width: min(calc(48 * min(100vw, 600PX) / 393), calc(5.633802816901408 * var(--vh, 1vh))) !important;
  112. height: min(calc(48 * min(100vw, 600PX) / 393), calc(5.633802816901408 * var(--vh, 1vh))) !important;
  113. opacity: 1 !important;
  114. }
  115. 100% {
  116. width: min(calc(48 * min(100vw, 600PX) / 393), calc(5.633802816901408 * var(--vh, 1vh))) !important;
  117. height: min(calc(48 * min(100vw, 600PX) / 393), calc(5.633802816901408 * var(--vh, 1vh))) !important;
  118. opacity: 0 !important;
  119. }
  120. }
  121. /* 正式能量石光晕缩小动画 - 从 92px 缩小到 9.2px (10%) */
  122. @keyframes energyStoneHintShrink {
  123. 0% {
  124. width: min(calc(92 * min(100vw, 600PX) / 393), calc(10.7981220657277 * var(--vh, 1vh))) !important;
  125. height: min(calc(92 * min(100vw, 600PX) / 393), calc(10.7981220657277 * var(--vh, 1vh))) !important;
  126. opacity: 1 !important;
  127. }
  128. 100% {
  129. width: min(calc(92 * min(100vw, 600PX) / 393), calc(10.7981220657277 * var(--vh, 1vh))) !important;
  130. height: min(calc(92 * min(100vw, 600PX) / 393), calc(10.7981220657277 * var(--vh, 1vh))) !important;
  131. opacity: 0 !important;
  132. }
  133. }
  134. @keyframes energyStoneContainerFloat {
  135. 0% {
  136. transform: translate(-50%, -50%) translateY(0);
  137. }
  138. 50% {
  139. transform: translate(-50%, -50%) translateY(-10px);
  140. }
  141. 100% {
  142. transform: translate(-50%, -50%) translateY(0);
  143. }
  144. }
  145. .chatbot-avatar-hint {
  146. position: absolute;
  147. top: 50%;
  148. left: 50%;
  149. transform: translate(-50%, -50%) scale(0.9);
  150. opacity: 0.25;
  151. pointer-events: none;
  152. animation: avatarHintPulse 2.6s ease-in-out infinite;
  153. z-index: 0;
  154. filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
  155. display: block;
  156. max-width: none;
  157. max-height: none;
  158. border-radius: 50%;
  159. aspect-ratio: 1 / 1;
  160. object-fit: contain;
  161. }
  162. @keyframes avatarHintPulse {
  163. 0% {
  164. transform: translate(-50%, -50%) scale(0.9);
  165. opacity: 0.2;
  166. }
  167. 50% {
  168. transform: translate(-50%, -50%) scale(1.05);
  169. opacity: 0.7;
  170. }
  171. 100% {
  172. transform: translate(-50%, -50%) scale(0.9);
  173. opacity: 0.2;
  174. }
  175. }
  176. /* 能量石光晕呼吸灯效果 */
  177. .energy-stone-hint {
  178. animation: energyStoneHintPulse 2s ease-in-out infinite;
  179. }
  180. /* 当光晕在 energy-stone 容器内时,只需要缩放和透明度动画 */
  181. /* 浮动效果由容器处理,确保光晕和能量石按钮完全同步 */
  182. .energy-stone .energy-stone-hint {
  183. animation: energyStoneHintPulseScale 2s ease-in-out infinite;
  184. }
  185. @keyframes energyStoneHintPulse {
  186. 0% {
  187. opacity: 0.6;
  188. transform: translate(-50%, -50%) scale(0.7);
  189. }
  190. 50% {
  191. opacity: 1;
  192. transform: translate(-50%, -50%) scale(1);
  193. }
  194. 100% {
  195. opacity: 0.6;
  196. transform: translate(-50%, -50%) scale(0.7);
  197. }
  198. }
  199. /* 光晕的呼吸灯和缩放动画,同时跟随能量石按钮的浮动效果 */
  200. /* transform 必须包含 translate(-50%, -50%) 保持居中,以及 scale 缩放效果 */
  201. /* 光晕和能量石按钮都使用相同的基准点(50%, 50%),确保中心一致 */
  202. @keyframes energyStoneHintPulseWithScale {
  203. 0% {
  204. opacity: 0.6;
  205. transform: translate(-50%, -50%) scale(0.7);
  206. }
  207. 50% {
  208. opacity: 1;
  209. transform: translate(-50%, -50%) scale(1);
  210. }
  211. 100% {
  212. opacity: 0.6;
  213. transform: translate(-50%, -50%) scale(0.7);
  214. }
  215. }
  216. /* 光晕的呼吸灯动画(只包含透明度和缩放) */
  217. /* 浮动效果由容器处理,确保光晕和能量石按钮完全同步 */
  218. /* transform 必须包含 translate(-50%, -50%) 保持居中 */
  219. @keyframes energyStoneHintPulseScale {
  220. 0% {
  221. opacity: 0.6;
  222. transform: translate(-50%, -50%) scale(0.7);
  223. }
  224. 50% {
  225. opacity: 1;
  226. transform: translate(-50%, -50%) scale(1);
  227. }
  228. 100% {
  229. opacity: 0.6;
  230. transform: translate(-50%, -50%) scale(0.7);
  231. }
  232. }