19 lines
5.7 KiB
JavaScript
19 lines
5.7 KiB
JavaScript
export const DEMO_FILMS = [
|
||
{ id: 'arch-indie', title: 'ARCH-INDIE', filename: '01 - ARCH-INDIE.mp4', duration: '1:16', size: 177274037,
|
||
url: 'https://v.nostr.build/nIgmgVTfBkBpEaOTZ4jzuT.mp4', poster: '/assets/img/demo-films/arch-indie.jpg',
|
||
description: 'Many islands. One Archipelago. A glimpse of a more sovereign digital world.' },
|
||
{ id: 'web5', title: 'What is Web5?', filename: '02 - What is Web5.mp4', duration: '4:10', size: 203331877,
|
||
url: 'https://v.nostr.build/mvjiw1T5rrh28lGfPtBG5T.mp4', poster: '/assets/img/demo-films/web5.jpg',
|
||
description: 'We become the internet. Explore the next chapter of a web built around people.' },
|
||
]
|
||
|
||
export function indeehubDemoPage() {
|
||
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>IndeeHub — Independent stories</title>
|
||
<style>*{box-sizing:border-box}html{color-scheme:dark;scroll-behavior:smooth}body{margin:0;background:#090b10;color:#fff;font:16px/1.5 system-ui,sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer;font:inherit}a{color:inherit;text-decoration:none}header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px clamp(20px,5vw,72px);border-bottom:1px solid #ffffff12}.brand{display:flex;align-items:center;gap:10px;font-size:23px;font-weight:800;letter-spacing:-1px}.brand img{width:34px;height:34px;object-fit:contain}.badge{border:1px solid #ffffff30;border-radius:30px;padding:5px 12px;color:#b7b9c6;font-size:12px}main{max-width:1500px;margin:auto}.hero{min-height:min(65svh,620px);display:flex;align-items:end;padding:clamp(24px,5vw,72px);background:linear-gradient(0deg,#090b10 0%,#090b10aa 35%,#090b1000 85%),url('${DEMO_FILMS[0].poster}') center/cover}.hero-content{max-width:620px}.eyebrow{letter-spacing:.18em;text-transform:uppercase;color:#e6b36d;font-size:12px;font-weight:700}h1{font-size:clamp(38px,7vw,84px);letter-spacing:-.055em;line-height:1.05;margin:14px 0}p{color:#bfc4d1;max-width:550px}.play{border:0;background:#f6eee4;color:#181511;border-radius:8px;padding:12px 22px;font-weight:700;min-height:46px}.play:hover{background:#fff}.films{padding:12px clamp(20px,5vw,72px) 48px}.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.section-head span{color:#8f95a5;font-size:13px}h2{font-size:24px;letter-spacing:-.03em}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.film{border:0;padding:0;background:none;color:inherit;text-align:left}.art{position:relative;border-radius:12px;overflow:hidden;aspect-ratio:16/9;background:#161a23}.art img{width:100%;height:100%;object-fit:cover;transition:transform .25s}.film:hover img{transform:scale(1.03)}.time{position:absolute;bottom:12px;right:12px;background:#000b;border-radius:4px;padding:3px 7px;font-size:12px}.film h3{font-size:19px;margin:12px 0 4px}.film p{margin:0;font-size:14px}.film:focus-visible,.play:focus-visible{outline:2px solid #e6b36d;outline-offset:5px}footer{padding:24px clamp(20px,5vw,72px);border-top:1px solid #ffffff12;color:#7f8797;font-size:12px}dialog{padding:0;border:1px solid #ffffff25;border-radius:16px;background:#10131b;color:white;width:min(1000px,94vw);max-height:92svh}dialog::backdrop{background:#000d}.player-head{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;gap:12px}.close{background:transparent;color:white;border:0;font-size:24px;width:44px;height:44px}video{display:block;width:100%;max-height:70svh;background:#000}.player-note{padding:12px 18px;margin:0;font-size:13px}@media(max-width:560px){header{padding:14px 20px}.grid{grid-template-columns:1fr}.hero{min-height:440px}.hero p{font-size:14px}.section-head span{display:none}}</style></head>
|
||
<body><header><a href="#" class="brand"><img src="/assets/img/app-icons/indeedhub.png" alt="">IndeeHub</a><span class="badge">Demo preview</span></header><main>
|
||
<section class="hero"><div class="hero-content"><span class="eyebrow">Featured · Archipelago original</span><h1>ARCH-INDIE</h1><p>${DEMO_FILMS[0].description}</p><button class="play" data-film="0">▶ Watch film</button></div></section>
|
||
<section class="films" id="films"><div class="section-head"><h2>Independent stories</h2><span>Two films. One connected world.</span></div><div class="grid">${DEMO_FILMS.map((f,i)=>`<button class="film" data-film="${i}" aria-label="Watch ${f.title}"><div class="art"><img src="${f.poster}" alt="${f.title} film still" loading="lazy"><span class="time">${f.duration}</span></div><h3>${f.title}</h3><p>${f.description}</p></button>`).join('')}</div></section></main><footer>IndeeHub preview · Films by Archipelago · Streamed from Nostr Build</footer>
|
||
<dialog id="player"><div class="player-head"><strong id="film-title"></strong><button class="close" aria-label="Close video">×</button></div><video controls playsinline preload="metadata"></video><p class="player-note" id="film-description"></p></dialog>
|
||
<script>const films=${JSON.stringify(DEMO_FILMS)},dialog=document.querySelector('dialog'),video=document.querySelector('video');document.querySelectorAll('[data-film]').forEach(button=>button.onclick=()=>{const film=films[Number(button.dataset.film)];document.querySelector('#film-title').textContent=film.title;document.querySelector('#film-description').textContent=film.description;video.poster=film.poster;video.src=film.url;dialog.showModal();video.play().catch(()=>{});});document.querySelector('.close').onclick=()=>dialog.close();dialog.addEventListener('close',()=>{video.pause();video.removeAttribute('src');video.load();});dialog.addEventListener('click',e=>{if(e.target===dialog&&e.clientY>dialog.getBoundingClientRect().bottom)dialog.close();});</script></body></html>`
|
||
}
|