Salle en verre, profondeur de champ, espace d’écho
Réaliser un espace de profondeur en verre dans le contexte d’une salle d’écho : contenu réel, contrôles interactifs, retour d’état clair et mise en page adaptative à différentes tailles.
Après activation de JavaScript, ce cas peut être modifié, exécuté et enregistré. Code source fixe ci-dessous :
<!doctype html>
<html lang="fr" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Salle en verre, profondeur de champ, espace d’écho</title>
<style>
:root { --ink:#17241d; --paper:#f3f0e7; --accent:#af4f45; --secondary:#9eb49f; --line:color-mix(in srgb, var(--ink) 18%, transparent); --shadow:0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent); color-scheme:light; }
* { box-sizing:border-box; }
html { min-width:320px; background:var(--paper); }
body { min-height:100vh; margin:0; overflow-x:hidden; color:var(--ink); font-family:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif; background:radial-gradient(circle at 15% 10%,color-mix(in srgb,var(--secondary) 35%,transparent) 0 9%,transparent 10%),radial-gradient(circle at 90% 75%,color-mix(in srgb,var(--accent) 18%,transparent) 0 12%,transparent 13%),var(--paper); }
button,input,select,textarea { color:inherit; font:inherit; }
button,[role="button"],input,select,textarea { accent-color:var(--accent); }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
[hidden] { display:none !important; }
@media (max-width:700px) { .mast h1 { line-height:1.08 !important; letter-spacing:-.035em !important; overflow-wrap:anywhere; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
.page{width:min(1140px,calc(100% - 28px));margin:auto;padding:54px 0}.mast{display:flex;justify-content:space-between;align-items:center;gap:24px;margin:0 12px 28px}.mast h1{font-family:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif;font-weight:900;font-size:clamp(38px,8vw,82px);letter-spacing:-.035em;margin:0;line-height:.98}.eyebrow{display:inline-flex;padding:7px 12px;border-radius:999px;color:var(--paper);background:var(--accent);font-weight:900}.intro{max-width:620px;line-height:1.65}.scenario{padding:12px 18px;border-radius:999px;background:var(--secondary);box-shadow:0 7px 0 color-mix(in srgb,var(--ink) 18%,transparent);font-weight:900}.demo{border-radius:46px 18px 46px 18px;box-shadow:0 18px 0 color-mix(in srgb,var(--secondary) 45%,transparent);position:relative;min-height:390px;overflow:hidden;padding:clamp(22px,5vw,54px);background:color-mix(in srgb,var(--paper) 90%,#fff)}@media(max-width:700px){.mast{display:grid}.page{width:calc(100% - 16px);padding:18px 0}.demo{padding:17px}}
.panel{padding:26px;border:1px solid var(--line);border-radius:2px;background:var(--paper)}.stack{display:grid;gap:28px}.row{display:flex;gap:20px;flex-wrap:wrap}.action{padding:9px 2px;border:0;border-bottom:2px solid var(--line);background:transparent}.action.primary,.action.is-active{border-color:var(--accent);color:var(--accent)}.muted{font-size:14px;line-height:1.9}.status{min-height:20px;margin-top:28px;font-size:13px}.metric{font-size:clamp(40px,9vw,88px);font-weight:500;letter-spacing:-.06em}.meter{height:2px;background:var(--line)}.meter>i{display:block;height:100%;background:var(--accent)}.chip{font-size:11px;letter-spacing:.12em;text-transform:uppercase}
.composition-split{display:grid;grid-template-columns:150px minmax(0,1fr);gap:18px;align-items:start}.split-note{position:sticky;top:20px;display:grid;gap:14px;padding:18px 12px;border-block:3px double var(--accent);font-size:13px;line-height:1.65}.split-note b{font:900 12px/1 ui-monospace,monospace;letter-spacing:.12em}.split-note span{writing-mode:vertical-rl;min-height:120px;color:color-mix(in srgb,var(--ink) 60%,transparent)}.composition-split .demo{min-width:0}@media(max-width:900px){.composition-split{grid-template-columns:1fr}.split-note{position:static;grid-template-columns:auto 1fr}.split-note span{writing-mode:horizontal-tb;min-height:0}}
.glass-depth-lab{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(220px,.6fr);gap:16px}.glass-stage{--glass-depth:66px;--glass-blur:16px;--tilt-x:0deg;--tilt-y:0deg;position:relative;min-height:470px;overflow:hidden;border:1px solid var(--line);border-radius:28px;background:linear-gradient(145deg,#172554,#0f766e);perspective:900px;transform-style:preserve-3d}.glass-card{position:absolute;left:50%;top:50%;display:grid;width:min(62%,360px);height:180px;padding:24px;border:1px solid rgba(255,255,255,.48);border-radius:26px;background:rgba(255,255,255,.15);color:#fff;box-shadow:0 28px 70px rgba(3,7,18,.25);backdrop-filter:blur(var(--glass-blur));transform:translate(-50%,-50%) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));transition:transform .28s ease}.glass-card span{letter-spacing:.15em}.glass-card strong{align-self:end;font-size:42px}.glass-back{transform:translate(-72%,-68%) translateZ(calc(var(--glass-depth)*-1)) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));opacity:.64}.glass-middle{transform:translate(-50%,-50%) rotateX(var(--tilt-x)) rotateY(var(--tilt-y))}.glass-front{transform:translate(-28%,-32%) translateZ(var(--glass-depth)) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));background:rgba(255,255,255,.24)}.glass-orb{position:absolute;width:190px;aspect-ratio:1;border-radius:50%;filter:blur(4px);background:#f472b6}.orb-a{left:-6%;top:-10%}.orb-b{right:-8%;bottom:-14%;background:#fde047}.glass-controls{display:grid;align-content:center;gap:17px}.glass-controls label{display:grid;grid-template-columns:1fr auto;gap:8px;font-weight:800}.glass-controls input{grid-column:1/-1}@media(max-width:740px){.glass-depth-lab{grid-template-columns:1fr}.glass-stage{min-height:370px}.glass-card{width:70%;height:145px}}.workflow-spatial{display:grid;gap:16px}.workflow-spatial>header{display:grid;grid-template-columns:1fr minmax(170px,.35fr) minmax(170px,.35fr);gap:18px;align-items:end;padding-bottom:16px;border-bottom:5px solid var(--ink)}.workflow-spatial h2{margin:.2em 0}.workflow-spatial header label{display:grid;grid-template-columns:1fr auto;gap:7px}.workflow-spatial header input{grid-column:1/-1;width:100%}.spatial-grid{display:grid;grid-template-columns:minmax(0,var(--spatial-width)) 20px minmax(180px,1fr);gap:0;align-items:stretch}.spatial-core{min-width:0;transform:scale(var(--spatial-zoom));transform-origin:top left;transition:transform .2s}.spatial-handle{display:grid;min-height:300px;place-items:center;border:0;border-inline:1px dashed var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);cursor:col-resize}.spatial-grid>aside{display:grid;align-content:center;gap:14px;padding:22px;background:color-mix(in srgb,var(--secondary) 14%,var(--paper))}.spatial-grid>aside strong{font-size:clamp(24px,4vw,42px)}@media(max-width:900px){.workflow-spatial>header{grid-template-columns:1fr}.spatial-grid{order:-1;grid-template-columns:1fr}.spatial-handle{min-height:44px;cursor:row-resize}.spatial-core{transform:none}}
</style>
</head>
<body data-aesthetic="playful" data-composition="split-note">
<main class="page">
<header class="mast"><div><span class="eyebrow">playful / espace de profondeur de champ en verre / INTERMEDIATE</span><h1>Salle en verre, profondeur de champ, espace d’écho</h1><p class="intro">Réaliser un espace de profondeur en verre dans le contexte d’une salle d’écho : contenu réel, contrôles interactifs, retour d’état clair et mise en page adaptative à différentes tailles.</p></div><span class="scenario">Salle d’écho</span></header>
<div class="composition-split"><aside class="split-note"><b>CASE 02</b><span>Maîtriser la structure sémantique, l’organisation responsive, l’utilisation du clavier et la synchronisation des états dans un espace de profondeur en verre.</span></aside><section class="demo" aria-label="Zone d’interaction spatiale en profondeur de verre de la salle d’écho"><div id="workflowSpatial" class="workflow-spatial" style="--spatial-width:64%;--spatial-zoom:1"><header><div><span class="eyebrow">Salle d’écho SPATIAL CANVAS</span><h2>Pupitre de la salle d’écho</h2></div><label>Proportion d’intensité visuelle<input id="workflowSpatialWidth" type="range" min="38" max="82" value="64"><output id="workflowSpatialWidthValue">64%</output></label><label>Redimensionnement du contenu<input id="workflowSpatialZoom" type="range" min="80" max="120" value="100"><output id="workflowSpatialZoomValue">100%</output></label></header><div class="spatial-grid"><section id="workflowCore" class="workflow-core spatial-core"><!-- 11DZ_CORE_START:creative-effects-glass-depth --><div class="glass-depth-lab"><section id="glassStage" class="glass-stage" tabindex="0" aria-label="Espace de profondeur de champ en verre de la salle des échos ; déplacez le pointeur ou utilisez les touches de direction pour changer l’angle de vue" aria-describedby="glassHelp"><i class="glass-orb orb-a"></i><i class="glass-orb orb-b"></i><article class="glass-card glass-back"><span>couche d’arrière-plan</span><strong>03</strong></article><article class="glass-card glass-middle"><span>Salle d’écho</span><strong>Profondeur de champ</strong></article><article class="glass-card glass-front"><span>Couche de focus</span><strong>Clair</strong></article></section><aside class="glass-controls panel"><span class="eyebrow">GLASS DEPTH</span><h2>Espace à profondeur de verre</h2><p id="glassHelp" class="muted">La transparence, le flou d’arrière-plan et le déplacement sur l’axe Z créent ensemble de la profondeur.</p><label>Distance entre les couches <input id="glassDepth" type="range" min="20" max="110" value="66" data-core-bridge="creative-effects-glass-depth"><output id="glassDepthValue">66px</output></label><label>Flou de verre <input id="glassBlur" type="range" min="2" max="28" value="16"><output id="glassBlurValue">16px</output></label><button id="glassReset" class="action" type="button">Réinitialiser la vue</button></aside></div><!-- 11DZ_CORE_END --></section><input id="workflowSpatialHandle" class="spatial-handle" type="button" value="↔" aria-label="Faire glisser pour ajuster la largeur de l’aperçu du cas principal"><aside><strong>Couche de base de la salle d’écho</strong><p>La mise en page dynamique de la salle des échos et la mise en page d’exposition de la salle des échos seront réorganisées selon la taille de la toile.</p><output id="workflowSpatialStatus">Largeur 64%, zoom 100%</output><input id="workflowSpatialApply" class="action primary" type="button" value="Effet d’application"></aside></div></div><p id="status" class="status" role="status" aria-live="polite"></p></section></div>
</main>
<script>
'use strict';
const statusOutput = document.querySelector('#status');
const announce = message => { statusOutput.textContent = message; };
/* 11DZ_CORE_SCRIPT_START:creative-effects-glass-depth */
const glassStage=document.querySelector('#glassStage');const glassDepth=document.querySelector('#glassDepth');const glassBlur=document.querySelector('#glassBlur');let glassTilt={x:0,y:0};function setGlassTilt(x,y){glassTilt={x:Math.max(-12,Math.min(12,x)),y:Math.max(-15,Math.min(15,y))};glassStage.style.setProperty('--tilt-x',glassTilt.x+'deg');glassStage.style.setProperty('--tilt-y',glassTilt.y+'deg');}glassStage.addEventListener('pointermove',event=>{const rect=glassStage.getBoundingClientRect();setGlassTilt(((event.clientY-rect.top)/rect.height-.5)*-20,((event.clientX-rect.left)/rect.width-.5)*24);});glassStage.addEventListener('pointerleave',()=>setGlassTilt(0,0));glassStage.addEventListener('keydown',event=>{if(!['ArrowLeft','ArrowRight','ArrowUp','ArrowDown'].includes(event.key))return;event.preventDefault();setGlassTilt(glassTilt.x+(event.key==='ArrowUp'?-2:event.key==='ArrowDown'?2:0),glassTilt.y+(event.key==='ArrowLeft'?-2:event.key==='ArrowRight'?2:0));announce('Perspective de l’espace de verre ajustée');});function renderGlass(){glassStage.style.setProperty('--glass-depth',glassDepth.value+'px');glassStage.style.setProperty('--glass-blur',glassBlur.value+'px');document.querySelector('#glassDepthValue').textContent=glassDepth.value+'px';document.querySelector('#glassBlurValue').textContent=glassBlur.value+'px';announce('Distance entre les couches '+glassDepth.value+' Pixel, flou '+glassBlur.value+' pixel');}[glassDepth,glassBlur].forEach(input=>input.addEventListener('input',renderGlass));document.querySelector('#glassReset').addEventListener('click',()=>{setGlassTilt(0,0);glassStage.focus();announce('La perspective de l’espace en verre a été réinitialisée');});renderGlass();
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"creative-effects-glass-depth","selector":"[data-core-bridge=\"creative-effects-glass-depth\"]","mode":"range","key":"ArrowRight"};const workflowBridgeCore=document.querySelector('#workflowCore');const workflowBridgeControl=workflowBridgeCore.querySelector(workflowBridgeSpec.selector);if(!workflowBridgeControl)throw new Error('Missing core bridge: '+workflowBridgeSpec.name);const workflowBridgeControlledId=workflowBridgeControl.getAttribute('aria-controls');const workflowBridgeControlled=workflowBridgeControlledId?document.getElementById(workflowBridgeControlledId):null;workflowBridgeCore.dataset.workflowBridge=workflowBridgeSpec.name;workflowBridgeCore.dataset.workflowVersion='0';function workflowBridgeSerialize(){const visualNode=workflowBridgeCore.firstElementChild||workflowBridgeCore;const visual=getComputedStyle(visualNode);const outputs=[...workflowBridgeCore.querySelectorAll('output,[role="status"],[aria-live],meter,progress')].map(node=>node.textContent.trim()+'|'+node.getAttribute('aria-valuenow')+'|'+node.getAttribute('value'));const canvas=[...workflowBridgeCore.querySelectorAll('canvas')].map(node=>{try{return node.toDataURL().slice(-160);}catch{return 'canvas-unavailable';}});return JSON.stringify({html:workflowBridgeCore.innerHTML,status:statusOutput.textContent,outputs,canvas,visual:[visual.display,visual.visibility,visual.opacity,visual.transform,visual.filter,visual.backgroundColor,visual.width,visual.height],scroll:workflowBridgeSpec.mode==='scroll'?workflowBridgeControl.scrollTop:null});}let workflowBridgeLastEffect=workflowBridgeSerialize();function workflowBridgeSummary(){const label=(workflowBridgeControl.getAttribute('aria-label')||workflowBridgeControl.textContent||workflowBridgeControl.value||workflowBridgeSpec.name).trim().replace(/\s+/g,' ').slice(0,72);return label+' · Version de base '+workflowBridgeCore.dataset.workflowVersion;}function workflowBridgeCommit(){const effect=workflowBridgeSerialize();if(effect===workflowBridgeLastEffect)return {changed:false,summary:workflowBridgeSummary()};workflowBridgeLastEffect=effect;workflowBridgeCore.dataset.workflowVersion=String(Number(workflowBridgeCore.dataset.workflowVersion||0)+1);return {changed:true,summary:workflowBridgeSummary()};}function workflowBridgeScheduleCommit(){queueMicrotask(workflowBridgeCommit);setTimeout(workflowBridgeCommit,0);}workflowBridgeControl.addEventListener("input",workflowBridgeScheduleCommit);workflowBridgeControl.addEventListener('change',workflowBridgeScheduleCommit);const workflowBridgeStateTargets=new Set(workflowBridgeCore.querySelectorAll('dialog'));if(workflowBridgeControlled&&workflowBridgeCore.contains(workflowBridgeControlled))workflowBridgeStateTargets.add(workflowBridgeControlled);workflowBridgeStateTargets.forEach(target=>['close','cancel','toggle'].forEach(eventName=>target.addEventListener(eventName,workflowBridgeScheduleCommit)));function workflowBridgeActivate(){workflowBridgeControl.focus();const step=Number(workflowBridgeControl.step)||1;const min=workflowBridgeControl.min===''?-Infinity:Number(workflowBridgeControl.min);const max=workflowBridgeControl.max===''?Infinity:Number(workflowBridgeControl.max);let next=Math.min(max,Math.max(min,(Number(workflowBridgeControl.value)||0)+step));if(next===Number(workflowBridgeControl.value))next=Math.max(min,Number(workflowBridgeControl.value)-step);workflowBridgeControl.value=String(next);workflowBridgeControl.dispatchEvent(new Event('input',{bubbles:true}));workflowBridgeControl.dispatchEvent(new Event('change',{bubbles:true}));const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowSpatial=document.querySelector('#workflowSpatial');const workflowSpatialCore=document.querySelector('#workflowCore');const workflowSpatialWidth=document.querySelector('#workflowSpatialWidth');const workflowSpatialZoom=document.querySelector('#workflowSpatialZoom');const workflowSpatialHandle=document.querySelector('#workflowSpatialHandle');const workflowSpatialState={width:64,zoom:1,dragging:false};function workflowSpatialDrive(){workflowSpatial.style.setProperty('--spatial-width',workflowSpatialState.width+'%');workflowSpatial.style.setProperty('--spatial-zoom',String(workflowSpatialState.zoom));workflowSpatialWidth.value=String(workflowSpatialState.width);workflowSpatialZoom.value=String(Math.round(workflowSpatialState.zoom*100));document.querySelector('#workflowSpatialWidthValue').textContent=workflowSpatialState.width+'%';document.querySelector('#workflowSpatialZoomValue').textContent=Math.round(workflowSpatialState.zoom*100)+'%';document.querySelector('#workflowSpatialStatus').textContent='largeur '+workflowSpatialState.width+'%,mise à l’échelle '+Math.round(workflowSpatialState.zoom*100)+'%';announce('La toile de l’Echo Hall a été réorganisée');}workflowSpatialWidth.addEventListener('input',()=>{workflowSpatialState.width=Number(workflowSpatialWidth.value);workflowSpatialDrive();});workflowSpatialZoom.addEventListener('input',()=>{workflowSpatialState.zoom=Number(workflowSpatialZoom.value)/100;workflowSpatialDrive();});workflowSpatialHandle.addEventListener('pointerdown',event=>{workflowSpatialState.dragging=true;workflowSpatialHandle.setPointerCapture(event.pointerId);});workflowSpatialHandle.addEventListener('pointermove',event=>{if(!workflowSpatialState.dragging)return;const rect=workflowSpatial.getBoundingClientRect();workflowSpatialState.width=Math.max(38,Math.min(82,Math.round((event.clientX-rect.left)/rect.width*100)));workflowSpatialDrive();});workflowSpatialHandle.addEventListener('pointerup',event=>{workflowSpatialState.dragging=false;workflowSpatialHandle.releasePointerCapture(event.pointerId);});workflowSpatialHandle.addEventListener('wheel',event=>{event.preventDefault();workflowSpatialState.zoom=Math.max(.8,Math.min(1.2,workflowSpatialState.zoom+(event.deltaY<0?.05:-.05)));workflowSpatialDrive();},{passive:false});workflowSpatialHandle.addEventListener('keydown',event=>{if(!['ArrowLeft','ArrowRight'].includes(event.key))return;event.preventDefault();workflowSpatialState.width=Math.max(38,Math.min(82,workflowSpatialState.width+(event.key==='ArrowRight'?2:-2)));workflowSpatialDrive();});document.querySelector('#workflowSpatialApply').addEventListener('click',()=>{const bridge=workflowBridgeActivate();document.querySelector('#workflowSpatialStatus').textContent='Effet appliqué · largeur '+workflowSpatialState.width+'%,mise à l’échelle '+Math.round(workflowSpatialState.zoom*100)+'% · '+bridge.summary;announce(document.querySelector('#workflowSpatialStatus').textContent);});workflowSpatialDrive();
workflowBridgeReset();
</script>
</body>
</html>