Spaces:
Running

hugging-space / index.html
Chunte's picture
Chunte HF Staff
Landing: demo video above the upload prompt
1b3587c verified
Raw History Blame Contribute Delete
7.95 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#f7f7f5" />
<title>Hugging Space</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23EF4444' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/></svg>" />
</head>
<body>
<header class="bar">
<div class="brand">
<svg class="brand-mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" /></svg>
<h1>Hugging Space</h1>
</div>
<div class="actions">
<label class="btn ghost" title="Upload an SVG logo">
<svg class="icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 13V3.5M6 7l4-4 4 4M4 13.5V16h12v-2.5" /></svg>
<span>Upload or drop an SVG</span>
<input id="file" type="file" accept=".svg,image/svg+xml" hidden />
</label>
<div class="menu-anchor">
<button id="exportBtn" class="btn primary" aria-haspopup="menu" aria-expanded="false">
<span>Export</span>
<svg class="icon chevron" viewBox="0 0 20 20" aria-hidden="true"><path d="M6 8l4 4 4-4" /></svg>
</button>
<div id="exportMenu" class="menu" role="menu" hidden>
<button id="exportSvg" class="menu-item" role="menuitem">
<span>SVG</span><span class="menu-note">Vector</span>
</button>
<button id="exportPng" class="menu-item" role="menuitem">
<span>PNG</span><span class="menu-note">Transparent, 2×</span>
</button>
</div>
</div>
</div>
</header>
<main id="stage" class="stage welcome">
<!-- Shown on landing (stage.welcome) and while a file is dragged over the stage. -->
<div id="drop" class="drop">
<!-- Progressive blur: the frosted base, then stronger blur toward the centre. -->
<span class="drop-blur" aria-hidden="true"></span>
<span class="drop-blur" aria-hidden="true"></span>
<span class="drop-blur" aria-hidden="true"></span>
<span class="drop-blur" aria-hidden="true"></span>
<div class="drop-row">
<!-- A short loop of the app in use (landing only; main.ts sets its source). -->
<div class="drop-video">
<video id="dropVideo" poster="./demo-poster.webp" muted loop playsinline preload="auto" aria-label="Huggy hugging a logo as it is dragged in"></video>
</div>
<button id="dropUpload" class="drop-prompt" type="button">
<svg class="icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 13V3.5M6 7l4-4 4 4M4 13.5V16h12v-2.5" /></svg>
<span class="for-pointer">Drop an SVG logo to hug it</span>
<span class="for-touch">Upload an SVG logo to hug it</span>
</button>
<span class="drop-or">or</span>
<button id="dropExample" class="drop-example" type="button">Play some examples</button>
</div>
</div>
<div class="dock">
<p id="hint" class="hint">
<span class="for-pointer">Drag the logo into Huggy · Scroll to resize · ⇧ Scroll to rotate</span>
<span class="for-touch">Drag the logo into Huggy · Pinch to resize and rotate</span>
</p>
<div id="toolbar" class="toolbar" role="toolbar" aria-label="Logo">
<div class="tgroup dropdown" data-group="examples">
<button class="tg-btn btn ghost small" aria-haspopup="true" aria-expanded="false">
<span class="tg-name">Examples:</span>
<span id="currentExample" class="tg-current">Pydantic</span>
<svg class="icon chevron" viewBox="0 0 20 20" aria-hidden="true"><path d="M6 12l4-4 4 4" /></svg>
</button>
<div class="tg-panel examples">
<span class="toolbar-label">Examples:</span>
<div id="samples" class="chips" aria-label="Example logos"></div>
</div>
</div>
<span class="divider" aria-hidden="true"></span>
<div class="tgroup" data-group="adjust">
<button class="tg-btn btn ghost small" aria-haspopup="true" aria-expanded="false">
<span>Logo</span>
<svg class="icon chevron" viewBox="0 0 20 20" aria-hidden="true"><path d="M6 12l4-4 4 4" /></svg>
</button>
<div class="tg-panel adjust">
<span class="toolbar-label">Logo:</span>
<label class="mini" title="Size">
<span>Size</span>
<input id="size" type="range" min="140" max="1000" value="600" />
</label>
<label class="mini" title="Rotation">
<span>Rotate</span>
<input id="rotation" type="range" min="-180" max="180" value="0" />
</label>
<div class="vsliders">
<div class="vs" data-for="size" data-unit="" role="slider" tabindex="0" aria-label="Size">
<div class="vs-track"><div class="vs-fill"></div></div>
<span class="vs-label">Size</span>
<span class="vs-value"></span>
</div>
<div class="vs" data-for="rotation" data-unit="°" role="slider" tabindex="0" aria-label="Rotation">
<div class="vs-track"><div class="vs-fill"></div></div>
<span class="vs-label">Rotate</span>
<span class="vs-value"></span>
</div>
</div>
<button id="reset" class="icon-btn" title="Reset position" aria-label="Reset position">
<svg class="icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M4.5 9.5a5.5 5.5 0 1 0 1.7-4" /><path d="M4 3v3.5h3.5" /></svg>
<span class="reset-label">Reset</span>
</button>
</div>
</div>
<span class="divider" aria-hidden="true"></span>
<button id="advancedBtn" class="btn ghost small" aria-expanded="false" aria-controls="advanced">
<svg class="icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M4 6h7M14 6h2M4 14h2M9 14h7" /><circle cx="12.5" cy="6" r="1.6" /><circle cx="7.5" cy="14" r="1.6" /></svg>
<span>Advanced</span>
</button>
</div>
</div>
<p id="status" class="toast" role="status" aria-live="polite"></p>
</main>
<aside id="advanced" class="sheet collapsed" aria-label="Advanced tweaking">
<button id="sheetHandle" class="sheet-handle" aria-controls="advanced" aria-expanded="false" aria-label="Expand advanced tweaking" title="Drag or click to expand / collapse">
<span class="grabber" aria-hidden="true"></span>
</button>
<div class="sheet-head">
<h2>Advanced tweaking</h2>
</div>
<div class="sheet-body">
<section class="section">
<h3>Version</h3>
<select id="version" class="select"></select>
<p id="versionDesc" class="note"></p>
</section>
<section class="section">
<label class="switch-row">
<span>Show empty spaces &amp; grip</span>
<input id="debug" type="checkbox" class="switch" />
</label>
<p class="note">Drag a hand to place it, scroll over it to rotate. The magnet snaps it back.</p>
</section>
<section class="section tuner" id="tuner"></section>
</div>
</aside>
<script type="module" src="/src/main.ts"></script>
</body>
</html>