art-viewer / index.html
BigRed858's picture
Deploy the ARt Viewer
878dd0b verified
Raw History Blame Contribute Delete
12.8 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>BlueCairo ARt Viewer</title>
<link rel="icon" href="data:,">
<meta name="description" content="See a Blue Cairo print at true size on a wall, in a photo of your room, or on your own wall in augmented reality.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Instrument+Sans:wdth,wght@75..100,400..700&display=swap">
<link rel="stylesheet" href="css/viewer.css">
<script type="importmap">
{
"imports": {
"three": "./vendor/three/build/three.module.js",
"three/addons/": "./vendor/three/addons/"
}
}
</script>
<script src="vendor/qrcode/qrcode.js" defer></script>
<script type="module" src="js/app.js"></script>
</head>
<body>
<main class="viewer" data-catalog="catalog.json" data-store="https://www.thebluecairo.com">
<section class="stage" id="stage-section" data-mode="room" aria-label="Your wall">
<div class="room" id="room">
<div class="room__start" id="room-start">
<button type="button" class="room__drop" id="room-drop" data-add-photos>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="1.5"/><circle cx="8.5" cy="9.5" r="1.75"/><path d="M21 16l-5-5L5 20"/></svg>
<span class="room__drop-title">Choose a photo of your wall</span>
<span class="room__drop-text">We suggest prints for your room and show <span id="start-title">this print</span> on your wall at its real size. Your photo stays on this device.</span>
</button>
<p class="room__error" id="room-error" role="alert"></p>
</div>
<div class="room__compose" id="room-compose" hidden>
<canvas id="room-canvas" tabindex="0" aria-label="Your photo with the print on the wall. Drag the print, or use the arrow keys, to move it."></canvas>
<svg class="room__scale-svg" id="scale-svg" aria-hidden="true"></svg>
<ul class="options" id="options" aria-label="Layouts for your wall"></ul>
<div class="room__bar">
<ul class="room__photos" id="room-photos" aria-label="Your photos"></ul>
<p class="room__scale-note" id="scale-note"></p>
<div class="room__tools">
<button type="button" class="button button--chip" id="scale-start">Set the scale</button>
<button type="button" class="button button--chip" data-open-camera>ARt Viewer</button>
<button type="button" class="button button--chip" data-add-photos>Add photos</button>
<button type="button" class="button button--chip" id="room-reset">Start again</button>
</div>
</div>
<form class="room__scale-form" id="scale-form" hidden>
<p>Drag the two ends onto something you know the size of, then say what it is.</p>
<div class="room__scale-fields">
<label>
<span class="visually-hidden">What you measured</span>
<select id="scale-ref">
<option value="80">Door width, 80 cm</option>
<option value="200">Door height, 200 cm</option>
<option value="29.7">A4 sheet, long side, 29.7 cm</option>
<option value="8.5">Light switch plate, 8.5 cm</option>
<option value="custom">Something else</option>
</select>
</label>
<label class="room__custom" id="scale-custom" hidden>
<input type="number" id="scale-cm" min="1" max="1000" step="0.1" inputmode="decimal" aria-label="Its length in cm"> cm
</label>
<button type="submit" class="button button--primary">Use this length</button>
<button type="button" class="link-button" id="scale-cancel">Cancel</button>
</div>
</form>
</div>
<input type="file" id="photo-input" accept="image/*" multiple hidden>
</div>
<p class="stage__status" id="stage-status" role="status">Loading the collection</p>
</section>
<aside class="panel" aria-label="Print options">
<header class="panel__brand">
<p class="wordmark">BlueCairo <span>ARt Viewer</span></p>
<a class="link-button" id="store-link" href="https://www.thebluecairo.com/collections/all">Back to the shop</a>
</header>
<section class="picks" id="picks" hidden aria-labelledby="picks-title">
<h2 class="picks__title" id="picks-title">Picked for your room</h2>
<p class="picks__status" id="picks-status" role="status"></p>
<p class="picks__why" id="room-why"></p>
<ul class="picks__swatches" id="room-swatches" aria-label="Colours in your room"></ul>
<div class="picks__ask" id="art-ask" hidden>
<p id="art-ask-text"></p>
<div class="picks__ask-buttons">
<button type="button" class="button button--primary" data-choice="replace">Replace it</button>
<button type="button" class="button button--quiet" data-choice="add">Add to it</button>
</div>
</div>
<button type="button" class="link-button" id="change-choice" hidden>Change my answer</button>
<p class="picks__note" id="picks-note"></p>
<div class="suits" id="suits" hidden>
<h3 class="suits__title" id="suits-title"></h3>
<ul class="suits__grid" id="suits-grid" aria-labelledby="suits-title"></ul>
<button type="button" class="link-button" id="suits-more" hidden></button>
</div>
</section>
<section class="tray" aria-labelledby="tray-title">
<div class="tray__head">
<h2 class="tray__title" id="tray-title">On your wall</h2>
<button type="button" class="link-button" id="get-picks">Get picks for your room</button>
</div>
<ul class="tray__list" id="tray-list"></ul>
<p class="tray__note" id="tray-note" role="status"></p>
</section>
<section class="selected" aria-labelledby="art-title">
<div class="selected__head">
<h1 class="art-title" id="art-title">Choose an artwork</h1>
<button type="button" class="link-button" id="open-picker" disabled>Change</button>
</div>
<fieldset class="chips" id="finish-group">
<legend>Finish</legend>
<div class="chips__row">
<label class="chip"><input type="radio" name="finish" value="canvas"><span>Canvas</span></label>
<label class="chip"><input type="radio" name="finish" value="poster"><span>Poster</span></label>
<label class="chip"><input type="radio" name="finish" value="photorag"><span>Photo rag</span></label>
</div>
</fieldset>
<p class="chips__note" id="finish-note"></p>
<fieldset class="chips" id="size-group">
<legend>Size</legend>
<div class="chips__row" id="size-list"></div>
</fieldset>
<p class="panel__footprint" id="footprint"></p>
</section>
<p class="panel__credits"><a href="credits.html">Credits and licences</a></p>
<div class="panel__actions">
<button type="button" class="button button--primary" id="ar-button" disabled>See it on my wall</button>
<button type="button" class="button button--primary" id="save-button" hidden>Save the picture</button>
<a class="button button--quiet" id="buy-link" href="#">Buy this print</a>
<p class="panel__note" id="ar-note" role="status"></p>
</div>
</aside>
</main>
<dialog class="sheet" id="picker" aria-labelledby="picker-title">
<form method="dialog" class="sheet__head">
<h2 id="picker-title">Choose an artwork</h2>
<button class="link-button" value="close">Close</button>
</form>
<label class="search">
<span class="visually-hidden">Search artworks</span>
<input type="search" id="picker-search" placeholder="Search by title" autocomplete="off">
</label>
<ul class="picker-grid" id="picker-grid"></ul>
<p class="sheet__empty" id="picker-empty" hidden>No artwork matches that title.</p>
</dialog>
<dialog class="sheet sheet--small" id="wall-choice" aria-labelledby="wall-choice-title">
<form method="dialog" class="sheet__head">
<h2 id="wall-choice-title">See it on your wall</h2>
<button class="link-button" value="close">Close</button>
</form>
<div class="choice">
<button type="button" class="button button--ink" data-add-photos>Get recommendations for my room</button>
<p class="choice__note">Upload a photo of your wall</p>
<button type="button" class="button button--ink" data-open-camera>ARt Viewer</button>
<p class="choice__note">See it live through your camera</p>
</div>
</dialog>
<dialog class="sheet sheet--small" id="qr" aria-labelledby="qr-title">
<form method="dialog" class="sheet__head">
<h2 id="qr-title">Open it on your phone</h2>
<button class="link-button" value="close">Close</button>
</form>
<p id="qr-text">Scan this code with your phone camera. The page opens with this print and size, ready to place on your wall.</p>
<div class="qr-code" id="qr-code"></div>
</dialog>
<div class="xr" id="xr" hidden>
<video class="xr__video" id="xr-video" playsinline muted hidden></video>
<div class="xr__aim" id="xr-aim" hidden aria-hidden="true"></div>
<div class="xr__top" id="xr-top">
<p class="xr__hint" id="xr-hint" role="status" aria-live="polite"></p>
<button type="button" class="xr__close" id="xr-close" aria-label="Close the camera">
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>
</button>
</div>
<div class="xr__sheet" id="xr-sheet" data-open="false">
<button type="button" class="xr__shutter" id="xr-shutter" aria-label="Take a picture of your wall with the print" hidden>
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8.5A1.5 1.5 0 0 1 4.5 7h2.6l1.6-2.2h6.6L16.9 7h2.6A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z"/><circle cx="12" cy="12.8" r="3.6"/></svg>
</button>
<button type="button" class="xr__handle" id="xr-handle" aria-expanded="false" aria-controls="xr-sheet-body">
<span class="xr__grip" aria-hidden="true"></span>
<span class="xr__handle-text" id="xr-handle-text"></span>
<svg class="xr__chevron" viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 15l6-6 6 6"/></svg>
</button>
<div class="xr__sheet-body" id="xr-sheet-body">
<div class="xr__sheet-inner">
<div class="xr__row">
<p class="xr__title" id="xr-title"></p>
<div class="xr__zoom" role="group" aria-label="Zoom">
<button type="button" class="xr__round" id="xr-zoom-out" aria-label="Zoom out"><svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M6 12h12"/></svg></button>
<button type="button" class="xr__round" id="xr-zoom-in" aria-label="Zoom in"><svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M6 12h12M12 6v12"/></svg></button>
</div>
</div>
<div class="xr__sizes" id="xr-sizes" role="group" aria-label="Size"></div>
<button type="button" class="xr__more xr__measure" id="xr-measure" hidden>Measure my wall again</button>
<div class="xr__arts-head">
<h2 class="xr__arts-label" id="xr-arts-label">Recommended for you</h2>
<button type="button" class="xr__more" id="xr-arts-toggle">See all prints</button>
</div>
<p class="xr__arts-note" id="xr-arts-note"></p>
<ul class="xr__arts" id="xr-arts" aria-labelledby="xr-arts-label"></ul>
</div>
</div>
</div>
</div>
</body>
</html>