Skip to content

The swiss army knife of lossless video/audio editing

Merge master, and use the hero video on static.mifi.no

Claude10941f9c0bdb
diff --cc AGENTS.md
index 0784ca8c,4a3ecf88..62e16e0a
--- a/AGENTS.md
+++ b/AGENTS.md
@@@ -29,11 -23,3 +29,11 @@@ Only the bundled FFmpeg version (`scrip
When helping with a release, follow [RELEASING.md](./RELEASING.md), including the sections written for agents (store release notes, release announcement).
Never submit to a store, publish a release or post an announcement without the user's approval of the exact text first.
+
+## Feature post
+
+When a visual or especially interesting feature lands in master, suggest a short post about just that feature. Use the channels, character limits, hashtags and posting steps of the [release announcement](./RELEASING.md#release-announcement), but start with the feature instead of a version number, and attach the user's screenshot or clip instead of a release image:
+
+- Ask the user to make a screenshot or a short silent screen recording (about 10 seconds) that shows it.
+- Say that people can try it now in the latest nightly build (https://mifi.no/llc/nightly/), and that it will be in the next release.
- - Such a clip can also become the homepage's hero video (`website/src/assets/home/hero.mp4`, 1024×640, with a still of its first frame as `hero-poster.jpg`), shown instead of the screenshot.
++- Such a clip can also become the homepage's hero video (1024×640, silent, with a still of its first frame as the poster): upload it to static.mifi.no and update `heroVideo` in `website/src/images.ts`.
diff --cc website/README.md
index edda06c1,92a05bc8..83d07589
--- a/website/README.md
+++ b/website/README.md
@@@ -27,7 -27,7 +27,7 @@@ App versions from before that link to `
## Homepage
- `src/pages/index.astro` (the `<head>`) and `src/components/Home.tsx` (the content), styled by `src/styles/home.css`, with its images in `src/assets/home/` (plus the store badges and the app icon from the repo). The content is a React component, rendered to static HTML at build time (no client-side JavaScript, except a small script in `index.astro` that animates the feature icons on touch screens), so it can move to another React framework if needed. It doesn't use Starlight's components, since those bring Starlight's global CSS along (see `src/components/socialIcons.ts`).
-`src/pages/index.astro` (the `<head>`) and `src/components/Home.tsx` (the content), styled by `src/styles/home.css`, with its images on static.mifi.no (URLs in `src/images.ts`), plus the store badges and the app icon from the repo. The content is a React component, rendered to static HTML at build time (no client-side JavaScript), so it can move to another React framework if needed. It doesn't use Starlight's components, since those bring Starlight's global CSS along (see `src/components/socialIcons.ts`).
++`src/pages/index.astro` (the `<head>`) and `src/components/Home.tsx` (the content), styled by `src/styles/home.css`, with its images and the hero video on static.mifi.no (URLs in `src/images.ts`), plus the store badges and the app icon from the repo. The content is a React component, rendered to static HTML at build time (no client-side JavaScript, except a small script in `index.astro` for the hero video's pause button and the feature icon animation on touch screens), so it can move to another React framework if needed. It doesn't use Starlight's components, since those bring Starlight's global CSS along (see `src/components/socialIcons.ts`).
Official links (GitHub, stores, social media) are in `src/links.ts`.
diff --cc website/src/components/Home.tsx
index 4b14861c,fe1b1506..668ea9b0
--- a/website/src/components/Home.tsx
+++ b/website/src/components/Home.tsx
@@@ -10,13 -5,8 +10,8 @@@ import macAppStoreBadge from '../../../
import msStoreBadge from '../../../ms-store-badge.svg?url';
import snapStoreBadge from '../../../snap-store-black.svg?url';
import logo from '../../../src/renderer/src/icon.svg?url';
- import background1 from '../assets/home/background.jpg?url';
- import background2 from '../assets/home/background2.jpg?url';
- import mainScreenshot from '../assets/home/main-screenshot.jpg?url';
- import original from '../assets/home/original.jpg?url';
- import reencoded from '../assets/home/reencoded.jpg?url';
- import tracksScreenshot from '../assets/home/tracks-screenshot.jpg?url';
-import { background1, background2, generationLossOriginal, generationLossReencoded, mainScreenshot, tracksScreenshot } from '../images.ts';
++import { background1, background2, generationLossOriginal, generationLossReencoded, heroVideo, tracksScreenshot } from '../images.ts';
import { authorUrl, donateUrl, githubUrl, socialLinks, storeUrls, supportEmail } from '../links.ts';
import socialIconPaths from './socialIcons.ts';
@@@ -119,80 -95,37 +109,79 @@@ function FooterLink({ href, children }
return <><a className="footer-link" href={href}>{children}</a>{' '}</>;
}
-export default function Home() {
+function StoreBadges({ height }: { height: number }) {
+ return (
+ <div className="store-badges">
+ {storeBadges.map(({ href, image, alt, rounded }) => (
+ // the Microsoft and Snap badges are square images, rounded here like Apple's (whose corners are about 24% of its height)
+ <a key={href} className={rounded ? 'app-store rounded' : 'app-store'} style={{ borderRadius: rounded ? `${Math.round(height * 0.24)}px` : undefined }} href={href}><img src={image} alt={alt} height={height} /></a>
+ ))}
+ </div>
+ );
+}
+
+const formatStars = (stars: number) => (stars >= 1000 ? `${Math.floor(stars / 1000)}k+` : String(stars));
+
+// stars: the GitHub star count, fetched at build time by index.astro (see githubStars.ts)
+export default function Home({ stars }: { stars: number }) {
return (
<div className="page">
- <nav className="top-nav">
- <a href="/docs">Docs</a>
- <a href={githubUrl}>GitHub</a>
- </nav>
-
- <div className="hero">
- <h1>LosslessCut</h1>
- <div className="tagline">The Swiss Army Knife of Lossless Video/Audio Editing</div>
- <div className="tagline" style={{ opacity: '0.7', marginTop: '.5em' }}>Official app by <a href={authorUrl} style={{ color: 'inherit' }}>Mikael Finstad</a></div>
- <div className="hero-buttons">
- <a className="button" href="#download">Download</a>
- <a className="button secondary" href="/docs">Documentation</a>
- </div>
- </div>
+ <header className="hero" style={{ backgroundImage: `linear-gradient(160deg, rgba(11, 52, 56, 0.93), rgba(40, 40, 40, 0.96) 65%), url(${background1})` }}>
+ <nav className="top-nav">
+ <a href="/docs">Docs</a>
+ <a href={githubUrl}>GitHub</a>
+ </nav>
+
+ <div className="hero-content">
+ <div className="hero-text">
+ <h1>LosslessCut</h1>
+ <div className="tagline">The Swiss Army Knife of Lossless Video/Audio Editing</div>
+ <div className="hero-subtitle">Shave gigabytes off video and audio files in seconds without loss of quality</div>
+ <div className="hero-buttons">
+ <a className="button" href="#download">Download</a>
+ <a className="button secondary" href="/docs">Documentation</a>
+ </div>
+ <StoreBadges height={40} />
+ <ul className="proof">
+ <li><Star aria-hidden size={16} className="star" /> {formatStars(stars)} stars on <a href={githubUrl}>GitHub</a></li>
+ <li><CodeXml aria-hidden size={16} /> Free and open source</li>
+ <li><Monitor aria-hidden size={16} /> Windows, macOS, Linux</li>
+ {/* the number of langNames in src/common/i18n.ts, also in docs/features.md */}
+ <li><Languages aria-hidden size={16} /> 26 languages</li>
+ </ul>
+ <div className="hero-author">Official app by <a href={authorUrl}>Mikael Finstad</a></div>
+ </div>
- <ScreenshotSection
- background={background1}
- screenshot={mainScreenshot}
- alt="Main screenshot"
- width={600}
- borderRadius={9}
- subtitle="Shave gigabytes off video and audio files in seconds without loss of quality"
- />
+ <div className="hero-media">
- {heroVideo != null ? (
- <div className="hero-video">
- <div className="hero-video-title">
- <span className="hero-video-dots" aria-hidden="true"><i /><i /><i /></span>
- LosslessCut
- {/* a looping video must be pausable (WCAG 2.2.2). Shown by the script in index.astro */}
- <button type="button" className="hero-video-pause" aria-label="Pause the video" hidden>
- <Pause className="pause" aria-hidden size={14} />
- <Play className="play" aria-hidden size={14} />
- </button>
- </div>
- {/* with prefers-reduced-motion, the poster is shown instead (home.css), and the script stops the video */}
- <video src={heroVideo} poster={heroPoster} autoPlay muted loop playsInline preload="metadata" width={1024} height={640} aria-label="LosslessCut cutting a video into segments" />
- <img className="hero-video-poster" src={heroPoster} alt="LosslessCut with a video cut into segments" width={1024} height={640} />
++ <div className="hero-video">
++ <div className="hero-video-title">
++ <span className="hero-video-dots" aria-hidden="true"><i /><i /><i /></span>
++ LosslessCut
++ {/* a looping video must be pausable (WCAG 2.2.2). Shown by the script in index.astro */}
++ <button type="button" className="hero-video-pause" aria-label="Pause the video" hidden>
++ <Pause className="pause" aria-hidden size={14} />
++ <Play className="play" aria-hidden size={14} />
++ </button>
+ </div>
- ) : (
- <img src={mainScreenshot} alt="LosslessCut main window" width={1000} height={624} fetchPriority="high" />
- )}
++ {/* with prefers-reduced-motion, the poster is shown instead (home.css), and the script stops the video */}
++ <video poster={heroVideo.poster} autoPlay muted loop playsInline preload="metadata" width={1024} height={640} aria-label="LosslessCut cutting a video into three segments">
++ <source src={heroVideo.smallSrc} type="video/mp4" media="(max-width: 700px)" />
++ <source src={heroVideo.src} type="video/mp4" />
++ </video>
++ <img className="hero-video-poster" src={heroVideo.poster} alt="LosslessCut with a video opened" width={1024} height={640} fetchPriority="high" />
++ </div>
+ </div>
+ </div>
+ </header>
- <div className="quotes">
+ <section className="quotes">
<h2>Thousands of happy users</h2>
- {quotes.map((quote) => <div key={quote} className="quote">{quote}</div>)}
- </div>
+ <Collapsible label="Show all reviews" collapsedHeight={480}>
+ <div className="quote-grid">
+ {quotes.map((quote) => <blockquote key={quote} className="quote-card">{quote}</blockquote>)}
+ </div>
+ </Collapsible>
+ </section>
<WhiteSection>
<div className="comparison" style={{ maxWidth: '700px' }}>
diff --cc website/src/images.ts
index 00000000,50968b22..ba88f52a
mode 000000,100644..100644
--- a/website/src/images.ts
+++ b/website/src/images.ts
@@@ -1,0 -1,20 +1,26 @@@
+ // The homepage's images are hosted on static.mifi.no (originals in src/, resized versions in dist/).
+ const baseUrl = 'https://static.mifi.no';
+
+ // The `''` size is about 0.3 megapixels and `-2000` is the full image for these, so they make a 1x/2x pair
+ const withSrcSet = (path: string) => ({
+ src: `${baseUrl}/dist/${path}.jpg`,
+ srcSet: `${baseUrl}/dist/${path}.jpg 1x, ${baseUrl}/dist/${path}-2000.jpg 2x`,
+ });
+
-export const mainScreenshot = withSrcSet('losslesscut/screenshots/main');
+ export const tracksScreenshot = withSrcSet('losslesscut/screenshots/tracks');
+
+ export const generationLossOriginal = withSrcSet('losslesscut/website/generation-loss-original');
+ export const generationLossReencoded = withSrcSet('losslesscut/website/generation-loss-reencoded');
+
+ export const background1 = `${baseUrl}/dist/losslesscut/website/background-1000.jpg`;
+ export const background2 = `${baseUrl}/dist/losslesscut/website/background2-1000.jpg`;
+
++// The hero video (a silent 1024×640 loop, about 13 s), a smaller one for phones, and a still of its first frame
++export const heroVideo = {
++ src: `${baseUrl}/dist/losslesscut/feature-media/hero-2026-10-22-1000.mp4`,
++ smallSrc: `${baseUrl}/dist/losslesscut/feature-media/hero-2026-10-22.mp4`,
++ poster: `${baseUrl}/dist/losslesscut/feature-media/hero-2026-10-22-poster-1000.jpg`,
++};
++
+ // Social preview image (1200x630)
+ export const ogImage = `${baseUrl}/dist/losslesscut/og-image-1000.jpg`;
diff --cc website/src/pages/index.astro
index 1f35ac6b,b39ddb70..b22757c8
--- a/website/src/pages/index.astro
+++ b/website/src/pages/index.astro
@@@ -1,6 -1,6 +1,7 @@@
---
import Home from '../components/Home.tsx';
+import getGithubStars from '../githubStars.ts';
+ import { ogImage } from '../images.ts';
import { mastodonUrl } from '../links.ts';
import structuredData from '../structuredData.ts';
import '../styles/home.css';
@@@ -33,67 -31,6 +34,68 @@@ const description = 'LosslessCut - Offi
<script type="application/ld+json" is:inline set:html={JSON.stringify(structuredData)} />
</head>
<body>
- <Home />
+ <Home stars={stars} />
+ <!-- is:inline: plain JS, not compiled by Vite, which would look for a tsconfig and find the app's (see tsconfig.json) -->
+ <script is:inline>
+ // The hero video's pause button (Home.tsx), and with prefers-reduced-motion, no video at all (only its poster, see home.css)
+ {
+ const heroVideo = document.querySelector('.hero-video video');
+ if (heroVideo) {
+ if (matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ heroVideo.removeAttribute('autoplay');
+ heroVideo.pause();
+ } else {
+ const pauseButton = document.querySelector('.hero-video-pause');
+ pauseButton.hidden = false;
- pauseButton.addEventListener('click', () => (heroVideo.paused ? heroVideo.play() : heroVideo.pause()));
++ pauseButton.addEventListener('click', () => (heroVideo.paused ? heroVideo.play().catch(() => {}) : heroVideo.pause()));
+ const update = () => {
+ pauseButton.classList.toggle('paused', heroVideo.paused);
+ pauseButton.setAttribute('aria-label', heroVideo.paused ? 'Play the video' : 'Pause the video');
+ };
+ heroVideo.addEventListener('play', update);
+ heroVideo.addEventListener('pause', update);
++ update(); // e.g. if the browser didn't autoplay it
+ }
+ }
+ }
+
+ // On touch screens, draw each feature card's icon when the card reaches the middle of the screen (.draw in home.css), again
+ // after it has left the screen, and when it's tapped. Cards that are on screen when scrolling stops without having passed the
+ // middle (after a jump to a link, or a fast scroll) are drawn then. (Scroll-driven CSS animations can't do this yet in all
+ // browsers, e.g. on iOS.) With a mouse, the icons draw on hover instead.
+ if (matchMedia('(hover: none) and (prefers-reduced-motion: no-preference)').matches && 'IntersectionObserver' in window) {
+ const inMiddle = new IntersectionObserver((entries) => {
+ for (const { target, isIntersecting } of entries) if (isIntersecting) target.classList.add('draw');
+ }, { rootMargin: '-35% 0px -35% 0px' }); // the middle 30% of the screen
+ const visibleCards = new Set();
+ const onScreen = new IntersectionObserver((entries) => {
+ for (const { target, isIntersecting } of entries) {
+ if (isIntersecting) {
+ visibleCards.add(target);
+ } else {
+ visibleCards.delete(target);
+ target.classList.remove('draw');
+ }
+ }
+ });
+ let scrollStopTimer;
+ const drawVisibleWhenScrollStops = () => {
+ clearTimeout(scrollStopTimer);
+ scrollStopTimer = setTimeout(() => visibleCards.forEach((card) => card.classList.add('draw')), 300);
+ };
+ addEventListener('scroll', drawVisibleWhenScrollStops, { passive: true });
+ drawVisibleWhenScrollStops();
+ document.querySelector('.feature-grid')?.classList.add('draw-on-scroll');
+ document.querySelectorAll('.feature-card').forEach((card) => {
+ inMiddle.observe(card);
+ onScreen.observe(card);
+ card.addEventListener('click', () => {
+ card.classList.remove('draw');
+ card.getBoundingClientRect(); // so that the animation starts over
+ card.classList.add('draw');
+ });
+ });
+ }
+ </script>
</body>
</html>