Spaces:
Running
Running
Mobile responsive layout: 3D avatar stage placed at the top with controls below
Browse filesFiles changed (4)
- app.js+1-1
- avatar/AvatarCanvas.js+16
- index.html+2-2
- style.css+38-12
5 unmodified lines67891011125 unmodified lines*/// ── Avatar 3D Module ────────────────────────────────────────────────────────import { AvatarCanvas } from './avatar/AvatarCanvas.js?v=30';let globalAvatar3D = null;window.globalAvatar3D = null;5 unmodified lines67891011125 unmodified lines*/// ── Avatar 3D Module ────────────────────────────────────────────────────────import { AvatarCanvas } from './avatar/AvatarCanvas.js?v=31';let globalAvatar3D = null;window.globalAvatar3D = null;
179 unmodified lines18018118218318418522 unmodified lines208209210211212213269 unmodified lines483484485486487488179 unmodified linesthis.resize = this.resize.bind(this);window.addEventListener('resize', this.resize);// Initial resizethis.resize();22 unmodified linesif (this.renderer) this.renderer.setSize(w, h, false);if (this.camera) {this.camera.aspect = w / h;this.camera.updateProjectionMatrix();}}269 unmodified linesdispose() {this.disposed = true;window.removeEventListener('resize', this.resize);if (this.animFrameId) cancelAnimationFrame(this.animFrameId);if (this._themeObserver) this._themeObserver.disconnect();if (this.controls) this.controls.dispose();179 unmodified lines18018118218318418518618718818919019122 unmodified lines214215216217218219220221222223224225269 unmodified lines495496497498499500501502503504179 unmodified linesthis.resize = this.resize.bind(this);window.addEventListener('resize', this.resize);// Responsive container ResizeObserver (handles mobile orientation & keyboard layout changes)if (typeof ResizeObserver !== 'undefined' && this.canvas.parentElement) {this._resizeObserver = new ResizeObserver(() => this.resize());this._resizeObserver.observe(this.canvas.parentElement);}// Initial resizethis.resize();22 unmodified linesif (this.renderer) this.renderer.setSize(w, h, false);if (this.camera) {this.camera.aspect = w / h;// In portrait/mobile viewports, adapt vertical FOV so character arms and hands remain nicely in frameif (this.camera.aspect < 1.0) {this.camera.fov = Math.min(46, Math.max(32, 32 / this.camera.aspect));} else {this.camera.fov = 32;}this.camera.updateProjectionMatrix();}}269 unmodified linesdispose() {this.disposed = true;window.removeEventListener('resize', this.resize);if (this._resizeObserver) {this._resizeObserver.disconnect();this._resizeObserver = null;}if (this.animFrameId) cancelAnimationFrame(this.animFrameId);if (this._themeObserver) this._themeObserver.disconnect();if (this.controls) this.controls.dispose();
8 unmodified lines9101112131415498 unmodified lines5145155165175185198 unmodified lines<link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" /><link rel="stylesheet" href="style.css?v=24" /><!-- Three.js pinned local importmap (no CDN) --><script type="importmap">498 unmodified lines</dialog><div class="toast" id="toast" role="status" aria-live="polite"></div><script type="module" src="app.js?v=35"></script></body></html>8 unmodified lines9101112131415498 unmodified lines5145155165175185198 unmodified lines<link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /><link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" /><link rel="stylesheet" href="style.css?v=25" /><!-- Three.js pinned local importmap (no CDN) --><script type="importmap">498 unmodified lines</dialog><div class="toast" id="toast" role="status" aria-live="polite"></div><script type="module" src="app.js?v=36"></script></body></html>
722 unmodified lines723724725726727728729730731732733734735736737738739286 unmodified lines1026102710281029103010311032103310341035103610371038103910401041722 unmodified lines.rail { overflow: visible; }.viewport { flex: none; width: 100%; }/* Practice Studio (VISUALLY) on tablet/laptop */.visually-workspace {grid-template-columns: minmax(0, 1fr) !important;overflow: visible;}.practice-input-rail {overflow: visible;}.avatar-viewport {min-height: 440px;height: 480px;}}286 unmodified linespadding: 0 6px;}/* Practice 3D Avatar Stage on Mobile */.practice-stage {width: 100%;height: auto;}.avatar-viewport {min-height: 360px;height: 52vh;max-height: 500px;border-radius: 14px;position: relative;overflow: hidden;722 unmodified lines723724725726727728729730731732733734735736737738739740741742743744745746747748749750286 unmodified lines1037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067722 unmodified lines.rail { overflow: visible; }.viewport { flex: none; width: 100%; }/* Practice Studio (VISUALLY) on tablet/mobile: 3D Avatar at TOP, controls BELOW */.visually-workspace {display: flex !important;flex-direction: column !important;grid-template-columns: minmax(0, 1fr) !important;overflow: visible !important;gap: 14px;}.visually-workspace .practice-stage {order: -1 !important; /* Move 3D Avatar to the top */width: 100%;flex: none;}.visually-workspace .practice-input-rail {order: 1 !important; /* Move controls & timeline below */width: 100%;overflow: visible;}.avatar-viewport {min-height: 340px;height: 48vh;max-height: 460px;}}286 unmodified linespadding: 0 6px;}/* Practice 3D Avatar Stage on Mobile: Avatar at TOP, Controls BELOW */.visually-workspace {display: flex !important;flex-direction: column !important;padding: 10px 12px 24px !important;gap: 12px !important;}.visually-workspace .practice-stage {order: -1 !important; /* Move 3D Avatar to the very top */width: 100% !important;height: auto !important;margin-bottom: 4px !important;}.visually-workspace .practice-input-rail {order: 1 !important; /* Controls, text input, timeline placed below */width: 100% !important;overflow: visible !important;}.avatar-viewport {min-height: 300px;height: 44vh;max-height: 420px;border-radius: 14px;position: relative;overflow: hidden;
app.js+1-1
avatar/AvatarCanvas.js+16
index.html+2-2
style.css+38-12