Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,3 @@ storybook-static

# local state
.env

# landing assets (keep large videos out of git history)
public/landing/*.mp4
public/landing/*.webm
public/landing/*.mov
public/landing/config.local.json
15 changes: 1 addition & 14 deletions public/landing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@ Drop your landing assets here:

- `loop.mp4`: the hi-res looping background video (recommended: H.264, muted)
- `poster.png` (or `poster.jpg`/`poster.gif`): lightweight preview image shown before video loads (and when video is blocked)
- `config.json`: optional overrides for `videoSrc`/`posterSrc` (useful for pointing `videoSrc` to an external URL in production)
- `config.local.json`: optional local-only overrides (checked first, ignored by git)

The landing page references these paths directly:

- `/landing/loop.mp4` (fallback)
- `/landing/Loop.mp4` (fallback)
- `/landing/loop.mp4`
- `/landing/poster.png`
- `/landing/config.json`

Recommended setup to avoid large git history:

1. Host the video externally (example: GitHub Release asset).
2. Set `videoSrc` in `config.json` to the hosted URL.
3. Keep a `config.local.json` for local testing if needed.

GitHub Release URL format (works well for large files):
`https://github.com/<owner>/<repo>/releases/download/<tag>/Loop.mp4`
2 changes: 1 addition & 1 deletion public/landing/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"posterSrc": "/landing/poster.png",
"videoSrc": "https://github.com/humanode-network/vortex-experimental-mockups/releases/download/landing-v1/Loop.mp4"
"videoSrc": "/landing/loop.mp4"
}
3 changes: 3 additions & 0 deletions public/landing/loop.mp4
Git LFS file not shown
31 changes: 3 additions & 28 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,15 @@ import { MarketingFooter } from "@/components/marketing/MarketingFooter";
import { MarketingPage } from "@/components/marketing/MarketingPage";
import { usePrefersReducedMotion } from "@/lib/usePrefersReducedMotion";

const posterSrc = "/landing/poster.png";
const videoSrc = "/landing/loop.mp4";

const Landing: React.FC = () => {
const prefersReducedMotion = usePrefersReducedMotion();
const [videoFailed, setVideoFailed] = React.useState(false);
const [videoReady, setVideoReady] = React.useState(false);
const [posterSrc, setPosterSrc] = React.useState("/landing/poster.png");
const [videoSrc, setVideoSrc] = React.useState("/landing/Loop.mp4");
const videoRef = React.useRef<HTMLVideoElement | null>(null);

React.useEffect(() => {
const loadConfig = async () => {
try {
const endpoints = [
"/landing/config.local.json",
"/landing/config.json",
];
for (const endpoint of endpoints) {
const res = await fetch(endpoint, { cache: "no-store" });
if (!res.ok) continue;
const json = (await res.json()) as Partial<{
posterSrc: string;
videoSrc: string;
}>;
if (json.posterSrc) setPosterSrc(json.posterSrc);
if (json.videoSrc) setVideoSrc(json.videoSrc);
break;
}
} catch {
// Optional config; ignore failures.
}
};
void loadConfig();
}, []);

React.useEffect(() => {
if (prefersReducedMotion) return;
if (videoFailed) return;
Expand Down Expand Up @@ -85,7 +61,6 @@ const Landing: React.FC = () => {
>
<source src={videoSrc} />
<source src="/landing/loop.mp4" />
<source src="/landing/Loop.mp4" />
</video>
)}

Expand Down