mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
feat(registry): add media treatment overlays
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 322 KiB |
@@ -0,0 +1,73 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#editorial-flash-demo {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background: #080808;
|
||||
}
|
||||
|
||||
#ef-demo-backdrop,
|
||||
#ef-demo-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#ef-demo-backdrop {
|
||||
object-fit: cover;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="editorial-flash-demo"
|
||||
data-composition-id="editorial-flash-demo"
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<img
|
||||
id="ef-demo-backdrop"
|
||||
class="clip"
|
||||
src="./demo-backdrop.jpg"
|
||||
alt=""
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-track-index="0"
|
||||
/>
|
||||
<div
|
||||
id="ef-demo-overlay"
|
||||
data-composition-id="editorial-flash-overlay"
|
||||
data-composition-src="editorial-flash-overlay.html"
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-track-index="1"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
tl.to("#ef-demo-backdrop", { scale: 1.035, duration: 4, ease: "none" }, 0);
|
||||
window.__timelines = window.__timelines || {};
|
||||
window.__timelines["editorial-flash-demo"] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,129 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#ef-flash {
|
||||
--hf-editorial-flash-wash: 255 253 250;
|
||||
--hf-editorial-flash-warm: 255 174 105;
|
||||
--hf-editorial-flash-cool: 183 218 255;
|
||||
position: absolute;
|
||||
inset: -12%;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#ef-flash .ef-layer {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
opacity: 0;
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
#ef-wash {
|
||||
background: rgb(var(--hf-editorial-flash-wash));
|
||||
}
|
||||
|
||||
#ef-core {
|
||||
inset: -18%;
|
||||
background: radial-gradient(
|
||||
ellipse 68% 92% at 37% 47%,
|
||||
rgb(255 255 255) 0%,
|
||||
rgb(255 255 255 / 98%) 20%,
|
||||
rgb(var(--hf-editorial-flash-wash) / 86%) 45%,
|
||||
rgb(var(--hf-editorial-flash-warm) / 32%) 67%,
|
||||
transparent 86%
|
||||
);
|
||||
mix-blend-mode: screen;
|
||||
transform-origin: 38% 48%;
|
||||
}
|
||||
|
||||
#ef-sweep {
|
||||
inset: -28%;
|
||||
background: linear-gradient(
|
||||
108deg,
|
||||
transparent 21%,
|
||||
rgb(var(--hf-editorial-flash-warm) / 10%) 38%,
|
||||
rgb(var(--hf-editorial-flash-wash) / 90%) 49%,
|
||||
rgb(255 255 255 / 98%) 53%,
|
||||
rgb(var(--hf-editorial-flash-cool) / 24%) 62%,
|
||||
transparent 79%
|
||||
);
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div
|
||||
id="editorial-flash-overlay"
|
||||
data-composition-id="editorial-flash-overlay"
|
||||
data-start="0"
|
||||
data-duration="4"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
>
|
||||
<div id="ef-flash" aria-hidden="true">
|
||||
<div id="ef-wash" class="ef-layer"></div>
|
||||
<div id="ef-core" class="ef-layer" data-layout-allow-overflow></div>
|
||||
<div id="ef-sweep" class="ef-layer" data-layout-allow-overflow></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.__timelines = window.__timelines || {};
|
||||
|
||||
var flash = document.getElementById("ef-flash");
|
||||
var host = flash && flash.closest("[data-composition-id]");
|
||||
if (!host) throw new Error("Editorial Flash could not find its composition host");
|
||||
|
||||
var compositionId = host.getAttribute("data-composition-id");
|
||||
var duration = Number(host.getAttribute("data-duration")) || 4;
|
||||
var hit = Math.max(0.12, duration * 0.58);
|
||||
var tl = gsap.timeline({ paused: true });
|
||||
|
||||
tl.to({}, { duration: duration, ease: "none" }, 0);
|
||||
tl.to("#ef-wash", { opacity: 0.92, duration: 0.04, ease: "power4.in" }, hit);
|
||||
tl.fromTo(
|
||||
"#ef-core",
|
||||
{ opacity: 0, scale: 0.86, rotation: -5 },
|
||||
{ opacity: 1, scale: 1, rotation: -5, duration: 0.05, ease: "power4.in" },
|
||||
hit - 0.01,
|
||||
);
|
||||
tl.fromTo(
|
||||
"#ef-sweep",
|
||||
{ opacity: 0, xPercent: -12, rotation: -2 },
|
||||
{ opacity: 0.9, xPercent: 8, rotation: -2, duration: 0.04, ease: "power4.in" },
|
||||
hit,
|
||||
);
|
||||
tl.to("#ef-wash", { opacity: 0, duration: 0.18, ease: "power3.out" }, hit + 0.04);
|
||||
tl.to(
|
||||
"#ef-core",
|
||||
{ opacity: 0, scale: 1.18, rotation: -5, duration: 0.34, ease: "power2.out" },
|
||||
hit + 0.04,
|
||||
);
|
||||
tl.to(
|
||||
"#ef-sweep",
|
||||
{ opacity: 0, xPercent: 28, rotation: -2, duration: 0.3, ease: "power2.out" },
|
||||
hit + 0.04,
|
||||
);
|
||||
|
||||
window.__timelines[compositionId] = tl;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"$schema": "https://hyperframes.heygen.com/schema/registry-item.json",
|
||||
"name": "editorial-flash-overlay",
|
||||
"type": "hyperframes:block",
|
||||
"title": "Editorial Flash Overlay",
|
||||
"description": "Finite neutral-warm light layers for a seek-safe camera-flash cut or social reveal",
|
||||
"tags": [
|
||||
"flash",
|
||||
"editorial",
|
||||
"social",
|
||||
"light",
|
||||
"transition",
|
||||
"overlay",
|
||||
"media-treatment-overlay"
|
||||
],
|
||||
"dimensions": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
},
|
||||
"duration": 4,
|
||||
"files": [
|
||||
{
|
||||
"path": "editorial-flash-overlay.html",
|
||||
"target": "compositions/editorial-flash-overlay.html",
|
||||
"type": "hyperframes:composition"
|
||||
}
|
||||
],
|
||||
"preview": {
|
||||
"poster": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/editorial-flash-overlay.png",
|
||||
"video": "https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/editorial-flash-overlay.mp4"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user