mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 16:42:27 +00:00
1 line
5.2 KiB
JSON
1 line
5.2 KiB
JSON
{"html":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=1920, height=1080\" />\n <title>Chromatic Aberration Wipe - Demo</title>\n <script src=\"https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js\"></script>\n <style>\n * {\n box-sizing: border-box;\n }\n html,\n body {\n margin: 0;\n width: 1920px;\n height: 1080px;\n overflow: hidden;\n }\n #demo {\n width: 1920px;\n height: 1080px;\n display: grid;\n place-items: center;\n background: #f7f7f8;\n font-family: Inter, system-ui, sans-serif;\n }\n .demo-frame {\n display: grid;\n place-items: center;\n padding: 52px;\n /* ponytail: scale wrapper (not a GSAP target) to fill ~65% of 1920x1080 */\n transform: scale(1.85);\n }\n .hf-catalog-chromatic-aberration-wipe {\n --hf-accent: #2563eb;\n --hf-ink: #111827;\n --hf-muted: #6b7280;\n --hf-surface: #ffffff;\n color: var(--hf-ink);\n font-family: Inter, system-ui, sans-serif;\n }\n .hf-catalog-chromatic-aberration-wipe {\n position: relative;\n width: 760px;\n height: 428px;\n overflow: hidden;\n border-radius: 30px;\n background: #111827;\n box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);\n }\n .hf-catalog-chromatic-aberration-wipe .scene {\n position: absolute;\n inset: 0;\n display: grid;\n place-items: center;\n font-weight: 900;\n font-size: 58px;\n letter-spacing: -0.05em;\n color: #fff;\n }\n .hf-catalog-chromatic-aberration-wipe .from {\n background: linear-gradient(135deg, #111827, #374151);\n transform: translate(var(--hf-from-x, 0px), var(--hf-from-y, 0px))\n scale(var(--hf-from-scale, 1));\n filter: blur(var(--hf-from-blur, 0px));\n }\n .hf-catalog-chromatic-aberration-wipe .to {\n background: linear-gradient(135deg, #2563eb, #7c3aed);\n transform: translate(var(--hf-to-x, 0px), var(--hf-to-y, 0px)) scale(var(--hf-to-scale, 1));\n clip-path: inset(\n var(--hf-clip-top, 0%) var(--hf-clip-right, 100%) var(--hf-clip-bottom, 0%)\n var(--hf-clip-left, 0%)\n );\n }\n .hf-catalog-chromatic-aberration-wipe .fx {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);\n mix-blend-mode: screen;\n transform: translateX(var(--hf-fx-x, -110%));\n }\n .hf-catalog-chromatic-aberration-wipe .rgb {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: var(--hf-rgb-opacity, 0);\n background: linear-gradient(\n 90deg,\n rgba(239, 68, 68, 0.35),\n transparent,\n rgba(34, 211, 238, 0.35)\n );\n transform: translateX(var(--hf-rgb-x, 0px));\n }\n </style>\n </head>\n <body>\n <div\n id=\"demo\"\n data-composition-id=\"chromatic-aberration-wipe-demo\"\n data-start=\"0\"\n data-width=\"1920\"\n data-height=\"1080\"\n data-duration=\"5\"\n >\n <div class=\"demo-frame\">\n <div class=\"hf-catalog-chromatic-aberration-wipe\">\n <div class=\"scene from\">Before</div>\n <div class=\"scene to\">Chromatic Aberration Wipe</div>\n <div class=\"fx\"></div>\n <div class=\"rgb\"></div>\n </div>\n </div>\n <script>\n const tl = gsap.timeline({ paused: true });\n const startTime = 0.5;\n tl.fromTo(\n \".hf-catalog-chromatic-aberration-wipe .to\",\n { \"--hf-clip-right\": \"100%\", \"--hf-to-x\": \"60px\", \"--hf-to-scale\": 1.04 },\n {\n \"--hf-clip-right\": \"0%\",\n \"--hf-to-x\": \"0px\",\n \"--hf-to-scale\": 1,\n duration: 0.9,\n ease: \"power3.inOut\",\n },\n startTime,\n );\n tl.to(\n \".hf-catalog-chromatic-aberration-wipe .from\",\n {\n \"--hf-from-x\": \"-70px\",\n \"--hf-from-scale\": 0.96,\n \"--hf-from-blur\": \"5px\",\n duration: 0.9,\n ease: \"power3.inOut\",\n },\n startTime,\n );\n tl.fromTo(\n \".hf-catalog-chromatic-aberration-wipe .fx\",\n { \"--hf-fx-x\": \"-110%\" },\n { \"--hf-fx-x\": \"110%\", duration: 0.58, ease: \"power2.inOut\" },\n startTime + 0.18,\n );\n tl.fromTo(\n \".hf-catalog-chromatic-aberration-wipe .rgb\",\n { \"--hf-rgb-opacity\": 0, \"--hf-rgb-x\": \"-16px\" },\n {\n \"--hf-rgb-opacity\": 1,\n \"--hf-rgb-x\": \"16px\",\n repeat: 3,\n yoyo: true,\n duration: 0.07,\n ease: \"steps(1)\",\n },\n startTime + 0.32,\n );\n tl.set({}, {}, 5);\n window.__timelines = window.__timelines || {};\n window.__timelines[\"chromatic-aberration-wipe-demo\"] = tl;\n </script>\n </div>\n </body>\n</html>\n"} |