Skip to content

The swiss army knife of lossless video/audio editing

Website: fix the reviews overflowing sideways on phones (Safari), and make the icon drawing visible

Claudee8db0e0f4330
diff --git a/AGENTS.md b/AGENTS.md
index d20347da..29971d9f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -18,7 +18,7 @@ If a commit adds a visual or especially interesting feature (one that's easy to
## Features list
-[`docs/features.md`](docs/features.md) is the full list of features and example use cases (https://losslesscut.app/docs/features). When a commit adds a user-visible feature, or changes or removes one, update it in the same commit, in the matching section. The README (`## Features`) and the homepage (`features` in `website/src/components/Home.tsx`) only show the same 9 highlights: if the new feature is one of the most important for new users, suggest to the user whether it should replace one of them, and keep the two in sync.
+[`docs/features.md`](docs/features.md) is the full list of features and example use cases (https://losslesscut.app/docs/features). When a commit adds a user-visible feature, or changes or removes one, update it in the same commit, in the matching section. The README (`## Features`) and the homepage (`features` in `website/src/components/Home.tsx`) only show the same 9 highlights: if the new feature is one of the most important for new users, suggest to the user whether it should replace one of them, and keep the two in sync. When adding a language to `langNames` (`src/common/i18n.ts`), update the language count in `docs/features.md` and on the homepage.
## FFmpeg
@@ -36,7 +36,7 @@ The stores lag behind GitHub releases, so their "What's new" text must cover eve
## Feature post
-When a visual or especially interesting feature lands in master, suggest a short post about just that feature, on the same channels and with the same rules as the [Release announcement](#release-announcement):
+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](#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.
diff --git a/docs/features.md b/docs/features.md
index a5ab6bcb..8b0d75c1 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -47,7 +47,7 @@ Lossless cuts can only start at a keyframe, so a cut starts at the keyframe befo
- Combine tracks from multiple files (for example add a music or subtitle track to a video)
- Remove tracks you don't need
-- Shift a track in time, for example to sync audio from another recording
+- Shift the tracks of an added file in time, for example to sync audio from another recording
- Extract all tracks from a file into separate files: video, audio, subtitles, attachments and others
- Keep data tracks, like GoPro telemetry (GPMF)
- Choose the video and audio tracks for playback, and play several audio tracks at once
diff --git a/website/README.md b/website/README.md
index 9c50890d..3c8ee2a5 100644
--- a/website/README.md
+++ b/website/README.md
@@ -43,5 +43,6 @@ Build settings:
- Preview command (non-production branches): `npx wrangler preview`
- Branch control: production branch `master`, with builds for non-production branches enabled
- Build watch paths: include `website/*`, `docs/*`, `src/common/websiteUrls.ts`, `src/common/links.ts`, `src/renderer/src/icon.svg` and `*.svg` (the store badges in the repo root; `*` also matches subfolders, so this also covers other SVGs, which is harmless), so that app-only changes don't trigger a deploy
+- Variables (build): `GITHUB_TOKEN`, a fine-grained personal access token with read-only access to public repositories, so the homepage's star count (`src/githubStars.ts`) isn't rate limited. Optional: without it, the last known count may be shown
The Worker itself (name, static assets in `dist/`, URL handling) is configured in `wrangler.jsonc`, the Node.js version in `.node-version`, and the Wrangler version used for deploys and previews (4.135.0 or later for previews) by `wrangler` in `package.json`.
diff --git a/website/package.json b/website/package.json
index bed532e1..e878e334 100644
--- a/website/package.json
+++ b/website/package.json
@@ -13,6 +13,7 @@
"@astrojs/react": "^7.1.0",
"@astrojs/starlight": "^0.42.6",
"astro": "^7.4.0",
+ "lucide": "1.59.0",
"lucide-react": "^1.59.0",
"mdast-util-from-markdown": "^2.1.0",
"mdast-util-to-string": "^4.0.0",
diff --git a/website/src/components/Home.tsx b/website/src/components/Home.tsx
index c07e0445..0d4505e0 100644
--- a/website/src/components/Home.tsx
+++ b/website/src/components/Home.tsx
@@ -1,7 +1,9 @@
// The homepage content. Rendered to static HTML at build time (no client-side JavaScript).
import type { CSSProperties, ReactNode } from 'react';
-import type { LucideIcon } from 'lucide-react';
-import { CodeXml, Combine, Film, Languages, Layers, ListOrdered, Monitor, RefreshCw, ScanSearch, Scissors, SquarePen, Star, Terminal } from 'lucide-react';
+import type { IconNode } from 'lucide';
+import { Combine, Film, Layers, ListOrdered, RefreshCw, ScanSearch, Scissors, SquarePen, Terminal } from 'lucide';
+import type { IconNode as ReactIconNode } from 'lucide-react';
+import { CodeXml, Icon, Languages, Monitor, Star } from 'lucide-react';
import macAppStoreBadge from '../../../mac-app-store-badge.svg?url';
import msStoreBadge from '../../../ms-store-badge.svg?url';
@@ -34,18 +36,22 @@ const quotes = [
];
// Highlights only, the full list is docs/features.md (https://losslesscut.app/docs/features). Keep in sync with the README's.
-const features: { text: string, Icon: LucideIcon }[] = [
- { text: 'Cut and trim video and audio losslessly, in seconds', Icon: Scissors },
- { text: 'Merge cut segments, or whole files with identical codecs, losslessly', Icon: Combine },
- { text: 'Add, remove, replace or extract tracks: audio, subtitles and more', Icon: Layers },
- { text: 'Change the format (remux), for example from MKV to MP4, without re-encoding', Icon: RefreshCw },
- { text: 'Segments, markers and tags, with import/export of chapters, CSV, EDL and more', Icon: ListOrdered },
- { text: 'Detect scenes, black frames and silence, and split by them', Icon: ScanSearch },
- { text: 'Edit metadata and rotation, and create chapters', Icon: SquarePen },
- { text: "Opens almost any format, even ones your player can't play", Icon: Film },
- { text: 'Snapshots and frame export, keyboard shortcuts, a CLI and an HTTP API', Icon: Terminal },
+const features: { text: string, icon: IconNode }[] = [
+ { text: 'Cut and trim video and audio losslessly, in seconds', icon: Scissors },
+ { text: 'Merge cut segments, or whole files with identical codecs, losslessly', icon: Combine },
+ { text: 'Add, remove, replace or extract tracks: audio, subtitles and more', icon: Layers },
+ { text: 'Change the format (remux), for example from MKV to MP4, without re-encoding', icon: RefreshCw },
+ { text: 'Segments, markers and tags, with import/export of chapters, CSV, EDL and more', icon: ListOrdered },
+ { text: 'Detect scenes, black frames and silence, and split by them', icon: ScanSearch },
+ { text: 'Edit metadata and rotation, and create chapters', icon: SquarePen },
+ { text: "Opens almost any format, even ones your player can't play", icon: Film },
+ { text: 'Snapshots and frame export, keyboard shortcuts, a CLI and an HTTP API', icon: Terminal },
];
+// Each line with pathLength 1, so the CSS can draw every line of the icon in the same time (see .feature-icon in home.css).
+// The icons are from lucide (the same icons as lucide-react, as data) for that.
+const drawableIcon = (icon: IconNode): ReactIconNode => icon.map(([tag, attrs], i) => [tag, { ...attrs, pathLength: 1, key: i }]);
+
// a few common ones, the full list is in docs/features.md
const usageScenarios = [
'Cut out commercials from a recorded TV show (and change it from TS to MP4)',
@@ -95,12 +101,15 @@ function List({ items }: { items: string[] }) {
}
// On phones, shows only the first collapsedHeight px of children (a single element), fading out, until the "label" button is
-// clicked. CSS only (a <details> and :has(), see .collapsible in home.css): wider screens and browsers without :has() show everything.
+// clicked (it then says "Show less"). CSS only (a <details> and :has(), see .collapsible in home.css): wider screens and browsers
+// without :has() show everything.
function Collapsible({ label, collapsedHeight, children }: { label: string, collapsedHeight: number, children: ReactNode }) {
return (
<div className="collapsible" style={{ '--collapsed-height': `${collapsedHeight}px` } as CSSProperties}>
{children}
- <details className="collapsible-more"><summary className="button">{label}</summary></details>
+ <details className="collapsible-more">
+ <summary className="button"><span className="collapsible-show">{label}</span><span className="collapsible-hide">Show less</span></summary>
+ </details>
</div>
);
}
@@ -211,9 +220,9 @@ export default function Home({ stars }: { stars: number }) {
<h2 style={{ margin: '20px 0' }}>Features</h2>
<div className="feature-grid">
- {features.map(({ text, Icon }) => (
+ {features.map(({ text, icon }) => (
<div key={text} className="feature-card">
- <span className="feature-icon"><Icon aria-hidden size={24} strokeWidth={1.9} /></span>
+ <span className="feature-icon"><Icon iconNode={drawableIcon(icon)} aria-hidden size={24} strokeWidth={1.9} /></span>
<div>{text}</div>
</div>
))}
diff --git a/website/src/styles/home.css b/website/src/styles/home.css
index 59f1cb7b..a355cbcb 100644
--- a/website/src/styles/home.css
+++ b/website/src/styles/home.css
@@ -175,6 +175,13 @@ body {
columns: 3 280px;
column-gap: 20px;
}
+/* one column on phones anyway. Not multi-column there, because collapsed (<Collapsible>, max-height) the cards that don't fit
+go into extra columns to the side, which Safari didn't lay out again when opened: the page then scrolled sideways */
+@media (max-width: 700px) {
+ .quote-grid {
+ columns: auto;
+ }
+}
.quote-card {
break-inside: avoid;
margin: 0 0 20px;
@@ -248,10 +255,13 @@ body {
line-height: 1.45;
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
-.feature-card:hover {
- transform: translateY(-2px);
- border-color: color-mix(in srgb, var(--accent) 35%, #e4ebeb);
- box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 14%, transparent);
+/* only with a mouse: on phones, a tapped card would stay lifted */
+@media (hover: hover) {
+ .feature-card:hover {
+ transform: translateY(-2px);
+ border-color: color-mix(in srgb, var(--accent) 35%, #e4ebeb);
+ box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 14%, transparent);
+ }
}
@media (prefers-reduced-motion: reduce) {
.feature-card {
@@ -281,15 +291,11 @@ body {
background-color: color-mix(in srgb, var(--accent) 13%, white);
}
/* The icon draws itself: on hover (desktop), and on phones when the card scrolls into view (where scroll-driven animations
-work; elsewhere the icons are just shown). Lucide icons are strokes, shorter than 100 units, so a 100-long dash hides/shows a
-whole line. */
-.feature-icon svg * {
- stroke-dasharray: 100;
- stroke-dashoffset: 0;
-}
+work; elsewhere the icons are just shown). Every line of the icon has pathLength 1 (Home.tsx), so a dash of 1 (with a gap of 2,
+so that no dot of the next dash shows) draws each line from start to end in the same time. */
@keyframes feature-icon-draw {
- from { stroke-dashoffset: 100; }
- to { stroke-dashoffset: 0; }
+ from { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
+ to { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: no-preference) {
.feature-icon {
@@ -348,11 +354,15 @@ so the content element keeps its layout. */
mask-image: linear-gradient(to bottom, black calc(100% - 120px), transparent);
margin-bottom: 0;
}
- .collapsible-more:not([open]) {
+ .collapsible-more {
display: flex;
justify-content: center;
margin: 8px 0 30px;
}
+ .collapsible-more[open] .collapsible-show,
+ .collapsible-more:not([open]) .collapsible-hide {
+ display: none;
+ }
.collapsible-more summary {
list-style: none;
cursor: pointer;
diff --git a/website/yarn.lock b/website/yarn.lock
index 5c7e31bf..f7d1bfda 100644
--- a/website/yarn.lock
+++ b/website/yarn.lock
@@ -3457,6 +3457,7 @@ __metadata:
"@types/react": "npm:^19.3.0"
"@types/react-dom": "npm:^19.3.0"
astro: "npm:^7.4.0"
+ lucide: "npm:1.59.0"
lucide-react: "npm:^1.59.0"
mdast-util-from-markdown: "npm:^2.1.0"
mdast-util-to-string: "npm:^4.0.0"
@@ -3489,6 +3490,13 @@ __metadata:
languageName: node
linkType: hard
+"lucide@npm:1.59.0":
+ version: 1.59.0
+ resolution: "lucide@npm:1.59.0"
+ checksum: 10/9c42a90be7842b30567df154551ee6e5bddfc45097f7a521da147441ffcac8e0f5e3dca4abf77edccef6e6e304aa849f27956af0a821471fbdcb6e577c091b35
+ languageName: node
+ linkType: hard
+
"magic-string@npm:^1.2.3, magic-string@npm:^1.4.3":
version: 1.4.3
resolution: "magic-string@npm:1.4.3"