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 star chart draws in with the count and climbs to the top right of its card

Eric Brownrout3abb8dd87461
diff --git a/site/content/home.html b/site/content/home.html
index dde36b23..2a364d03 100644
--- a/site/content/home.html
+++ b/site/content/home.html
@@ -910,7 +910,15 @@
href="https://github.com/FrigadeHQ/yogurt/stargazers"
target="_blank" rel="noopener noreferrer"><span class="oss-stat"
><span class="oss-figure"><span class="stat-value">{{stars}}</span></span
- ><span class="oss-caption">GitHub stars </span></span
+ ><span class="oss-caption">GitHub stars <span aria-hidden="true" class="card-arrow"
+ ><svg aria-hidden="true" class="oss-arrow" fill="none" viewBox="0 0 16 16">
+ <path
+ d="M4 12 12 4M5 4h7v7"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="1.4"
+ ></path></svg></span></span></span
>
<div class="star-plot">
<svg
@@ -923,24 +931,19 @@
<title id="chart-title">GitHub star history</title>
<desc id="chart-desc">{{historyLabel}}</desc>
<defs>
+ <clipPath id="history-trace"><rect class="chart-clip" x="0" y="-2" width="510" height="94"></rect></clipPath>
<linearGradient id="history-wash" x1="0" x2="0" y1="0" y2="1">
<stop stop-color="currentColor" stop-opacity=".16"></stop>
<stop offset="1" stop-color="currentColor" stop-opacity=".025"></stop>
</linearGradient>
</defs>
- <path d="{{area}}" fill="url(#history-wash)"></path>
- <path class="chart-line" d="{{line}}"></path>
+ <g clip-path="url(#history-trace)">
+ <path class="chart-fill" d="{{area}}" fill="url(#history-wash)"></path>
+ <polyline class="chart-line" points="{{vertices}}"></polyline>
+ </g>
</svg>
</div>
- <span aria-hidden="true" class="card-arrow"
- ><svg aria-hidden="true" class="oss-arrow" fill="none" viewBox="0 0 16 16">
- <path
- d="M4 12 12 4M5 4h7v7"
- stroke="currentColor"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="1.4"
- ></path></svg></span></a
+ </a
><a class="oss-card oss-calendar" href="https://github.com/FrigadeHQ/yogurt/releases"
target="_blank" rel="noopener noreferrer"><span class="oss-stat"
><span class="oss-figure">{{releases}}</span><span class="oss-caption">published releases</span></span
diff --git a/site/public/marketing/activity.mjs b/site/public/marketing/activity.mjs
index 13206880..d114302f 100644
--- a/site/public/marketing/activity.mjs
+++ b/site/public/marketing/activity.mjs
@@ -2,10 +2,12 @@ import { refreshSummary, hour, navStars } from './stars-data.mjs'
const section = document.querySelector('#progress'),
number = section.querySelector('.stat-value'),
+ clip = section.querySelector('.chart-clip'),
+ chart = section.querySelector('.star-chart'),
+ points = Array.from(section.querySelector('.chart-line').points),
reduce = matchMedia('(prefers-reduced-motion: reduce)')
let total = Number(number.textContent.replaceAll(',', ''))
-const ease = getComputedStyle(document.documentElement).getPropertyValue('--ease-enter').trim(),
- format = new Intl.NumberFormat('en')
+const format = new Intl.NumberFormat('en')
number.setAttribute('aria-hidden', 'true')
number.parentElement.setAttribute('aria-label', `${format.format(total)} GitHub stars`)
const tailGaps = [3000, 8000, 15000, 24000, 35000, 48000]
@@ -21,6 +23,27 @@ let started = false,
tailTimer = 0,
tailRemaining = tailGaps[0],
tailMark = 0
+// Interpolate the same straight segment that is visible at the clipping edge.
+function heightAt(progress) {
+ if (progress === 0 || progress === 1 || points.length < 2) return progress
+ const { width, height } = chart.viewBox.baseVal
+ const x = width * progress
+ let left = 0, right = points.length - 1
+ while (right - left > 1) {
+ const middle = (left + right) >>> 1
+ if (points[middle].x <= x) left = middle
+ else right = middle
+ }
+ const a = points[left], b = points[right]
+ const t = b.x === a.x ? 1 : (x - a.x) / (b.x - a.x)
+ const y = a.y + (b.y - a.y) * t
+ const lastHeight = height - points.at(-1).y
+ return lastHeight > 0 ? Math.min(1, (height - y) / lastHeight) : progress
+}
+function paint(progress) {
+ clip.style.transform = 'scaleX(' + progress + ')'
+ updateCount(heightAt(progress))
+}
function updateCount(progress) {
number.textContent = format.format(Math.round((finished ? total : base) * progress))
}
@@ -55,9 +78,9 @@ function scheduleTail() {
}, tailRemaining)
}
function finishCountUp() {
+ paint(1)
clock?.cancel()
clock = null
- updateCount(1)
if (!tailSize) {
rest()
return
@@ -78,7 +101,7 @@ function tick() {
return
}
const progress = clock.effect.getComputedTiming().progress ?? 0
- updateCount(progress)
+ paint(progress)
if (clock.playState === 'finished' || progress >= 1) {
raf = 0
finishCountUp()
@@ -92,7 +115,7 @@ function sync() {
clock?.cancel()
clock = null
finished = true
- updateCount(1)
+ paint(1)
section.dataset.stars = 'still'
return
}
@@ -107,40 +130,22 @@ function sync() {
return
}
if (!clock) {
- const time = document.createElement('i')
- clock = time.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 1920, easing: ease, fill: 'forwards' })
- updateCount(0)
+ // A timing-only effect lets one frame update both the clip and the count.
+ clock = new Animation(new KeyframeEffect(null, [], {
+ duration: 1800, easing: 'cubic-bezier(.30,.60,.40,1)', fill: 'both',
+ }), document.timeline)
+ clock.play()
+ paint(0)
} else clock.play()
section.dataset.stars = 'playing'
if (!raf) raf = requestAnimationFrame(tick)
}
-updateCount(reduce.matches ? 1 : 0)
-const block = section.querySelector('.growth-block')
-let gateFrame = 0
-function gate() {
- gateFrame = 0
- const r = block.getBoundingClientRect(),
- seen = Math.max(0, Math.min(innerHeight, r.bottom) - Math.max(0, r.top))
- if (!started && seen >= Math.min(r.height, innerHeight) * 0.25) {
- started = true
- section.dataset.starGate = 'entered'
- window.removeEventListener('scroll', onScroll)
- sync()
- }
-}
-function onScroll() {
- if (!gateFrame) gateFrame = requestAnimationFrame(gate)
-}
-window.addEventListener('scroll', onScroll, { passive: true })
-window.addEventListener('resize', onScroll)
-new IntersectionObserver(
- ([entry]) => {
- visible = entry.isIntersecting && entry.intersectionRatio >= 0.2
- gate()
- sync()
- },
- { threshold: [0, 0.2, 0.25, 1] }
-).observe(block)
+paint(reduce.matches ? 1 : 0)
+new IntersectionObserver(([entry]) => {
+ visible = entry.isIntersecting && entry.intersectionRatio > 0
+ if (entry.intersectionRatio >= .55) started = true
+ sync()
+}, {threshold: [0, .55]}).observe(section.querySelector('.oss-history'))
document.addEventListener('visibilitychange', sync)
reduce.addEventListener('change', sync)
diff --git a/site/public/marketing/site.css b/site/public/marketing/site.css
index 753ad700..706a0b5b 100644
--- a/site/public/marketing/site.css
+++ b/site/public/marketing/site.css
@@ -2096,6 +2096,12 @@ body[data-background=ribbon] .hero-copy{padding-bottom:70px}
grid-row: span 2;
min-height: 165px;
}
+.activity-board .oss-history .card-arrow {
+ position: static;
+ display: inline-flex;
+ vertical-align: middle;
+ margin-inline-start: 3px;
+}
.activity-board .oss-calendar {
min-height: 0;
display: grid;
@@ -2149,8 +2155,7 @@ body[data-background=ribbon] .hero-copy{padding-bottom:70px}
}
.activity-board .star-plot {
position: absolute;
- inset: auto 0 0;
- height: 62%;
+ inset: 29% 0 0 13.5%;
pointer-events: none;
z-index: -1;
}
@@ -2163,6 +2168,11 @@ body[data-background=ribbon] .hero-copy{padding-bottom:70px}
overflow: visible;
pointer-events: none;
}
+.chart-clip {transform-origin: 0 0}
+@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
+ .chart-clip {transform:scaleX(0)}
+ #progress:not([data-stars]) .stat-value {visibility: hidden}
+}
@media (min-width: 761px) and (max-width: 965px) {
.activity-board .oss-latest {
flex-wrap: wrap;
diff --git a/site/scripts/activity.mjs b/site/scripts/activity.mjs
index c6637b98..9dbeddac 100644
--- a/site/scripts/activity.mjs
+++ b/site/scripts/activity.mjs
@@ -105,15 +105,17 @@ export async function getActivity(saved, request, now = new Date()) {
export function renderActivity(html, data) {
const format = new Intl.NumberFormat('en-US')
const { count, week, latest, history } = data
- const start = history[0][0],
- span = history.at(-1)[0] - start,
- maximum = history.at(-1)[1],
- peakY = 4
- const line = (span ? 'M0 90' : 'M510 90') + history.map(([t, n]) => {
- const x = span ? 510 * (t - start) / span : 510
- const y = 90 - (90 - peakY) * n / maximum
- return 'L' + x.toFixed(2) + ' ' + y.toFixed(2)
- }).join('')
+ // The total may have refreshed even when dated history was unavailable.
+ const last = history.at(-1)
+ const observedAt = Date.parse(data.capturedAt)
+ const points = count !== last[1] && observedAt > last[0] ? [...history, [observedAt, count]] : history
+ const start = points[0][0], span = points.at(-1)[0] - start
+ const maximum = Math.max(count, last[1])
+ const vertices = points.map(([time, stars]) => {
+ const x = span ? 510 * (time - start) / span : 510
+ const y = 90 - 90 * stars / maximum
+ return x.toFixed(2) + ',' + y.toFixed(2)
+ })
const first = Date.parse(data.capturedAt.slice(0, 10)) - 6 * day
const bars = week
.map((n, i) => {
@@ -127,8 +129,8 @@ export function renderActivity(html, data) {
capturedAt: data.capturedAt,
stars: format.format(count),
navStars: navStars(count),
- line,
- area: line + 'L510 90Z',
+ vertices: vertices.join(' '),
+ area: 'M' + vertices.join('L') + (span ? 'L510 90L0 90Z' : 'L510 90Z'),
releases: format.format(data.releases),
bars,
weekTotal: week.reduce((a, b) => a + b, 0),
@@ -140,7 +142,7 @@ export function renderActivity(html, data) {
year: 'numeric',
timeZone: 'UTC',
}),
- historyLabel: `${format.format(maximum)} dated stars through ${new Date(history.at(-1)[0])
+ historyLabel: `${format.format(last[1])} dated stars through ${new Date(history.at(-1)[0])
.toISOString()
.slice(0, 10)}`,
}
diff --git a/site/scripts/stars.test.mjs b/site/scripts/stars.test.mjs
index 31b6b5ba..28a56cde 100644
--- a/site/scripts/stars.test.mjs
+++ b/site/scripts/stars.test.mjs
@@ -70,16 +70,17 @@ assert(html.includes('releases/tag/v1.2'))
assert.equal((html.match(/class="week-day"/g) || []).length, 7)
assert(html.includes('aria-label="2 releases in seven days"'))
assert(!html.includes('in 7 days'))
-function assertStaticChart(html) {
- const chart = html.match(/<div class="star-plot">([\s\S]*?)<\/div>/)[1]
- assert.doesNotMatch(chart, /clip-path|clipPath|<animate/)
- const line = chart.match(/class="chart-line" d="([^"]+)"/)[1]
- assert.ok(chart.includes('d="' + line + 'L510 90Z" fill='))
- assert.match(line, /L510\.00 [\d.]+$/)
- assert.doesNotMatch(chart, /<circle|point-overlay/)
+function chartVertices(page) {
+ return page.match(/<polyline class="chart-line" points="([^"]+)"/)[1]
}
-assertStaticChart(html)
-assertStaticChart(renderActivity(load('../content/home.html'), { ...fresh, history: fresh.history.slice(0, 1) }))
+assert.match(html, /<g clip-path="url\(#history-trace\)">\s*<path class="chart-fill"[^>]*><\/path>\s*<polyline class="chart-line"[^>]*><\/polyline>\s*<\/g>/)
+assert.doesNotMatch(html, /class="chart-dot"|point-overlay/)
+assert.equal(chartVertices(html), '0.00,45.00 510.00,0.00')
+assert.ok(html.includes('d="M' + chartVertices(html).replaceAll(' ', 'L') + 'L510 90L0 90Z"'))
+const single = {...fresh, count: 1, history: fresh.history.slice(0, 1)}
+assert.equal(chartVertices(renderActivity(load('../content/home.html'), single)), '510.00,0.00')
+const fewer = {...fresh, count: 1}
+assert.match(chartVertices(renderActivity(load('../content/home.html'), fewer)), /510\.00,45\.00$/)
assert(!load('../public/marketing/activity.mjs').includes('api.github.com'))
console.log('Published releases, UTC days, paginated dated stars, deduplication and outage fallbacks passed.')
@@ -96,6 +97,8 @@ function chartPage(reduced = false) {
const number = { ...element(), textContent: '134', parentElement: element() },
age = { ...element(), dateTime: '2026-11-01T00:00:00Z' }
const object = { '.release-version strong': {textContent:'v1.2'}, '.oss-calendar .oss-figure': {textContent:'3'}, '.stat-value': number, '[data-latest-age]': age }
+ object['.chart-line'] = { points: [{ x: 0, y: 90 }, { x: 255, y: 22.5 }, { x: 510, y: 0 }] }
+ object['.star-chart'] = { viewBox: { baseVal: { width: 510, height: 90 } } }
const query = (s) => (object[s] ??= Object.assign(element(), { querySelector: query, animate: animation }))
let frame,
timer,
@@ -103,7 +106,9 @@ function chartPage(reduced = false) {
visibility,
passed = 0,
current = 0
- function animation() {
+ let timing
+ function animation(frames, options) {
+ timing = { frames, options }
return {
pause() {},
play() {},
@@ -122,6 +127,12 @@ function chartPage(reduced = false) {
},
}
runInNewContext(motionScript, {
+ KeyframeEffect: class {
+ constructor(target, frames, options) { Object.assign(this, {target, frames, options}) }
+ },
+ Animation: class {
+ constructor(effect) { return animation(effect.frames, effect.options) }
+ },
document: doc,
window: { addEventListener() {}, removeEventListener() {} },
innerHeight: 800,
@@ -154,7 +165,11 @@ function chartPage(reduced = false) {
})
return {
number,
- enter: () => observe([{ isIntersecting: true, intersectionRatio: 1 }]),
+ enter: (ratio = 1) => observe([{ isIntersecting: true, intersectionRatio: ratio }]),
+ clip: () => query('.chart-clip').style.transform,
+ fill: () => query('.chart-fill').style.transform,
+ timing: () => timing,
+ at: p => { current = p; frame?.() },
leave: () => observe([{ isIntersecting: false, intersectionRatio: 0 }]),
finishCountUp: () => {
current = 1
@@ -168,8 +183,23 @@ function chartPage(reduced = false) {
}
}
const chart = chartPage()
-chart.enter()
+assert.equal(chart.clip(), 'scaleX(0)')
+assert.equal(chart.number.textContent, '0')
+chart.enter(.2)
+assert.equal(chart.timing(), undefined)
+chart.enter(.55)
+assert.equal(chart.timing().options.duration, 1800)
+chart.at(.25)
+assert.equal(chart.clip(), 'scaleX(0.25)')
+assert.equal(chart.number.textContent, '48') // Halfway up the first segment.
+chart.at(.5)
+assert.equal(chart.clip(), 'scaleX(0.5)')
+assert.equal(chart.number.textContent, '96') // At the measured midpoint, the count is 75% of the total.
+chart.at(.75)
+assert.equal(chart.number.textContent, '112')
+assert.equal(chart.fill(), undefined)
chart.finishCountUp()
+assert.equal(chart.clip(), 'scaleX(1)')
assert.equal(chart.number.textContent, '128')
assert.equal(chart.timer().ms, 3000)
chart.advance(1500)
@@ -189,7 +219,9 @@ const still = chartPage(true)
still.enter()
assert.equal(still.number.textContent, '134')
assert(!still.timer())
-console.log('Static chart, staged count, growing intervals, offscreen pause and reduced-motion total passed.')
+assert.equal(still.clip(), 'scaleX(1)')
+assert.equal(still.timing(), undefined)
+console.log('Shared chart and count timing, linear axes, growing intervals, offscreen pause and reduced-motion total passed.')
const template=load('../content/home.html')
const featureSection=template.match(/<section aria-labelledby="features-title"[\s\S]*?<\/section>/)[0]