fsck logo in works, now for a bit of sparkle

This commit is contained in:
kleines Filmröllchen 2025-04-15 22:59:00 +02:00
parent a87c2fe1ca
commit a47785d6d9
Signed by: filmroellchen
SSH key fingerprint: SHA256:NarU6J/XgCfEae4rbei0YIdN2pYaYDccarK6R53dnc8
3 changed files with 187 additions and 56 deletions

View file

@ -15,34 +15,83 @@ def introFrames(args):
("title", "style", "opacity", 0),
("persons", "style", "opacity", 0),
("glogo", "style", "opacity", 0),
("sparkle", "style", "opacity", 0),
)
# fade in logo
# frames = 1 * fps
# for i in range(0, frames):
# # source: matrix(0.66093871,0,0,0.66093871,325.49887,111.96043)
# # target: matrix(1, 0, 0, 1, 0, 0)
# size = 0.66 + easeInOutSine(i, 0.0, 1.0 - 0.66, frames)
# posx = easeInOutSine(frames - i, 0.0, 325.49887, frames)
# posy = easeInOutSine(frames - i, 0.0, 111.96043, frames)
# yield (
# (
# "glogo",
# "attr",
# "transform",
# # the easing function cant handle easing from larger to smaller, so use this hacky workaround
# f"translate(0,{easeInQuad(frames - i, 0.0, 200.0, frames)})",
# ),
# ("glogo", "style", "opacity", easeOutSine(i, 0, 1, frames)),
# # scale in the fsck text banner behind the foreground elements
# # target size is 5.414656 in both x and y
# (
# "fsck-banner",
# "attr",
# "transform",
# f"matrix({size:.4f},0,0,{size:.4f},{posx:.4f},{posy:.4f})",
# ),
# ("title", "style", "opacity", 0),
# ("persons", "style", "opacity", 0),
# ("sparkle", "style", "opacity", 0),
# )
frames = 1 * fps
for i in range(0, frames):
yield (
("glogo", "style", "opacity", 1),
("title", "style", "opacity", 0),
("persons", "style", "opacity", 0),
("sparkle", "style", "opacity", 0),
)
# fade in title and persons
frames = 1 * fps
for i in range(0, frames):
# source: matrix(3.4166273,0,0,3.4166273,-1716.8745,-2685.1066)
# target: matrix(5.414656,0,0,5.414656,-3282.299,-4448.4489)
size = 3 + easeOutSine(i, 0, 5.414656-3, frames)
posx = easeOutSine(i, -1716.8745, -3282.299, frames)
posy = easeOutSine(i, -2685.1066, -4448.4489, frames)
frames = 2 * fps
intermediate = (frames * 1) // 3
for i in range(0, intermediate):
yield (
("title", "style", "opacity", easeOutSine(i, 0, 1, frames)),
("persons", "style", "opacity", easeOutSine(i, 0, 1, frames)),
("persons", "style", "opacity", 0),
("glogo", "style", "opacity", 1),
(
"glogo",
"attr",
"transform",
# the easing function cant handle easing from larger to smaller, so use this hacky workaround
f"translate(0,{easeInQuad(frames - i, 0.0, 200.0, frames)})",
"sparkle",
"style",
"opacity",
easeOutSine(min(i * 2, intermediate), 0, 1, intermediate),
),
("glogo", "style", "opacity", easeOutSine(i, 0, 1, frames)),
# scale in the fsck text banner behind the foreground elements
# target size is 5.414656 in both x and y
)
for i in range(intermediate, frames):
yield (
("title", "style", "opacity", easeOutSine(i, 0, 1, frames)),
(
"fsck-banner",
"attr",
"transform",
f"matrix({size},0,0,{size},{posx},{posy})",
"persons",
"style",
"opacity",
easeOutSine(i - intermediate, 0, 1, frames - intermediate),
),
("glogo", "style", "opacity", 1),
(
"sparkle",
"style",
"opacity",
easeInSine(
i-intermediate,
1,
-1,
frames - intermediate,
),
),
)
@ -53,6 +102,7 @@ def introFrames(args):
("title", "style", "opacity", 1),
("persons", "style", "opacity", 1),
("glogo", "style", "opacity", 1),
("sparkle", "style", "opacity", 0),
)
# fade out image and text
@ -62,6 +112,7 @@ def introFrames(args):
("title", "style", "opacity", easeOutQuad(i, 1, -1, frames)),
("persons", "style", "opacity", easeOutQuad(i, 1, -1, frames)),
("glogo", "style", "opacity", easeOutQuad(i, 1, -1, frames)),
("sparkle", "style", "opacity", 0),
)