animations.css 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* html-ppt :: animations.css
  2. * Apply by adding class="anim-<name>" or data-anim="<name>".
  3. * Durations are deliberately snappy; tweak --anim-dur per element.
  4. */
  5. :root{--anim-dur:.7s;--anim-ease:cubic-bezier(.4,0,.2,1)}
  6. /* ---------- FADE DIRECTIONALS ---------- */
  7. @keyframes kf-fade-up{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:none}}
  8. @keyframes kf-fade-down{from{opacity:0;transform:translateY(-32px)}to{opacity:1;transform:none}}
  9. @keyframes kf-fade-left{from{opacity:0;transform:translateX(-40px)}to{opacity:1;transform:none}}
  10. @keyframes kf-fade-right{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:none}}
  11. .anim-fade-up{animation:kf-fade-up var(--anim-dur) var(--anim-ease) both}
  12. .anim-fade-down{animation:kf-fade-down var(--anim-dur) var(--anim-ease) both}
  13. .anim-fade-left{animation:kf-fade-left var(--anim-dur) var(--anim-ease) both}
  14. .anim-fade-right{animation:kf-fade-right var(--anim-dur) var(--anim-ease) both}
  15. /* ---------- RISE / DROP / ZOOM / BLUR / GLITCH ---------- */
  16. @keyframes kf-rise{from{opacity:0;transform:translateY(60px) scale(.97);filter:blur(6px)}to{opacity:1;transform:none;filter:none}}
  17. @keyframes kf-drop{from{opacity:0;transform:translateY(-60px) scale(.97)}to{opacity:1;transform:none}}
  18. @keyframes kf-zoom{0%{opacity:0;transform:scale(.6)}60%{transform:scale(1.04)}100%{opacity:1;transform:scale(1)}}
  19. @keyframes kf-blur{from{opacity:0;filter:blur(18px)}to{opacity:1;filter:none}}
  20. @keyframes kf-glitch{0%{opacity:0;transform:translateX(0);clip-path:inset(0 0 0 0)}
  21. 20%{opacity:1;transform:translateX(-6px);clip-path:inset(20% 0 30% 0)}
  22. 40%{transform:translateX(4px);clip-path:inset(50% 0 10% 0)}
  23. 60%{transform:translateX(-3px);clip-path:inset(10% 0 60% 0)}
  24. 80%{transform:translateX(2px);clip-path:inset(0 0 0 0)}
  25. 100%{opacity:1;transform:none}}
  26. .anim-rise-in{animation:kf-rise .9s var(--anim-ease) both}
  27. .anim-drop-in{animation:kf-drop .8s var(--anim-ease) both}
  28. .anim-zoom-pop{animation:kf-zoom .7s cubic-bezier(.22,1.3,.36,1) both}
  29. .anim-blur-in{animation:kf-blur .8s var(--anim-ease) both}
  30. .anim-glitch-in{animation:kf-glitch .8s steps(5,end) both}
  31. /* ---------- TYPEWRITER ---------- */
  32. .anim-typewriter{display:inline-block;overflow:hidden;white-space:nowrap;border-right:2px solid currentColor;
  33. width:0;animation:kf-type 2.4s steps(40,end) forwards, kf-caret 1s step-end infinite}
  34. @keyframes kf-type{to{width:100%}}
  35. @keyframes kf-caret{50%{border-color:transparent}}
  36. /* ---------- GLOW / SHIMMER / GRADIENT-FLOW ---------- */
  37. @keyframes kf-neon{0%,100%{text-shadow:0 0 8px var(--accent),0 0 20px var(--accent)}
  38. 50%{text-shadow:0 0 16px var(--accent),0 0 40px var(--accent),0 0 80px var(--accent)}}
  39. .anim-neon-glow{animation:kf-neon 2s ease-in-out infinite}
  40. .anim-shimmer-sweep{position:relative;overflow:hidden}
  41. .anim-shimmer-sweep::after{content:"";position:absolute;inset:0;
  42. background:linear-gradient(110deg,transparent 40%,rgba(255,255,255,.55) 50%,transparent 60%);
  43. transform:translateX(-100%);animation:kf-shimmer 2.4s var(--anim-ease) infinite}
  44. @keyframes kf-shimmer{to{transform:translateX(100%)}}
  45. .anim-gradient-flow{background:linear-gradient(90deg,var(--accent),var(--accent-2,var(--accent)),var(--accent-3,var(--accent)),var(--accent));
  46. background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  47. animation:kf-gradflow 4s linear infinite}
  48. @keyframes kf-gradflow{to{background-position:300% 0}}
  49. /* ---------- STAGGER LIST ---------- */
  50. .anim-stagger-list > *{opacity:0;animation:kf-rise .65s var(--anim-ease) both}
  51. .anim-stagger-list > *:nth-child(1){animation-delay:.05s}
  52. .anim-stagger-list > *:nth-child(2){animation-delay:.15s}
  53. .anim-stagger-list > *:nth-child(3){animation-delay:.25s}
  54. .anim-stagger-list > *:nth-child(4){animation-delay:.35s}
  55. .anim-stagger-list > *:nth-child(5){animation-delay:.45s}
  56. .anim-stagger-list > *:nth-child(6){animation-delay:.55s}
  57. .anim-stagger-list > *:nth-child(7){animation-delay:.65s}
  58. .anim-stagger-list > *:nth-child(8){animation-delay:.75s}
  59. .anim-stagger-list > *:nth-child(n+9){animation-delay:.85s}
  60. /* ---------- COUNTER-UP (JS-driven, marker class only) ---------- */
  61. .counter{font-variant-numeric:tabular-nums}
  62. /* ---------- SVG PATH DRAW ---------- */
  63. .anim-path-draw path,.anim-path-draw line,.anim-path-draw polyline,.anim-path-draw circle,.anim-path-draw rect{
  64. stroke-dasharray:1000;stroke-dashoffset:1000;animation:kf-draw 2s var(--anim-ease) forwards}
  65. @keyframes kf-draw{to{stroke-dashoffset:0}}
  66. /* ---------- PARALLAX TILT (hover) ---------- */
  67. .anim-parallax-tilt{transform-style:preserve-3d;transition:transform .4s var(--anim-ease)}
  68. .anim-parallax-tilt:hover{transform:perspective(900px) rotateX(6deg) rotateY(-8deg) translateZ(10px)}
  69. /* ---------- CARD FLIP 3D ---------- */
  70. @keyframes kf-flip{from{transform:perspective(1200px) rotateY(-90deg);opacity:0}
  71. to{transform:perspective(1200px) rotateY(0);opacity:1}}
  72. .anim-card-flip-3d{animation:kf-flip .9s var(--anim-ease) both;transform-style:preserve-3d;backface-visibility:hidden}
  73. /* ---------- CUBE ROTATE 3D ---------- */
  74. @keyframes kf-cube{from{transform:perspective(1200px) rotateX(20deg) rotateY(-90deg) translateZ(-200px);opacity:0}
  75. to{transform:perspective(1200px) rotateX(0) rotateY(0) translateZ(0);opacity:1}}
  76. .anim-cube-rotate-3d{animation:kf-cube 1s var(--anim-ease) both}
  77. /* ---------- PAGE TURN 3D ---------- */
  78. @keyframes kf-pageturn{from{transform:perspective(1600px) rotateY(-85deg);transform-origin:left center;opacity:0}
  79. to{transform:perspective(1600px) rotateY(0);opacity:1}}
  80. .anim-page-turn-3d{animation:kf-pageturn 1s var(--anim-ease) both;transform-origin:left center}
  81. /* ---------- PERSPECTIVE ZOOM ---------- */
  82. @keyframes kf-pzoom{from{opacity:0;transform:perspective(1400px) translateZ(-400px) rotateX(12deg)}
  83. to{opacity:1;transform:none}}
  84. .anim-perspective-zoom{animation:kf-pzoom 1s var(--anim-ease) both}
  85. /* ---------- MARQUEE SCROLL ---------- */
  86. .anim-marquee-scroll{display:flex;gap:48px;white-space:nowrap;animation:kf-marquee 20s linear infinite}
  87. @keyframes kf-marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}
  88. /* ---------- KEN BURNS ---------- */
  89. @keyframes kf-kenburns{0%{transform:scale(1) translate(0,0)}100%{transform:scale(1.15) translate(-2%,-1%)}}
  90. .anim-kenburns{animation:kf-kenburns 14s ease-in-out infinite alternate}
  91. /* ---------- CONFETTI BURST (pseudo — pure CSS sparkles) ---------- */
  92. .anim-confetti-burst{position:relative}
  93. .anim-confetti-burst::before,.anim-confetti-burst::after{
  94. content:"";position:absolute;top:50%;left:50%;width:8px;height:8px;border-radius:50%;
  95. background:var(--accent);box-shadow:
  96. 20px -30px 0 var(--accent-2,var(--accent)),-25px -20px 0 var(--accent-3,var(--accent)),
  97. 30px 20px 0 var(--good,#1aaf6c),-30px 25px 0 var(--warn,#f5a524),
  98. 40px -10px 0 var(--bad,#e0445a),-45px 0 0 var(--accent),
  99. 10px 40px 0 var(--accent-2,var(--accent)),-15px -40px 0 var(--accent-3,var(--accent));
  100. opacity:0;animation:kf-confetti 1.2s var(--anim-ease) forwards}
  101. .anim-confetti-burst::after{animation-delay:.15s;transform:rotate(45deg)}
  102. @keyframes kf-confetti{0%{opacity:0;transform:scale(.2)}30%{opacity:1}100%{opacity:0;transform:scale(2.2)}}
  103. /* ---------- SPOTLIGHT ---------- */
  104. @keyframes kf-spot{0%{clip-path:circle(0% at 50% 50%)}100%{clip-path:circle(140% at 50% 50%)}}
  105. .anim-spotlight{animation:kf-spot 1.1s var(--anim-ease) both}
  106. /* ---------- MORPH SHAPE (SVG) ---------- */
  107. .anim-morph-shape path{animation:kf-morph 6s ease-in-out infinite alternate}
  108. @keyframes kf-morph{0%{d:path("M60,120 Q120,20 180,120 T300,120")}
  109. 100%{d:path("M60,120 Q120,220 180,120 T300,120")}}
  110. /* ---------- RIPPLE REVEAL ---------- */
  111. @keyframes kf-ripple{0%{clip-path:circle(0% at 20% 80%);opacity:.4}
  112. 100%{clip-path:circle(160% at 20% 80%);opacity:1}}
  113. .anim-ripple-reveal{animation:kf-ripple 1.2s var(--anim-ease) both}
  114. /* reduced motion */
  115. @media (prefers-reduced-motion: reduce){
  116. [class*="anim-"]{animation:none!important;transition:none!important}
  117. }