mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
style: format caption component files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
78ddd2602b
commit
a19a772dc5
@@ -6,7 +6,10 @@
|
||||
<title>Parallax Layers</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap" rel="stylesheet" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<style>
|
||||
*,
|
||||
@@ -113,9 +116,9 @@
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
line-height: 0.9;
|
||||
color: #E50914;
|
||||
-webkit-text-stroke: 5px #E50914;
|
||||
text-shadow: 2px 4px 4px #A30610;
|
||||
color: #e50914;
|
||||
-webkit-text-stroke: 5px #e50914;
|
||||
text-shadow: 2px 4px 4px #a30610;
|
||||
}
|
||||
|
||||
.word--front-normal {
|
||||
@@ -123,8 +126,10 @@
|
||||
font-size: 130px;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
color: #EEEEEE;
|
||||
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 4px 24px rgba(0, 0, 0, 0.35);
|
||||
color: #eeeeee;
|
||||
text-shadow:
|
||||
0 2px 12px rgba(0, 0, 0, 0.6),
|
||||
0 4px 24px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.word--front-italic {
|
||||
@@ -132,8 +137,10 @@
|
||||
font-size: 130px;
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
color: #EEEEEE;
|
||||
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 4px 24px rgba(0, 0, 0, 0.35);
|
||||
color: #eeeeee;
|
||||
text-shadow:
|
||||
0 2px 12px rgba(0, 0, 0, 0.6),
|
||||
0 4px 24px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -175,48 +182,48 @@
|
||||
var SLIDE_DUR = 0.2;
|
||||
|
||||
var W = [
|
||||
{text:"Every", start:0.0, end:0.3},
|
||||
{text:"great", start:0.3, end:0.55},
|
||||
{text:"video", start:0.55, end:0.85},
|
||||
{text:"starts", start:0.85, end:1.1},
|
||||
{text:"with", start:1.1, end:1.25},
|
||||
{text:"a", start:1.25, end:1.35},
|
||||
{text:"single", start:1.35, end:1.65},
|
||||
{text:"frame.", start:1.65, end:2.0},
|
||||
{text:"HyperFrames", start:2.1, end:2.65},
|
||||
{text:"lets", start:2.65, end:2.85},
|
||||
{text:"you", start:2.85, end:2.95},
|
||||
{text:"write", start:2.95, end:3.15},
|
||||
{text:"HTML", start:3.15, end:3.55},
|
||||
{text:"and", start:3.55, end:3.65},
|
||||
{text:"render", start:3.65, end:3.95},
|
||||
{text:"professional",start:3.95, end:4.45},
|
||||
{text:"video.", start:4.45, end:4.8},
|
||||
{text:"No", start:4.9, end:5.05},
|
||||
{text:"timeline.", start:5.05, end:5.45},
|
||||
{text:"No", start:5.5, end:5.65},
|
||||
{text:"drag", start:5.65, end:5.85},
|
||||
{text:"and", start:5.85, end:5.95},
|
||||
{text:"drop.", start:5.95, end:6.25},
|
||||
{text:"Just", start:6.35, end:6.55},
|
||||
{text:"code", start:6.55, end:6.8},
|
||||
{text:"that", start:6.8, end:6.95},
|
||||
{text:"becomes", start:6.95, end:7.3},
|
||||
{text:"cinema.", start:7.3, end:7.7}
|
||||
{ text: "Every", start: 0.0, end: 0.3 },
|
||||
{ text: "great", start: 0.3, end: 0.55 },
|
||||
{ text: "video", start: 0.55, end: 0.85 },
|
||||
{ text: "starts", start: 0.85, end: 1.1 },
|
||||
{ text: "with", start: 1.1, end: 1.25 },
|
||||
{ text: "a", start: 1.25, end: 1.35 },
|
||||
{ text: "single", start: 1.35, end: 1.65 },
|
||||
{ text: "frame.", start: 1.65, end: 2.0 },
|
||||
{ text: "HyperFrames", start: 2.1, end: 2.65 },
|
||||
{ text: "lets", start: 2.65, end: 2.85 },
|
||||
{ text: "you", start: 2.85, end: 2.95 },
|
||||
{ text: "write", start: 2.95, end: 3.15 },
|
||||
{ text: "HTML", start: 3.15, end: 3.55 },
|
||||
{ text: "and", start: 3.55, end: 3.65 },
|
||||
{ text: "render", start: 3.65, end: 3.95 },
|
||||
{ text: "professional", start: 3.95, end: 4.45 },
|
||||
{ text: "video.", start: 4.45, end: 4.8 },
|
||||
{ text: "No", start: 4.9, end: 5.05 },
|
||||
{ text: "timeline.", start: 5.05, end: 5.45 },
|
||||
{ text: "No", start: 5.5, end: 5.65 },
|
||||
{ text: "drag", start: 5.65, end: 5.85 },
|
||||
{ text: "and", start: 5.85, end: 5.95 },
|
||||
{ text: "drop.", start: 5.95, end: 6.25 },
|
||||
{ text: "Just", start: 6.35, end: 6.55 },
|
||||
{ text: "code", start: 6.55, end: 6.8 },
|
||||
{ text: "that", start: 6.8, end: 6.95 },
|
||||
{ text: "becomes", start: 6.95, end: 7.3 },
|
||||
{ text: "cinema.", start: 7.3, end: 7.7 },
|
||||
];
|
||||
|
||||
// behind=red 3D emphasis words, front=normal white words
|
||||
var BLOCKS = [
|
||||
{ behind: null, front: [[0],[1],[2]] },
|
||||
{ behind: [[3]], front: [[4],[5]] },
|
||||
{ behind: [[6]], front: [[7]] },
|
||||
{ behind: [[8]], front: [[9],[10],[11]] },
|
||||
{ behind: [[12]], front: [[13],[14]] },
|
||||
{ behind: [[15]], front: [[16]] },
|
||||
{ behind: null, front: [[17],[18]] },
|
||||
{ behind: null, front: [[19],[20],[21],[22]] },
|
||||
{ behind: [[24]], front: [[23],[25],[26]] },
|
||||
{ behind: [[27]], front: null },
|
||||
{ behind: null, front: [[0], [1], [2]] },
|
||||
{ behind: [[3]], front: [[4], [5]] },
|
||||
{ behind: [[6]], front: [[7]] },
|
||||
{ behind: [[8]], front: [[9], [10], [11]] },
|
||||
{ behind: [[12]], front: [[13], [14]] },
|
||||
{ behind: [[15]], front: [[16]] },
|
||||
{ behind: null, front: [[17], [18]] },
|
||||
{ behind: null, front: [[19], [20], [21], [22]] },
|
||||
{ behind: [[24]], front: [[23], [25], [26]] },
|
||||
{ behind: [[27]], front: null },
|
||||
];
|
||||
|
||||
var behindStage = document.getElementById("behind-stage");
|
||||
@@ -259,8 +266,12 @@
|
||||
frontStage.appendChild(fEl);
|
||||
});
|
||||
|
||||
var allBehind = BLOCKS.map(function (_, i) { return document.getElementById("bb" + i); });
|
||||
var allFront = BLOCKS.map(function (_, i) { return document.getElementById("fb" + i); });
|
||||
var allBehind = BLOCKS.map(function (_, i) {
|
||||
return document.getElementById("bb" + i);
|
||||
});
|
||||
var allFront = BLOCKS.map(function (_, i) {
|
||||
return document.getElementById("fb" + i);
|
||||
});
|
||||
|
||||
function applyBehindScales() {
|
||||
BLOCKS.forEach(function (block, bi) {
|
||||
@@ -293,8 +304,12 @@
|
||||
var bEl = allBehind[bi];
|
||||
var fEl = allFront[bi];
|
||||
|
||||
allBehind.forEach(function (other, oi) { if (oi !== bi) tl.set(other, { opacity: 0 }, start); });
|
||||
allFront.forEach(function (other, oi) { if (oi !== bi) tl.set(other, { opacity: 0 }, start); });
|
||||
allBehind.forEach(function (other, oi) {
|
||||
if (oi !== bi) tl.set(other, { opacity: 0 }, start);
|
||||
});
|
||||
allFront.forEach(function (other, oi) {
|
||||
if (oi !== bi) tl.set(other, { opacity: 0 }, start);
|
||||
});
|
||||
|
||||
if (block.behind) {
|
||||
tl.set(bEl, { opacity: 1 }, start);
|
||||
@@ -323,7 +338,9 @@
|
||||
tl.to({}, { duration: DURATION }, 0);
|
||||
window.__timelines["parallax-layers"] = tl;
|
||||
|
||||
document.fonts.ready.then(function () { applyBehindScales(); });
|
||||
document.fonts.ready.then(function () {
|
||||
applyBehindScales();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user