Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Site: the hero window rises in solid, and the ribbons wait for their own entrance

Eric Brownrout087b3a7b1fd9
diff --git a/site/public/marketing/hero-entry.mjs b/site/public/marketing/hero-entry.mjs
index ad258808..bd755462 100644
--- a/site/public/marketing/hero-entry.mjs
+++ b/site/public/marketing/hero-entry.mjs
@@ -11,8 +11,10 @@ function paintRibbons(){
geometry.forEach(({path,d,progress})=>path.setAttribute('d',ribbonPath(d,shape,progress)));
}
function layoutRibbons(){
- const windowBounds=product.getBoundingClientRect(),ribbonBounds=svg.getBoundingClientRect();
- shape=ribbonGeometry(ribbonBounds.width,windowBounds.width);
+ // Size the wings to the resting window even while Lift is scaling it.
+ const box=getComputedStyle(product),ribbonBounds=svg.getBoundingClientRect();
+ const width=parseFloat(box.width),height=parseFloat(box.height);
+ shape=ribbonGeometry(ribbonBounds.width,width);
svg.setAttribute('viewBox',`0 0 ${shape.width} ${shape.height}`);
mirrors.forEach(use=>use.setAttribute('transform',`translate(${shape.width} 0) scale(-1 1)`));
const gradient=svg.querySelector('#ribbon-purple');
@@ -23,22 +25,11 @@ function layoutRibbons(){
material.setAttribute('y2',Math.max(...ys)*shape.height/650);
});
// Start inside the opaque window, including when a resize changes the curve during entry.
- coveredLength=Math.max(0,Math.min(1,(windowBounds.width-4)/ribbonBounds.width,(windowBounds.height-4)/ribbonBounds.height));
+ coveredLength=Math.max(0,Math.min(1,(width-4)/ribbonBounds.width,(height-4)/ribbonBounds.height));
paintRibbons();
}
const resize=new ResizeObserver(layoutRibbons);
resize.observe(svg);resize.observe(product);layoutRibbons();
-let cover=null;
-function coverWindow(){
- if(!cover)return;
- const a=product.getBoundingClientRect(),b=svg.getBoundingClientRect();
- // A root SVG clip uses viewport pixels, not its stretched viewBox coordinates.
- // Keep the cutout inside the window border so antialiasing never exposes a page-colored seam.
- const x=a.left-b.left+1,y=a.top-b.top+1,r=a.right-b.left-1,d=a.bottom-b.top-1;
- const radius=Math.max(0,parseFloat(getComputedStyle(product).borderTopLeftRadius)-1),rx=radius,ry=radius;
- cover.setAttribute('d',`M-2 -2H${b.width+2}V${b.height+2}H-2Z M${x+rx} ${y}H${r-rx}Q${r} ${y} ${r} ${y+ry}V${d-ry}Q${r} ${d} ${r-rx} ${d}H${x+rx}Q${x} ${d} ${x} ${d-ry}V${y+ry}Q${x} ${y} ${x+rx} ${y}Z`);
-}
-function makeCover(){const ns='http://www.w3.org/2000/svg',clip=document.createElementNS(ns,'clipPath');clip.id='ribbon-window-cover';clip.setAttribute('clipPathUnits','userSpaceOnUse');cover=document.createElementNS(ns,'path');cover.setAttribute('clip-rule','evenodd');clip.append(cover);svg.querySelector('defs').append(clip);svg.setAttribute('clip-path','url(#ribbon-window-cover)');coverWindow();restore.push(()=>{svg.removeAttribute('clip-path');clip.remove();cover=null})}
function complete(){
if(completed) return;
completed=true;
@@ -51,7 +42,6 @@ function complete(){
}
if(reduceMotion.matches||state.heroStatic==='true') complete();
else{
- state.heroEntry='running';
const entryStart=document.timeline.currentTime;
const desktop=matchMedia('(min-width:761px)');
if(desktop.matches && product.dataset.live!=='true') {
@@ -63,17 +53,14 @@ else{
}
if(reduceMotion.matches) complete();
else {
- const windowDelay=Math.max(0,270-(document.timeline.currentTime-entryStart)),fadeDuration=300;
- // The window becomes opaque before it settles, hiding the wings' starting points.
- animations.push(product.animate([{opacity:0},{opacity:1}],
- {duration:fadeDuration,delay:windowDelay,easing:'cubic-bezier(.16,1,.3,1)',fill:'backwards'}));
- animations.push(product.animate([{transform:'translateY(20px)'},{transform:'translateY(0)'}],
- {duration:600,delay:windowDelay,easing:'cubic-bezier(.16,1,.3,1)',fill:'backwards'}));
+ const windowDelay=Math.max(0,270-(document.timeline.currentTime-entryStart)),liftDuration=240;
+ animations.push(product.animate([{transform:'translateY(16px) scale(.988)'},{transform:'none'}],
+ {duration:liftDuration,delay:windowDelay,easing:'cubic-bezier(.23,1,.32,1)',fill:'backwards'}));
+ state.heroEntry='running';
const background='ribbon';
if(background==='ribbon'){
const surface=svg.querySelector('#ribbon-surface');
- const ribbonStart=windowDelay,bandDuration=350,bandStagger=55;
- makeCover();
+ const ribbonStart=windowDelay+liftDuration,bandDuration=350,bandStagger=55;
const bands=[...svg.querySelectorAll('[data-ribbon-band]')].map((band,index)=>{
const paths=[...band.querySelectorAll('path')];
const seam=svg.querySelector(`#ribbon-seam-${index+1}`);
@@ -96,7 +83,7 @@ else{
});
paintRibbons();
// A seekable clock drives d attributes, not a transform or clipping wipe.
- // Entry starts with the app becoming opaque, after its renderer is ready.
+ // The first band grows when the solid window reaches its resting shape.
const clock=svg.animate([],{duration:ribbonStart+4*bandStagger+bandDuration,fill:'backwards'});
animations.push(clock);
function draw(){
@@ -108,13 +95,13 @@ else{
const length=coveredLength+(1-coveredLength)*(1-(1-progress)**3);
geometry.forEach(part=>part.progress=length);
});
- paintRibbons();coverWindow();
+ paintRibbons();
if(!completed) frame=requestAnimationFrame(draw);
}
frame=requestAnimationFrame(draw);
}
// Keep the app demo and idle motion on their existing schedule.
- animations.push(svg.animate([],{duration:windowDelay+fadeDuration+4*55+350}));
+ animations.push(svg.animate([],{duration:windowDelay+870}));
Promise.all(animations.map(animation=>animation.finished)).then(complete).catch(()=>{});
reduceMotion.addEventListener('change',event=>{
if(!event.matches) return;
diff --git a/site/public/marketing/site.css b/site/public/marketing/site.css
index f0f414df..78df3805 100644
--- a/site/public/marketing/site.css
+++ b/site/public/marketing/site.css
@@ -669,17 +669,17 @@ body[data-letter=plain] .plain-word{display:inline}
[id^=ribbon-entry-surface-] stop:last-child{stop-color:var(--ai-base)}
.signal-wings{visibility:hidden}
html[data-ribbon-paint=ready] .signal-wings{visibility:visible}
-html[data-hero-entry=pending] .product-window{visibility:hidden}
html:not([data-hero-entry=complete]) .signal-wings>use{visibility:hidden}
.product-stage{isolation:isolate}
.product-stage>.backdrop{z-index:0}
.product-stage>.product-window{position:relative;z-index:1;background:#fff}
-@media (prefers-reduced-motion:reduce){html .signal-wings,html[data-hero-entry=pending] .product-window{visibility:visible}}
+@media (prefers-reduced-motion:reduce){html .signal-wings{visibility:visible}}
.hero .headline-visual{white-space:nowrap}
.hero .headline-take,.hero .headline-word{display:inline-block}
.hero h1 .headline-take{color:inherit}
@media (scripting:enabled) and (prefers-reduced-motion:no-preference){
+ html[data-hero-entry=pending]:not([data-hero-static]) .product-window{transform:translateY(16px) scale(.988)}
html:not([data-hero-static]) .hero-copy :is(.yc-pill,.headline-take,.headline-word,p,.hero-actions>.button,.hero-actions>.mobile-download,.download-requirements):not(:focus-visible){
animation:hero-arrival 180ms var(--ease-enter) var(--entry-delay,0ms) backwards;
}
@@ -1103,7 +1103,6 @@ body[data-demo=transcript] .hero-listening-widget{top:-52px;right:22px;bottom:au
.hero-renderer{clip-path:inset(0 round 12px)}
@media(min-width:761px) and (prefers-reduced-motion:no-preference){
- .product-window.demo-window:not([data-live=true]){visibility:hidden}
.hero-still{display:none}
}
diff --git a/site/scripts/hero-entry.test.mjs b/site/scripts/hero-entry.test.mjs
index 503b8894..fb49e893 100644
--- a/site/scripts/hero-entry.test.mjs
+++ b/site/scripts/hero-entry.test.mjs
@@ -11,11 +11,12 @@ for(const width of [1280,1728,2560])for(const [search,reduced] of [['?static=1',
let viewport=width,onResize
const node=attributes=>({attributes,getAttribute(name){return this.attributes[name]},setAttribute(name,value){this.attributes[name]=value}})
const path=node({d:'M0 0 800 325 0 130Z'}),mirror=node({}),gradient=node({}),reflection=node({})
- const product={getBoundingClientRect:()=>({width:Math.min(viewport*.76,1200),height:Math.min(viewport*.76,1200)*.608})}
+ const product={}
const svg={...node({}),getBoundingClientRect:()=>({width:viewport,height:Math.min(viewport,1728)*.4256}),
querySelectorAll:selector=>selector==='defs path'?[path]:[mirror],querySelector:selector=>selector==='#ribbon-purple'?gradient:reflection}
const context=vm.createContext({
URLSearchParams,Event,location:{search},ribbonGeometry,ribbonPath,
+ getComputedStyle:()=>({width:Math.min(viewport*.76,1200)+'px',height:Math.min(viewport*.76,1200)*.608+'px'}),
matchMedia:()=>({matches:reduced,addEventListener(){}}),
document:{documentElement:{dataset},querySelector:selector=>selector==='.signal-wings'?svg:product},
window:{dispatchEvent:event=>events.push(event.type)},cancelAnimationFrame(){},
@@ -46,11 +47,11 @@ console.log('Static preview and reduced motion settle entry without starting rib
// Exercise the real entry clock and cleanup without a browser or native app.
for(const width of [390,1280,1728,2560]){
- const dataset={heroEntry:'pending'},animations=[],listeners=[],events=[],materials=[],created=[],windowListeners=new Map()
+ const dataset={heroEntry:'pending'},animations=[],listeners=[],events=[],materials=[],windowListeners=new Map()
let draw,onResize,viewport=width
const timeline={currentTime:1000}
const node=attributes=>({attributes,getAttribute(name){return this.attributes[name]},setAttribute(name,value){this.attributes[name]=value},
- removeAttribute(name){delete this.attributes[name]},append(...children){this.children=children},after(){},remove(){this.removed=true},cloneNode(){const copy=node({...this.attributes});materials.push(copy);return copy},
+ after(){},remove(){this.removed=true},cloneNode(){const copy=node({...this.attributes});materials.push(copy);return copy},
animate(frames,options){let finish;const animation={frames,currentTime:0,options,finished:new Promise(resolve=>finish=resolve),finish:()=>finish(),cancel(){}};animations.push(animation);return animation}})
const bands=Array.from({length:5},(_,i)=>{
const d=`M0 ${i*130} 800 325 0 ${(i+1)*130}Z`
@@ -62,61 +63,51 @@ for(const width of [390,1280,1728,2560]){
const appWidth=()=>viewport<=760?viewport-40:Math.min(viewport*.76,1200)
const appHeight=()=>viewport<=760?532:appWidth()*.608
const ribbonHeight=()=>viewport<=760?532:Math.min(viewport,1728)*.4256
- const product={...node({}),dataset:{live:width===1280?'false':'true'},getBoundingClientRect:()=>({left:(viewport-appWidth())/2,top:120,right:(viewport+appWidth())/2,bottom:120+appHeight(),width:appWidth(),height:appHeight()})}
- const defs=node({})
- const svg={...node({}),getBoundingClientRect:()=>({left:0,top:100,width:viewport,height:ribbonHeight()}),
+ const product={...node({}),dataset:{live:width===1280?'false':'true'}}
+ const svg={...node({}),getBoundingClientRect:()=>({width:viewport,height:ribbonHeight()}),
querySelectorAll:selector=>selector==='defs path'?paths:selector==='[data-ribbon-band]'?bands:[],
- querySelector:selector=>selector==='defs'?defs:selector.startsWith('#ribbon-seam-')?seams[Number(selector.at(-1))-1]:node({})}
+ querySelector:selector=>selector.startsWith('#ribbon-seam-')?seams[Number(selector.at(-1))-1]:node({})}
const reduced={matches:false,addEventListener:(_name,callback)=>listeners.push(callback)}
const execution=vm.runInNewContext(`(async()=>{${entry}})()`,{
URLSearchParams,Event,location:{search:''},ribbonGeometry,ribbonPath,
matchMedia:query=>query.includes('reduce')?reduced:{matches:width>760,addEventListener(){}},
- getComputedStyle:()=>({borderTopLeftRadius:'14px'}),
- document:{timeline,documentElement:{dataset},createElementNS(_ns,tag){const element=node({});element.tag=tag;created.push(element);return element},querySelector:selector=>selector==='.signal-wings'?svg:selector==='.product-window'?product:node({})},
+ getComputedStyle:()=>({width:appWidth()+'px',height:appHeight()+'px'}),
+ document:{timeline,documentElement:{dataset},querySelector:selector=>selector==='.signal-wings'?svg:selector==='.product-window'?product:node({})},
window:{dispatchEvent:event=>events.push(event.type),addEventListener:(name,callback)=>windowListeners.set(name,callback)},
ResizeObserver:class{constructor(callback){onResize=callback}observe(){}},
requestAnimationFrame:callback=>{draw=callback;return 1},cancelAnimationFrame(){draw=null},
})
if(width===1280){
+ assert.equal(dataset.heroEntry,'pending','keep the CSS starting pose until the renderer is ready')
assert.equal(draw,undefined,'no ribbon drawing before the renderer is ready')
assert.equal(animations.length,0,'the window and ribbons wait for the renderer')
timeline.currentTime+=120
windowListeners.get('hero-renderer-ready')()
}
await execution
- const clock=animations.at(-2),completionClock=animations.at(-1)
- const cover=created.find(element=>element.tag==='path')
- assert.equal(svg.attributes['clip-path'],'url(#ribbon-window-cover)')
- function checkCover(){
- const p=product.getBoundingClientRect()
- assert(cover.attributes.d.startsWith(`M-2 -2H${viewport+2}V${ribbonHeight()+2}`),'root clipping uses viewport pixels on phone and desktop')
- const xs=[],ys=[]
- for(const [,command,values] of ('M'+cover.attributes.d.split('Z M')[1]).matchAll(/([MHVQ])([^MHVQZ]+)/g)){
- const n=values.match(/-?\d*\.?\d+/g).map(Number)
- if(command==='H')xs.push(n[0])
- else if(command==='V')ys.push(n[0])
- else for(let i=0;i<n.length;i+=2){xs.push(n[i]);ys.push(n[i+1])}
- }
- assert.equal(Math.min(...xs),p.left+1,'cutout stays inside the left border')
- assert.equal(Math.max(...xs),p.right-1,'cutout stays inside the right border')
- assert.equal(Math.min(...ys),p.top-100+1,'cutout stays inside the top border')
- assert.equal(Math.max(...ys),p.bottom-100-1,'cutout stays inside the bottom border')
- assert.equal((cover.attributes.d.match(/Q/g)||[]).length,4,'all corners follow the window')
+ assert.equal(animations.length,3,'one window movement, one ribbon clock and one handoff')
+ const [movement,clock,completionClock]=animations
+ const delay=width===1280?150:270,ribbonStart=delay+240
+ assert.deepEqual(Array.from(movement.frames,frame=>({...frame})),[{transform:'translateY(16px) scale(.988)'},{transform:'none'}])
+ assert.equal(movement.options.duration,240)
+ assert.equal(movement.options.easing,'cubic-bezier(.23,1,.32,1)')
+ assert.equal(movement.options.fill,'backwards')
+ assert.equal(movement.options.delay,delay,'renderer load counts toward the window delay')
+ assert.equal(dataset.heroEntry,'running')
+ assert.equal(clock.options.duration,ribbonStart+4*55+350,'ribbons keep their duration and stagger')
+ assert.equal(completionClock.options.duration,delay+870,'the app demo starts on its existing schedule')
+ function expectedPath(progress){
+ const covered=Math.max(0,Math.min(1,(appWidth()-4)/viewport,(appHeight()-4)/ribbonHeight()))
+ return ribbonPath(originals[0],ribbonGeometry(viewport,appWidth()),covered+(1-covered)*(1-(1-progress)**3))
}
- checkCover()
- const fade=animations.find(animation=>animation.frames[0]?.opacity===0&&!('transform' in animation.frames[0]))
- const movement=animations.find(animation=>animation.frames[0]?.transform==='translateY(20px)')
- assert.equal(fade.options.duration,300)
- assert.equal(movement.options.duration,600,'the window keeps its original settling motion')
- const delay=width===1280?150:270
- assert.equal(fade.options.delay,delay,'renderer load counts toward the window delay')
- assert.equal(clock.options.duration,delay+4*55+350,'ribbons keep their duration and stagger')
- assert.equal(completionClock.options.duration,delay+300+4*55+350,'the app demo starts on its existing schedule')
- clock.currentTime=fade.options.delay-1;draw();assert.equal(dataset.ribbonPaint,'waiting')
- clock.currentTime=fade.options.delay;draw();assert.equal(dataset.ribbonPaint,'ready')
- clock.currentTime=400;draw()
- assert.notEqual(paths[0].attributes.d,ribbonPath(originals[0],ribbonGeometry(viewport,appWidth())))
- viewport=width===2560?1280:2560;onResize();draw();checkCover()
+ clock.currentTime=ribbonStart-1;draw();assert.equal(dataset.ribbonPaint,'waiting')
+ assert.equal(paths[0].attributes.d,expectedPath(0))
+ clock.currentTime=ribbonStart;draw();assert.equal(dataset.ribbonPaint,'ready')
+ assert.equal(paths[0].attributes.d,expectedPath(0),'no exposed stub at the cue')
+ clock.currentTime=ribbonStart+100;draw()
+ assert.equal(paths[0].attributes.d,expectedPath(100/350))
+ viewport=width===2560?1280:2560;onResize();draw()
+ assert.equal(paths[0].attributes.d,expectedPath(100/350),'resize preserves band progress')
if(width===2560){
reduced.matches=true;listeners.forEach(callback=>callback({matches:true}))
}else{
@@ -126,8 +117,6 @@ for(const width of [390,1280,1728,2560]){
assert.equal(dataset.heroEntry,'complete')
assert.deepEqual(events,['hero-entry-complete'])
paths.forEach((path,i)=>assert.equal(path.attributes.d,ribbonPath(originals[i],ribbonGeometry(viewport,appWidth()))))
- assert.equal(svg.attributes['clip-path'],undefined,'temporary clip is removed')
- assert(created.find(element=>element.tag==='clipPath').removed,'clip definition is removed')
assert(materials.every(material=>material.removed),'temporary entry gradients are removed')
bands.forEach(band=>assert.equal(band.paths[1].attributes.fill,'url(#ribbon-surface)'))
}