Implement approved TV loading and bounded motion

This commit is contained in:
justinzeus 2026-11-07 00:57:13 +01:00
parent f4fb6e22c9
commit d525f1aed3
86 changed files with 2026 additions and 116 deletions

View file

@ -32,6 +32,7 @@ def render_tokens(tokens: dict) -> tuple[str, str]:
"// Generated by generate_tokens.py; edit the JSON sources instead.",
"package org.justinvisser.wolfskin.design",
"",
"import androidx.compose.animation.core.CubicBezierEasing",
"import androidx.compose.ui.graphics.Color as ComposeColor",
"import androidx.compose.ui.text.TextStyle",
"import androidx.compose.ui.text.font.FontWeight",
@ -71,6 +72,10 @@ def render_tokens(tokens: dict) -> tuple[str, str]:
elif kind == "duration":
lines.append(f" const val {name} = {int(value.removesuffix('ms'))}")
css.append(f" --{group_name}-{name}: {value};")
elif kind == "cubicBezier":
points = ", ".join(f"{number(point)}f" for point in value)
lines.append(f" val {name} = CubicBezierEasing({points})")
css.append(f" --{group_name}-{name}: cubic-bezier({', '.join(map(str, value))});")
elif kind == "transition" and value.get("type") == "spring":
lines.append(f" const val {name}DampingRatio = {number(value['dampingRatio'])}f")
lines.append(f" const val {name}Stiffness = {number(value['stiffness'])}f")