- Switches slide in 160 ms on Orbit's curve (designed in EffectCraft, design/motion/switch); Reduce motion: no slide, 120 ms fade. The setting changes on the press; the animation never holds it up. - Family, Rooms (TV and phone) and Account get their own icons (design/interface/build-settings-icons.py) - Orbit Simple and Retro Cable prototypes for approval (design/layouts), not in the app Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
2.6 KiB
React
42 lines
2.6 KiB
React
// Orbit's settings switch (0.129 stage 3, Paul, 10 November 2026): the thumb slides and the track turns from blue to mint
|
|
// in 160 ms on Orbit's one curve, cubic-bezier(.2, 0, 0, 1). The setting itself changes on the press; this is only the look.
|
|
// Drawn at 6x the TV size (64 x 34 dp). Off -> On at 0.20 s, On -> Off at 0.80 s. Reduce motion: a 120 ms colour fade, no slide.
|
|
function bez(t) { // cubic-bezier(.2,0,0,1): solve x(u)=t, return y(u)
|
|
var x1=.2,y1=0,x2=0,y2=1, lo=0, hi=1, u=t;
|
|
for (var i=0;i<40;i++){ u=(lo+hi)/2; var x=3*(1-u)*(1-u)*u*x1+3*(1-u)*u*u*x2+u*u*u; if (x<t) lo=u; else hi=u; }
|
|
return 3*(1-u)*(1-u)*u*y1+3*(1-u)*u*u*y2+u*u*u;
|
|
}
|
|
function mix(a,b,k){ return [a[0]+(b[0]-a[0])*k, a[1]+(b[1]-a[1])*k, a[2]+(b[2]-a[2])*k, 1]; }
|
|
var FPS=50, DUR=1.2, MS=0.16;
|
|
var BLUE=[0x28/255,0x3c/255,0x64/255], MINT=[0x6e/255,0xdc/255,0xaa/255];
|
|
function build(name, calm) {
|
|
var c=app.project.items.addComp(name, 640, 340, 1, DUR, FPS);
|
|
var bg=c.layers.addSolid([0x0a/255,0x1a/255,0x3a/255], "Navy", 640, 340, 1);
|
|
var track=c.layers.addShape(); track.name="Track";
|
|
var g=track.property("Contents").addProperty("ADBE Vector Group");
|
|
var r=g.property("Contents").addProperty("ADBE Vector Shape - Rect");
|
|
r.property("Size").setValue([348,168]); r.property("Roundness").setValue(84);
|
|
var f=g.property("Contents").addProperty("ADBE Vector Graphic - Fill");
|
|
track.property("Transform").property("Position").setValue([320,170]);
|
|
var thumb=c.layers.addShape(); thumb.name="Thumb";
|
|
var g2=thumb.property("Contents").addProperty("ADBE Vector Group");
|
|
var e=g2.property("Contents").addProperty("ADBE Vector Shape - Ellipse"); e.property("Size").setValue([120,120]);
|
|
g2.property("Contents").addProperty("ADBE Vector Graphic - Fill").property("Color").setValue([1,1,1,1]);
|
|
var pos=thumb.property("Transform").property("Position");
|
|
var left=320-174+24+60, right=320+174-24-60;
|
|
var steps=Math.round(MS*FPS);
|
|
function move(t0, from, to, cFrom, cTo) {
|
|
var ms = calm ? 0.12 : MS, n = Math.max(1, Math.round(ms*FPS));
|
|
for (var i=0;i<=n;i++){ var t=t0+i/FPS, k=calm? i/n : bez(i/n);
|
|
pos.setValueAtTime(t, [calm ? (k<1? from : to) : from+(to-from)*k, 170]);
|
|
f.property("Color").setValueAtTime(t, mix(cFrom, cTo, k)); }
|
|
}
|
|
pos.setValueAtTime(0,[left,170]); f.property("Color").setValueAtTime(0, mix(BLUE,BLUE,0));
|
|
move(0.20, left, right, BLUE, MINT);
|
|
move(0.80, right, left, MINT, BLUE);
|
|
return c;
|
|
}
|
|
build("Switch", false); build("Switch reduce motion", true);
|
|
app.project.save(new File("/home/pauljd/Documents/OrbitTV/orbit-tv-release/design/motion/switch/orbit-switch.ecproj"));
|
|
writeLn("saved");
|