Spaces:
Running
Running
Download index.html from FineEnvs/designworld-explorer: direct link, hf CLI and curl.
- Browser
- Download file 56.1 kB
-
https://huggingface.co/spaces/FineEnvs/designworld-explorer/resolve/main/index.html
- Command line
-
hf download hf://spaces/FineEnvs/designworld-explorer/index.html
-
curl -L -o index.html https://huggingface.co/spaces/FineEnvs/designworld-explorer/resolve/main/index.html
56.1 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>DesignWorld</title> | |
| <meta name="description" content="Computer-use trajectories of an agent recreating designs in 14 editors: every design, every editor, every step."> | |
| <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=EB+Garamond:ital,wght@0,400..800;1,400..800&family=Geist:wght@100..900&display=swap" rel="stylesheet"> | |
| <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%2312110f'/%3E%3Ctext x='16' y='23' font-family='Georgia,serif' font-size='21' text-anchor='middle' fill='%23ece6d9'%3EDW%3C/text%3E%3C/svg%3E"> | |
| <style> | |
| :root{--paper:#ece6d9;--paper-deep:#e3dccc;--ink:#12110f;--ink-2:#12110fa8;--ink-3:#12110f6b;--hair:#12110f29;--wash:#12110f11;--mark:#d9431c;--ok:#2f6b3a;--bad:#a3301f; | |
| --serif:"EB Garamond Variable","EB Garamond",Garamond,"Times New Roman",serif;--sans:"Geist Variable",Geist,ui-sans-serif,system-ui,sans-serif;--mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace; | |
| --margin:clamp(20px,3.4vw,56px);--gutter:clamp(14px,1.7vw,28px);--lede:clamp(21px,.95rem + .98vw,31px);--body:clamp(17px,.98rem + .2vw,20px);--ui:clamp(12.5px,.74rem + .12vw,14px);--out:cubic-bezier(.16,1,.3,1)} | |
| *{box-sizing:border-box} | |
| html{background:var(--paper)} | |
| body{margin:0;min-height:100svh;background:var(--paper);color:var(--ink);font-family:var(--serif);font-size:var(--body);line-height:1.4;font-feature-settings:"kern","liga";text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;overflow-x:clip} | |
| body:after{content:"";position:fixed;inset:0;z-index:60;pointer-events:none;opacity:.07;mix-blend-mode:multiply;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")} | |
| ::selection{background:var(--ink);color:var(--paper)} | |
| a{color:inherit} | |
| img{max-width:100%} | |
| .ui,.top,.meta,.ihead h2,.foot,th,select,input,button,.cap,.lbl,.pager,.count,.crumbs{font-family:var(--sans);font-size:var(--ui);letter-spacing:-.004em;font-feature-settings:"kern","tnum";font-weight:430;line-height:1.3} | |
| .i2{color:var(--ink-2)}.i3{color:var(--ink-3)} | |
| .page{padding:0 var(--margin)} | |
| .wrap{max-width:1480px;margin:0 auto} | |
| /* top bar: the wordmark and the sections */ | |
| .top{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:clamp(20px,3.4vh,36px) 0;flex-wrap:wrap} | |
| .wm{font-family:var(--sans);font-weight:760;letter-spacing:-.04em;line-height:1;display:inline-flex;align-items:center;gap:.2em;white-space:nowrap;text-decoration:none;font-size:22px} | |
| .links{display:flex;gap:1.8em;flex-wrap:wrap} | |
| .links a,.ul{text-decoration:none;background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .45s var(--out)} | |
| .links a:hover,.links a.on,.ul:hover{background-size:100% 1px} | |
| .links a{color:var(--ink-2)}.links a.on,.links a:hover{color:var(--ink)} | |
| /* type */ | |
| .meta{color:var(--ink-2);display:flex;gap:1.2em;flex-wrap:wrap;align-items:baseline;margin:0 0 1.1em} | |
| .meta b{color:var(--ink);font-weight:500} | |
| .title{font-weight:400;letter-spacing:-.02em;line-height:.98;margin:0;font-size:clamp(44px,1.6rem + 3.4vw,84px)} | |
| .title.sm{font-size:clamp(34px,1.2rem + 2.4vw,60px)} | |
| .lede{font-size:var(--lede);line-height:1.26;letter-spacing:-.006em;max-width:22em;margin:.7em 0 0} | |
| .lede.wide{max-width:30em;font-size:clamp(19px,.9rem + .6vw,24px)} | |
| /* the outlined button with the ink sweep */ | |
| .cta{position:relative;isolation:isolate;display:inline-flex;align-items:center;gap:.75em;border:1px solid var(--ink);color:var(--ink);background:none;font:500 clamp(14px,.8rem + .18vw,16px)/1 var(--sans);letter-spacing:0;padding:.78em 1.1em .8em;text-decoration:none;cursor:pointer;white-space:nowrap;transition:color .35s var(--out)} | |
| .cta:before{content:"";position:absolute;inset:0;z-index:-1;background:var(--ink);transform:scaleX(0);transform-origin:0;transition:transform .45s var(--out)} | |
| .cta:hover{color:var(--paper)}.cta:hover:before{transform:scaleX(1)} | |
| .cta .ar{transition:transform .35s var(--out)}.cta:hover .ar{transform:translate(3px)} | |
| .cta.sm{font-size:var(--ui);padding:.6em .9em .62em} | |
| .ctas{display:flex;gap:12px;flex-wrap:wrap;margin-top:clamp(28px,4vh,44px)} | |
| /* sections: a label above an ink rule */ | |
| .sect{margin-top:clamp(64px,10vh,120px)} | |
| .ihead{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;border-bottom:1px solid var(--ink);padding-bottom:11px;flex-wrap:wrap} | |
| .ihead h2{margin:0;font-weight:500} | |
| .ihead .i2{font-family:var(--sans);font-size:var(--ui)} | |
| .note{font-size:var(--body);color:var(--ink-2);max-width:40em;margin:14px 0 0} | |
| .intro{padding-top:clamp(12px,4vh,48px)} | |
| /* hero */ | |
| .hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:var(--gutter);align-items:end;padding-top:clamp(28px,8vh,96px)} | |
| .figs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--ink);margin-top:clamp(48px,8vh,96px)} | |
| .fig{padding:16px var(--gutter) 4px 0;border-right:1px solid var(--hair)} | |
| .fig+.fig{padding-left:var(--gutter)}.fig:last-child{border-right:0} | |
| .fig b{display:block;font-weight:400;font-size:clamp(34px,1.2rem + 2.2vw,56px);letter-spacing:-.02em;line-height:1;font-variant-numeric:lining-nums tabular-nums} | |
| .fig span{display:block;margin-top:8px} | |
| /* the featured design / galleries */ | |
| .feat{display:grid;grid-template-columns:minmax(0,320px) minmax(0,1fr);gap:var(--gutter);padding-top:20px} | |
| .plate{display:block;border:1px solid var(--hair);background:var(--paper-deep);line-height:0} | |
| .plate img{width:100%;display:block} | |
| .plate.miss{aspect-ratio:16/10;border-style:dashed;background:none}.cell .plate.miss{height:72px;aspect-ratio:auto}.tgt .plate.miss{height:120px;aspect-ratio:auto} | |
| .cap{color:var(--ink-2);margin:.7em 0 0;line-height:1.45} | |
| .kind{font-family:var(--sans);font-size:var(--ui);color:var(--ink-2);margin:0 0 10px;display:flex;gap:.8em} | |
| .gal+.kind{margin-top:24px} | |
| .feat .gal{grid-template-columns:repeat(4,minmax(0,1fr))} | |
| .gal{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--gutter) 14px} | |
| .gc{text-decoration:none;display:block} | |
| .gc .plate{transition:border-color .3s} | |
| .gc:hover .plate{border-color:var(--ink)} | |
| .gc img{aspect-ratio:16/10;object-fit:cover;object-position:top} | |
| .gc .lbl{display:flex;justify-content:space-between;gap:8px;margin-top:7px} | |
| .gc .lbl b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} | |
| .gc .lbl span{color:var(--ink-2)} | |
| .gc.none{opacity:.45}.gc.none .plate{aspect-ratio:16/10;background:none;border-style:dashed} | |
| /* index rows (editors, versions): the release-row look */ | |
| .rows{margin:0;padding:0;list-style:none} | |
| .rows li{border-bottom:1px solid rgb(0 0 0 / .22)} | |
| .row{position:relative;isolation:isolate;display:grid;grid-template-columns:3em minmax(0,1.6fr) repeat(3,minmax(0,1fr)) 6em;column-gap:var(--gutter);align-items:baseline;padding:clamp(14px,2vh,20px) 0;text-decoration:none;color:inherit;transition:color .3s 50ms} | |
| a.row:before{content:"";position:absolute;inset:0 calc(-1 * var(--margin) / 2);background:var(--ink);transform:scaleX(0);transform-origin:0;transition:transform .6s var(--out);z-index:-1} | |
| a.row:hover{color:var(--paper)}a.row:hover:before{transform:scaleX(1)} | |
| a.row:hover .no,a.row:hover small,a.row:hover em,a.row:hover .go{color:inherit} | |
| .row .no,.row .n,.row .go{font-family:var(--sans);font-size:var(--ui);font-feature-settings:"tnum"} | |
| .row .no{color:var(--ink-3)} | |
| .row .nm{font-size:clamp(22px,1rem + .9vw,30px);letter-spacing:-.01em;line-height:1.1} | |
| .row .nm small{font-family:var(--sans);font-size:var(--ui);color:var(--ink-2);margin-left:.7em;letter-spacing:0} | |
| .row .n{text-align:right} | |
| .row .n em{display:block;font-style:normal;color:var(--ink-2);font-size:.92em} | |
| .row .go{color:var(--ink-2);text-align:right} | |
| /* filters */ | |
| .bar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:18px 0;border-bottom:1px solid var(--ink);margin-top:28px} | |
| select,input{color:var(--ink);background:transparent;border:1px solid var(--hair);border-radius:0;padding:.62em .8em;outline:none} | |
| select{appearance:none;-webkit-appearance:none;padding-right:2.2em;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2312110f' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .7em center} | |
| select:hover,input:hover{border-color:var(--ink-3)} | |
| select:focus,input:focus{border-color:var(--ink)} | |
| input{min-width:240px}input::placeholder{color:var(--ink-3)} | |
| .count{color:var(--ink-2);margin-left:auto} | |
| /* tables (board, recordings, traces) */ | |
| table{border-collapse:collapse;width:100%;font-variant-numeric:lining-nums tabular-nums} | |
| th{font-weight:500;text-align:left;color:var(--ink-2);padding:12px 10px 10px;border-bottom:1px solid var(--ink);white-space:nowrap} | |
| td{padding:12px 10px;border-bottom:1px solid var(--hair);vertical-align:middle} | |
| td.n,th.n{text-align:right} | |
| td.u{font-family:var(--sans);font-size:var(--ui)} | |
| tbody tr{transition:background .2s}tbody tr:hover td{background:var(--wash)} | |
| .tscroll{overflow-x:auto;-webkit-overflow-scrolling:touch} | |
| .go-l{font-family:var(--sans);font-size:var(--ui);color:var(--ink-2);text-decoration:none;white-space:nowrap}.go-l:hover{color:var(--ink)} | |
| .ok{color:var(--ok)}.bad{color:var(--bad)} | |
| .tag{display:inline-block;font-family:var(--sans);font-size:11px;color:var(--ink-2);border:1px solid var(--hair);padding:.05em .45em .12em;margin-left:.5em;letter-spacing:0;vertical-align:.12em} | |
| /* the board */ | |
| .board thead th{background:var(--paper);font-size:12px;padding:10px 8px} | |
| .board td{padding:10px 8px} | |
| th.grp{text-align:center;color:var(--ink);border-bottom:1px solid rgb(0 0 0 / .22)} | |
| td.sep,th.sep{border-left:1px solid var(--hair)} | |
| .cell a{text-decoration:none;display:block} | |
| .cell .plate{width:112px;transition:border-color .3s}.cell a:hover .plate{border-color:var(--ink)} | |
| .cell img{width:112px;height:72px;object-fit:cover;object-position:top} | |
| .cell span{display:block;font-family:var(--sans);font-size:11px;color:var(--ink-2);margin-top:5px;white-space:nowrap} | |
| .tgt .plate{width:120px}.tgt img{width:120px;height:120px;object-fit:contain} | |
| .dname a{text-decoration:none;font-size:20px;letter-spacing:-.01em}.dname a:hover{text-decoration:underline;text-underline-offset:.16em;text-decoration-thickness:1px} | |
| .dname div{font-family:var(--sans);font-size:12px;color:var(--ink-2);margin-top:4px;min-width:150px;line-height:1.45} | |
| .empty{width:112px;height:72px;display:flex;align-items:center;justify-content:center;color:var(--ink-3);border:1px dashed var(--hair);font-family:var(--sans);font-size:12px} | |
| .pager{display:flex;gap:12px;align-items:center;justify-content:center;padding:22px 0;color:var(--ink-2)} | |
| /* design page */ | |
| .dhead{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,380px);gap:calc(var(--gutter) * 2);align-items:end;padding-top:clamp(20px,6vh,72px)} | |
| .facts{display:grid;grid-template-columns:max-content 1fr;gap:8px 28px;margin-top:clamp(24px,4vh,40px);border-top:1px solid var(--ink);padding-top:16px} | |
| .facts span{font-family:var(--sans);font-size:var(--ui)}.facts span:nth-child(odd){color:var(--ink-2)} | |
| /* player */ | |
| .crumbs{color:var(--ink-2);padding-top:8px}.crumbs a{text-decoration:none}.crumbs a:hover{color:var(--ink)} | |
| .player{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:var(--gutter);align-items:start;margin-top:28px;border-top:1px solid var(--ink);padding-top:20px} | |
| .stage{position:sticky;top:16px} | |
| .screens{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr);gap:14px;align-items:start} | |
| .screen{position:relative;border:1px solid var(--hair);background:var(--paper-deep);line-height:0;overflow:hidden} | |
| .screen img{width:100%;display:block} | |
| /* the action layer over the screenshot: cursor, click ripples, drag path, keyboard HUD */ | |
| .fx{position:absolute;inset:0;pointer-events:none;overflow:hidden;line-height:1} | |
| .fx>svg{position:absolute;inset:0;width:100%;height:100%} | |
| .cur{position:absolute;left:50%;top:50%;width:clamp(16px,2.3%,26px);opacity:0;z-index:3;transition:opacity .2s;filter:drop-shadow(0 1px 1.5px rgba(0,0,0,.4))} | |
| .cur.on{opacity:1}.cur svg{width:100%;height:auto;display:block;transform-origin:0 0;transition:transform .12s} | |
| .cur.down svg{transform:scale(.82)} | |
| .cur .badge{position:absolute;left:120%;top:100%;font:600 10.5px/1 var(--sans);letter-spacing:0;background:var(--mark);color:#fff;padding:3px 5px 4px;white-space:nowrap;opacity:0;transition:opacity .15s} | |
| .cur .badge.on{opacity:1} | |
| .ring{position:absolute;width:30px;height:30px;margin:-15px 0 0 -15px;border:2px solid var(--mark);border-radius:50%;background:rgba(217,67,28,.16);z-index:2} | |
| .ring.static{opacity:.95} | |
| .hud{position:absolute;left:50%;bottom:5%;transform:translate(-50%,6px);display:flex;align-items:center;gap:6px;background:rgba(18,17,15,.9);color:var(--paper);font:500 13px/1 var(--sans);letter-spacing:0;padding:8px 12px;white-space:nowrap;max-width:92%;overflow:hidden;opacity:0;z-index:4;transition:opacity .2s,transform .2s} | |
| .hud.on{opacity:1;transform:translate(-50%,0)} | |
| .hud kbd{font:600 12.5px/1 var(--sans);background:var(--paper);color:var(--ink);padding:5px 8px 4px;border-bottom:2px solid #a39c8e;min-width:1.9em;text-align:center;display:inline-block} | |
| .hud i{font-style:normal;color:rgba(236,230,217,.55);font-size:11px} | |
| .hud .lab{color:rgba(236,230,217,.62);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;margin-right:3px} | |
| .hud .typed{font:13px/1.2 var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:pre} | |
| .hud .caret{display:inline-block;width:1.5px;height:1.05em;background:var(--paper);margin-left:-4px;animation:blink 1s steps(1) infinite} | |
| @keyframes blink{50%{opacity:0}} | |
| .screen.look{outline:2px solid var(--mark);outline-offset:-2px} | |
| .act{font-family:var(--sans);font-size:13px;line-height:1.35;margin-top:3px;display:flex;gap:.5em;align-items:baseline} | |
| .act b{font-weight:500}.act .ic{color:var(--mark);width:1em;flex:none;text-align:center} | |
| .st .act{font-size:12.5px;color:var(--ink-2)}.st.on .act{color:var(--ink)} | |
| .now .act{font-size:14px;margin-top:6px} | |
| .now .call{font-size:11.5px;color:var(--ink-2);margin-top:2px} | |
| @media (max-width:640px){.hud{font-size:11px;padding:6px 8px;gap:4px}.hud kbd{font-size:11px;padding:3px 6px}.hud .typed{font-size:11px}} | |
| .ctl{display:flex;gap:8px;align-items:center;margin-top:14px;flex-wrap:wrap} | |
| .ctl input[type=range]{flex:1;min-width:120px;accent-color:var(--ink);padding:0;border:0;background:none} | |
| .ib{width:38px;height:38px;border:1px solid var(--ink);background:transparent;color:var(--ink);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:background .25s,color .25s} | |
| .ib:hover,.ib.play{background:var(--ink);color:var(--paper)} | |
| .ib svg{width:15px;height:15px} | |
| .ctl select{padding:.55em 2.1em .55em .7em} | |
| .now{margin-top:16px;border-top:1px solid var(--hair);padding-top:14px;min-height:80px;font-size:18px;line-height:1.4} | |
| .now .th{white-space:pre-wrap;margin-bottom:8px} | |
| .fn{font-weight:600} | |
| .call{font:12.5px/1.5 var(--mono);color:var(--ink);word-break:break-word} | |
| .res{font:12px/1.5 var(--mono);color:var(--ink-2);white-space:pre-wrap;word-break:break-word} | |
| .steps{max-height:calc(100vh - 40px);overflow:auto;border-top:1px solid var(--hair);position:relative} | |
| .st{padding:12px 4px 12px 14px;border-bottom:1px solid var(--hair);cursor:pointer;font-size:16px;line-height:1.35;transition:background .2s} | |
| .st:hover{background:var(--wash)} | |
| .st.on{background:var(--paper-deep);box-shadow:inset 2px 0 0 var(--ink)} | |
| .st .no{font-family:var(--sans);font-size:11px;color:var(--ink-3);margin-right:.5em;font-feature-settings:"tnum"} | |
| .st .th{display:block;margin:3px 0 4px} | |
| .st .call{font-size:11.5px;color:var(--ink-2)} | |
| details{margin-top:16px;border-top:1px solid var(--hair);padding-top:12px} | |
| details summary{cursor:pointer;font-family:var(--sans);font-size:var(--ui);color:var(--ink-2)} | |
| pre.sys{white-space:pre-wrap;font:12.5px/1.55 var(--mono);margin:12px 0 0} | |
| /* collaboration line under the hero buttons */ | |
| .collab{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;margin:26px 0 0;padding:14px 0;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);font-family:var(--sans);font-size:var(--ui);color:var(--ink-2)} | |
| .collab .k{color:var(--ink-3)} | |
| .collab a{display:inline-flex;align-items:center;gap:7px;color:var(--ink);text-decoration:none} | |
| .collab a b{font-weight:600;font-size:16px;letter-spacing:-.01em} | |
| .collab a small{color:var(--ink-3);font-size:var(--ui)} | |
| .collab a:hover b{text-decoration:underline} | |
| .collab .lg{height:22px;width:auto;display:block} | |
| .collab .lg.pm{height:16px} | |
| .collab svg.lg path{fill:#16150f} | |
| .brand{display:inline-flex;align-items:baseline;gap:12px;flex-wrap:wrap} | |
| .wm-by{font-family:var(--sans);font-size:12px;letter-spacing:.01em;color:var(--ink-3);white-space:nowrap} | |
| /* footer */ | |
| .foot{display:grid;grid-template-columns:auto 1fr auto;column-gap:var(--gutter);row-gap:14px;align-items:center;padding:22px var(--margin) calc(28px + env(safe-area-inset-bottom));border-top:1px solid var(--ink);margin-top:clamp(80px,12vh,140px)} | |
| .foot svg{fill:currentColor;height:15px;width:auto;display:block} | |
| .foot ul{display:flex;flex-wrap:wrap;gap:.4em 1.8em;margin:0;padding:0;list-style:none} | |
| .foot a{text-decoration:none;background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .45s var(--out)} | |
| .foot a:hover{background-size:100% 1px}.foot .wm-f{background:none;font-size:16px} | |
| .foot p{margin:0;color:var(--ink-2)} | |
| .loading{font-family:var(--sans);font-size:var(--ui);color:var(--ink-2);padding:18vh 0;text-align:center} | |
| .loading:after{content:"";display:block;width:120px;height:1px;margin:14px auto 0;background:linear-gradient(90deg,var(--ink) 0 40%,transparent 40%) 0 0/200% 100%;animation:ld 1.1s var(--out) infinite} | |
| @keyframes ld{from{background-position:100% 0}to{background-position:-100% 0}} | |
| @media (prefers-reduced-motion:reduce){*{transition:none;animation:none}} | |
| @media (max-width:1100px){.gal{grid-template-columns:repeat(4,minmax(0,1fr))}.player{grid-template-columns:1fr}.stage{position:static}.steps{max-height:460px}} | |
| @media (max-width:900px){.hero,.feat,.dhead{grid-template-columns:1fr}.figs{grid-template-columns:repeat(2,minmax(0,1fr))}.fig:nth-child(2){border-right:0}.fig:nth-child(3){padding-left:0}.fig:nth-child(n+3){border-top:1px solid var(--hair)} | |
| .row{grid-template-columns:2.4em minmax(0,1fr) auto}.row .x,.row .go{display:none}.gal,.feat .gal{grid-template-columns:repeat(3,minmax(0,1fr))}} | |
| @media (max-width:640px){.wm{font-size:20px}.links{gap:1.2em}.bar input{min-width:0;flex:1 1 100%}.bar select{flex:1 1 40%}.count{margin-left:0;flex-basis:100%}.foot{grid-template-columns:auto 1fr}.foot p{grid-column:1/-1} | |
| .screens{grid-template-columns:1fr}.screens>div:last-child{max-width:45%}.gal,.feat .gal{grid-template-columns:repeat(2,minmax(0,1fr))}} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="page"><div class="wrap"> | |
| <header class="top"> | |
| <span class="brand"><a class="wm" href="#/" aria-label="DesignWorld, home">DesignWorld</a><span class="wm-by">Perpetual Research Γ Hugging Face</span></span> | |
| <nav class="links"><a href="#/" id="nav-o">Overview</a><a href="#/designs" id="nav-d">Designs</a><a href="#/traces" id="nav-t">Traces</a><a href="#/bench" id="nav-b">Bench</a><a href="https://huggingface.co/datasets/perpetual-research/designworld-sft" target="_blank" rel="noopener">Dataset β</a></nav> | |
| </header> | |
| <main id="main"><div class="loading">Loading</div></main> | |
| </div></div> | |
| <footer class="foot"> | |
| <a class="wm wm-f" href="#/">DesignWorld</a> | |
| <ul><li><a href="https://huggingface.co/datasets/perpetual-research/designworld-sft" target="_blank" rel="noopener">DesignWorld-SFT</a></li><li><a href="https://huggingface.co/datasets/perpetual-research/designworld-bench" target="_blank" rel="noopener">DesignWorld-Bench</a></li><li><a href="https://perpetualresearch.si/designworld" target="_blank" rel="noopener">Blog</a></li><li><a href="https://huggingface.co/collections/FineEnvs/designworld-6b0d2eaea75522cac763304d" target="_blank" rel="noopener">Collection</a></li></ul> | |
| <p>Β© 2026 Perpetual Research Β· with Hugging Face FineEnvs Β· sandboxes by Daytona</p> | |
| </footer> | |
| <script> | |
| const $ = s => document.querySelector(s); | |
| const niceDate = d => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(d || ""); return m ? `${+m[3]} ${["January","February","March","April","May","June","July","August","September","October","November","December"][+m[2]-1]} ${m[1]}` : (d || ""); }; | |
| const esc = s => String(s ?? "").replace(/[&<>"]/g, c => ({"&":"&","<":"<",">":">",'"':"""}[c])); | |
| const fmt = v => v == null ? "β" : (typeof v === "number" ? (Number.isInteger(v) ? v.toLocaleString("en-US") : v.toFixed(3)) : v); | |
| const pct = v => v == null ? "β" : v.toFixed(3); | |
| const two = k => String(k).padStart(2, "0"); | |
| let S = null, PLAY = null; | |
| async function api(p){ const r = await fetch(p); if(!r.ok) throw new Error(p+" "+r.status); return r.json(); } | |
| const label = c => (S.editors.find(e => e.config === c) || {}).label || c; | |
| const short = c => label(c).replace(/ \(.*\)/, ""); | |
| const isMock = c => c.startsWith("gui_"); | |
| function nav(which){ for (const k of ["o","d","t","b"]) $("#nav-"+k).className = k === which ? "on" : ""; } | |
| function params(){ const h = location.hash.split("?")[1] || ""; return Object.fromEntries(new URLSearchParams(h)); } | |
| function setParams(base, p){ const q = new URLSearchParams(Object.entries(p).filter(([k,v]) => v !== "" && v != null && v !== 0)); location.hash = base + (q.toString() ? "?" + q : ""); } | |
| const AR = `<span class="ar">β</span>`; | |
| const loading = t => { $("#main").innerHTML = `<div class="loading">${t || "Loading"}</div>`; }; | |
| function gallery(cells){ | |
| const groups = [["Real applications", S.editors.filter(e => !isMock(e.config))], ["Browser replicas", S.editors.filter(e => isMock(e.config))]]; | |
| return groups.map(([g, eds]) => `<div class="kind"><span>${g}</span><span class="i3">${eds.length}</span></div><div class="gal">${eds.map(e => { const c = cells[e.config]; | |
| return c ? `<a class="gc" href="#/trace/${encodeURIComponent(c.trace_id)}"><span class="plate"><img loading="lazy" src="/media/${c.preview}" alt="${esc(e.label)}, final screen"></span><span class="lbl ui"><b>${esc(short(e.config))}</b><span>${pct(c.reward)}</span></span></a>` | |
| : `<div class="gc none"><span class="plate"></span><span class="lbl ui"><b>${esc(short(e.config))}</b><span>β</span></span></div>`; }).join("")}</div>`).join(""); | |
| } | |
| async function overview(){ | |
| nav("o"); | |
| const s = S, bc = s.by_config || {}; | |
| const feat = (await api(`/api/designs?complete=yes&limit=1&offset=${Math.floor(Math.random() * Math.max(1, s.designs_complete14 || 1))}`)).items[0]; | |
| const eds = s.editors.map((e, i) => { const c = bc[e.config] || {}; return `<li><a class="row" href="#/traces?config=${e.config}"><span class="no">${two(i + 1)}</span> | |
| <span class="nm">${esc(short(e.config))}<small>${isMock(e.config) ? "browser replica" : "real application"}</small></span><span class="n x"></span><span class="n">${fmt(c.training)}<em>training</em></span><span class="go">Traces β</span></a></li>`; }).join(""); | |
| $("#main").innerHTML = ` | |
| <section class="hero"><div> | |
| <p class="meta"><span>Dataset</span><span>SFT trajectories</span><span>${esc(niceDate(s.built))}</span></p> | |
| <h1 class="title">DesignWorld</h1> | |
| <p class="lede">An agent recreating designs on a real desktop, one screenshot, click and keystroke at a time, in fourteen editors.</p> | |
| <div class="ctas"><a class="cta" href="#/designs">Browse designs ${AR}</a><a class="cta" href="https://huggingface.co/datasets/perpetual-research/designworld-sft" target="_blank" rel="noopener">Get the dataset ${AR}</a></div> | |
| <div class="collab"><span class="k">Built by</span><a href="https://huggingface.co/FineEnvs" target="_blank" rel="noopener"><img class="lg" src="https://perpetualresearch.si/logos/huggingface.svg" alt=""><b>Hugging Face</b><small>FineEnvs team</small></a><span class="k">in collaboration with</span><a href="https://perpetualresearch.si" target="_blank" rel="noopener"><img class="lg pm" src="https://perpetualresearch.si/logos/perpetual-mark-dark.png" alt=""><b>Perpetual Research</b></a><span class="k">sandboxes by</span><a href="https://www.daytona.io" target="_blank" rel="noopener"><svg class="lg" aria-hidden="true" viewBox="0 0 275 287" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
| <path d="M14.5584 193.736H114.275V227.925H14.5584V193.736Z" fill="#16150f"/> | |
| <path d="M148.464 74.076H262.426V108.265H148.464V74.076Z" fill="#16150f"/> | |
| <path d="M88.6338 84.6127L173.246 0L197.422 24.175L112.809 108.788L88.6338 84.6127Z" fill="#16150f"/> | |
| <path d="M89.157 170.084L24.175 105.102L0 129.277L64.9819 194.259L89.157 170.084Z" fill="#16150f"/> | |
| <path d="M174.629 217.911L106.133 286.407L81.9577 262.232L150.454 193.736L174.629 217.911Z" fill="#16150f"/> | |
| <path d="M174.106 132.44L250.66 208.994L274.835 184.819L198.281 108.265L174.106 132.44Z" fill="#16150f"/> | |
| <path d="M88.6338 48.434V131.057H54.4451L54.4451 48.434H88.6338Z" fill="#16150f"/> | |
| <path d="M208.294 168.094V270.66H174.106V168.094H208.294Z" fill="#16150f"/> | |
| </svg><b>Daytona</b></a></div> | |
| </div><div> | |
| <p class="note" style="margin:0">Each trajectory starts from a target image and an open editor: LibreOffice Impress and Draw, ONLYOFFICE, Inkscape, Scribus, PhotoCraft, Penpot, draw.io and six browser replicas. The agent sees screenshots and acts through mouse and keyboard tools until the design is rebuilt and saved.</p> | |
| </div></section> | |
| <div class="figs"><div class="fig"><b>${fmt(s.training_traces)}</b><span class="ui i2">SFT trajectories, open</span></div><div class="fig"><b>14</b><span class="ui i2">graphic-design apps, 8 real</span></div><div class="fig"><b>126</b><span class="ui i2">steps in a median trajectory</span></div><div class="fig"><b>1,170</b><span class="ui i2">hours of recorded design work</span></div></div> | |
| ${feat ? `<section class="sect"><header class="ihead"><h2>One design, fourteen editors</h2><a class="ul ui" href="#/design/${feat.task_id}">${esc(feat.task_id)} β</a></header> | |
| <div class="feat"><div><a class="plate" href="#/design/${feat.task_id}"><img src="/media/targets/${feat.task_id}.webp" alt="target design"></a><p class="cap">The target: ${esc(feat.format)}, ${esc(feat.tier)}, ${fmt(feat.n_elements)} layers. Each editor's final screen is alongside; open one to replay the episode.</p></div><div>${gallery(feat.cells)}</div></div></section>` : ""} | |
| <section class="sect"><header class="ihead"><h2>Editors</h2><span class="i2">training trajectories</span></header><ol class="rows">${eds}</ol></section>`; | |
| } | |
| async function designsView(){ | |
| nav("d"); | |
| const p = params(), off = +(p.offset || 0), complete = p.complete === "all" ? "" : (p.complete ?? "yes"); | |
| const r = await api(`/api/designs?${new URLSearchParams({q:p.q||"",complete,split:p.split||"",offset:off,limit:40})}`); | |
| const kind = e => isMock(e.config) ? "Browser replicas" : "Real applications"; | |
| const sep = (e, i) => i === 0 || kind(e) !== kind(S.editors[i - 1]) ? "sep" : ""; | |
| const groups = []; for (const e of S.editors) { const g = groups[groups.length - 1]; if (g && g[0] === kind(e)) g[1]++; else groups.push([kind(e), 1]); } | |
| const grp = `<tr><th></th><th></th>${groups.map(([k, n]) => `<th class="grp sep" colspan="${n}">${k}</th>`).join("")}</tr>`; | |
| const head = S.editors.map((e, i) => `<th class="${sep(e, i)}" title="${esc(e.label)}">${esc(short(e.config))}</th>`).join(""); | |
| const body = r.items.map(d => `<tr><td class="tgt"><a class="plate" href="#/design/${d.task_id}"><img loading="lazy" src="/media/targets/${d.task_id}.webp" alt=""></a></td> | |
| <td class="dname"><a href="#/design/${d.task_id}">${esc(d.task_id)}</a><div>${esc(d.format)} Β· ${esc(d.tier)} Β· ${fmt(d.n_elements)} layers<br>${d.n_editors} of 14 editors${d.split === "eval" ? " Β· held out" : ""}</div></td> | |
| ${S.editors.map((e, i) => { const c = d.cells[e.config]; return `<td class="cell ${sep(e, i)}">${c ? `<a href="#/trace/${encodeURIComponent(c.trace_id)}" title="${esc(e.label)}: replay">${c.preview ? `<span class="plate"><img loading="lazy" src="/media/${c.preview}" alt=""></span>` : `<div class="empty">open</div>`}<span>${pct(c.reward)}</span></a>` : `<div class="empty">β</div>`}</td>`; }).join("")}</tr>`).join(""); | |
| const hint = complete === "yes" ? "Every row is one design recreated in all fourteen editors." : complete === "no" ? "Designs missing at least one editor." : "Every design, in however many editors it has a trajectory."; | |
| $("#main").innerHTML = ` | |
| <section class="intro"><h1 class="title sm">Designs</h1><p class="lede wide">${hint} Open a design for its trajectories, or a screen to replay that episode.</p></section> | |
| <div class="bar"><input id="q" placeholder="Search design, format or category" value="${esc(p.q||"")}" aria-label="Search"> | |
| <select id="complete" aria-label="Completeness"><option value="yes">Complete in 14 editors</option><option value="all">All designs</option><option value="no">Missing an editor</option></select> | |
| <select id="split" aria-label="Split"><option value="">Train and eval</option><option value="train">Train</option><option value="eval">Eval (held out)</option></select> | |
| <span class="count">${fmt(r.total)} designs</span></div> | |
| ${r.items.length ? `<div class="tscroll board"><table><thead>${grp}<tr><th>Target</th><th>Design</th>${head}</tr></thead><tbody>${body}</tbody></table></div>` : `<p class="note" style="padding:28px 0">No designs match these filters.</p>`} | |
| <div class="pager">${off > 0 ? `<button class="cta sm" id="prev">β Previous</button>` : ""}<span>${r.total ? off + 1 : 0}β${Math.min(off + 40, r.total)} of ${fmt(r.total)}</span>${off + 40 < r.total ? `<button class="cta sm" id="next">Next ${AR}</button>` : ""}</div>`; | |
| $("#complete").value = p.complete === "all" ? "all" : complete; $("#split").value = p.split || ""; | |
| const go = o => setParams("#/designs", {q:$("#q").value, complete:$("#complete").value === "yes" ? "" : $("#complete").value, split:$("#split").value, offset:o}); | |
| for (const id of ["complete","split"]) $("#"+id).onchange = () => go(0); | |
| let t; $("#q").oninput = () => { clearTimeout(t); t = setTimeout(() => go(0), 350); }; | |
| if (p.q) { const q = $("#q"); q.focus(); q.setSelectionRange(q.value.length, q.value.length); } | |
| if ($("#prev")) $("#prev").onclick = () => go(Math.max(0, off - 40)); | |
| if ($("#next")) $("#next").onclick = () => go(off + 40); | |
| } | |
| async function designView(id){ | |
| nav("d"); loading(); | |
| const [r, cellsR] = await Promise.all([api(`/api/design/${encodeURIComponent(id)}`), api(`/api/designs?q=${encodeURIComponent(id)}&limit=5`)]); | |
| const d = r.design, cells = (cellsR.items.find(x => x.task_id === id) || {cells: {}}).cells; | |
| const by = {}; for (const t of r.traces) (by[t.config] = by[t.config] || []).push(t); | |
| const rows = S.editors.filter(e => by[e.config]).map(e => by[e.config].map((t, i) => `<tr> | |
| <td>${i === 0 ? esc(label(e.config)) : ""}</td> <td class="n u">${pct(t.reward)}</td><td class="n u">${fmt(t.turns)}</td><td class="n">${t.preview ? `<a class="go-l" href="#/trace/${encodeURIComponent(t.trace_id)}">Replay β</a>` : `<span class="go-l i3">not in dataset</span>`}</td></tr>`).join("")).join(""); | |
| $("#main").innerHTML = `<div class="crumbs"><a href="#/designs">Designs</a> / ${esc(d.task_id)}</div> | |
| <section class="dhead"><div> | |
| <p class="meta"><span>Design</span><span>${esc(d.format)}</span><span>${d.split === "eval" ? "held out" : "train"}</span></p> | |
| <h1 class="title sm" style="word-break:break-word">${esc(d.task_id)}</h1> | |
| <div class="facts"><span>Category</span><span>${esc(d.category)}</span><span>Difficulty</span><span>${esc(d.tier)}</span> | |
| <span>Layers</span><span>${fmt(d.n_elements)}</span><span>Editors</span><span>${d.n_editors} of 14${d.complete14 ? " (complete)" : ""}</span><span>Split</span><span>${d.split === "eval" ? "eval (held out)" : "train"}</span></div> | |
| </div><div><span class="plate"><img src="/media/targets/${d.task_id}.webp" alt="target design"></span><p class="cap">Target</p></div></section> | |
| <section class="sect"><header class="ihead"><h2>Final screen in each editor</h2><span class="i2">open one to replay it</span></header><div style="padding-top:20px">${gallery(cells)}</div></section> | |
| <section class="sect"><header class="ihead"><h2>Trajectories</h2><span class="i2">one per editor</span></header> | |
| <div class="tscroll"><table><thead><tr><th>Editor</th><th class="n">Reward</th><th class="n">Turns</th><th></th></tr></thead><tbody>${rows}</tbody></table></div></section>`; | |
| } | |
| async function tracesView(){ | |
| nav("t"); | |
| const p = params(), off = +(p.offset || 0); | |
| const r = await api(`/api/traces?${new URLSearchParams({config:p.config||"",q:p.q||"",offset:off,limit:100})}`); | |
| const body = r.items.map(t => `<tr><td><a class="ul" href="#/trace/${encodeURIComponent(t.trace_id)}">${esc(t.task_id)}</a></td><td>${esc(label(t.config))}</td> | |
| <td class="n u">${pct(t.reward)}</td><td class="n u">${fmt(t.turns)}</td><td class="n"><a class="go-l" href="#/trace/${encodeURIComponent(t.trace_id)}">Replay β</a></td></tr>`).join(""); | |
| const opt = (xs, v) => xs.map(x => `<option value="${esc(x[0])}" ${x[0] === v ? "selected" : ""}>${esc(x[1])}</option>`).join(""); | |
| $("#main").innerHTML = ` | |
| <section class="intro"><h1 class="title sm">Traces</h1><p class="lede wide">Every trajectory in the training set. Open one to replay it.</p></section> | |
| <div class="bar"><input id="q" placeholder="Search trace or design id" value="${esc(p.q||"")}" aria-label="Search"> | |
| <select id="config" aria-label="Editor">${opt([["", "Every editor"], ...S.editors.map(e => [e.config, e.label])], p.config||"")}</select> | |
| <span class="count">${fmt(r.total)} traces</span></div> | |
| <div class="tscroll"><table><thead><tr><th>Design</th><th>Editor</th><th class="n">Reward</th><th class="n">Turns</th><th></th></tr></thead><tbody>${body || `<tr><td colspan="5" class="i2">No traces match these filters.</td></tr>`}</tbody></table></div> | |
| <div class="pager">${off > 0 ? `<button class="cta sm" id="prev">β Previous</button>` : ""}<span>${r.total ? off + 1 : 0}β${Math.min(off + 100, r.total)} of ${fmt(r.total)}</span>${off + 100 < r.total ? `<button class="cta sm" id="next">Next ${AR}</button>` : ""}</div>`; | |
| const go = o => setParams("#/traces", {q:$("#q").value, config:$("#config").value, offset:o}); | |
| for (const id of ["config"]) $("#"+id).onchange = () => go(0); | |
| let t; $("#q").oninput = () => { clearTimeout(t); t = setTimeout(() => go(0), 350); }; | |
| if (p.q) { const q = $("#q"); q.focus(); q.setSelectionRange(q.value.length, q.value.length); } | |
| if ($("#prev")) $("#prev").onclick = () => go(Math.max(0, off - 100)); | |
| if ($("#next")) $("#next").onclick = () => go(off + 100); | |
| } | |
| async function benchView(){ | |
| nav("b"); | |
| const b = await api("/api/bench"); | |
| const proto = s => s.protocol === "frontier" ? "4 screenshots, 60 min" : `${s.screenshots_in_context} screenshots, ${s.time_limit_min} min`; | |
| const ci = s => s.ci_low == null ? "" : `<span class="i3"> [${s.ci_low.toFixed(1)}, ${s.ci_high.toFixed(1)}]</span>`; | |
| const rows = [...b.scores].sort((x, y) => y.score - x.score).map(s => `<tr><td>${esc(s.model)}</td><td>${esc(s.effort)}</td><td>${esc(proto(s))}</td><td class="n u">${s.score.toFixed(1)}${ci(s)}</td></tr>`).join(""); | |
| const tiers = ["easy","medium","hard"].map(t => `<div class="kind"><span>${t}</span><span class="i3">${b.tasks.filter(x => x.tier === t).length}</span></div><div class="gal">${b.tasks.filter(x => x.tier === t).map(x => | |
| `<div class="gc"><span class="plate"><img loading="lazy" src="/bench-media/${esc(x.design_id)}.jpg" alt="${esc(x.format)}"></span><span class="lbl ui"><b>${esc(x.format)}</b><span>${fmt(x.n_elements)} layers</span></span></div>`).join("")}</div>`).join(""); | |
| $("#main").innerHTML = ` | |
| <section class="intro"><h1 class="title sm">DesignWorld-Bench</h1><p class="lede wide">30 held-out designs, each to be rebuilt in all 14 apps: 420 tasks. The agent works from screenshots alone, with mouse and keyboard, and a deterministic grader scores the app's saved file against the design's layers, out of 100. 8 apps are open (the 6 browser replicas, Inkscape and Penpot); the other 6 are hosted evaluation only.</p> | |
| <div class="ctas"><a class="cta" href="https://huggingface.co/datasets/perpetual-research/designworld-bench" target="_blank" rel="noopener">Get the benchmark ${AR}</a></div></section> | |
| <section class="sect"><header class="ihead"><h2>Scores</h2><span class="i2">mean over 420 tasks, 95% interval</span></header> | |
| <div class="tscroll"><table><thead><tr><th>Model</th><th>Effort</th><th>Protocol</th><th class="n">Score</th></tr></thead><tbody>${rows}</tbody></table></div></section> | |
| <section class="sect"><header class="ihead"><h2>The designs</h2><span class="i2">easy, medium and hard, by number of layers</span></header>${tiers}</section>`; | |
| } | |
| /* ---------------------------------------------------------------- the trace player */ | |
| // Each step plays on the screenshot it acted on: the cursor moves to the action, clicks ripple, drags draw their path, | |
| // keys show as keycaps and typing appears letter by letter; then the screen changes to what the action led to. | |
| const SPEEDS = [["0.5Γ", .5], ["1Γ", 1], ["2Γ", 2], ["4Γ", 4]]; | |
| const ICON = {play: `<svg viewBox="0 0 24 24" fill="currentColor"><path d="M7 4.5v15l13-7.5z"/></svg>`, pause: `<svg viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4.5" width="4" height="15"/><rect x="14" y="4.5" width="4" height="15"/></svg>`, | |
| prev: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="m15 18-6-6 6-6"/></svg>`, next: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="m9 18 6-6-6-6"/></svg>`}; | |
| const CURSOR = `<svg viewBox="0 0 16 24"><path d="M1.2 1.2v17.6l4.3-4.1 2.9 6.9 3.1-1.3-2.9-6.8h6.1z" fill="#12110f" stroke="#fff" stroke-width="1.3" stroke-linejoin="round"/></svg>`; | |
| const KEYN = {ctrl:"Ctrl", control:"Ctrl", shift:"Shift", alt:"Alt", cmd:"β", super:"Super", meta:"β", enter:"Enter β΅", return:"Enter β΅", kp_enter:"Enter β΅", escape:"Esc", esc:"Esc", tab:"Tab β₯", | |
| backspace:"β«", delete:"Del", space:"Space", up:"β", down:"β", left:"β", right:"β", pageup:"Page Up", page_up:"Page Up", pagedown:"Page Down", page_down:"Page Down", home:"Home", end:"End", plus:"+", minus:"β"}; | |
| const keyName = k => KEYN[k.toLowerCase()] || (k.length === 1 ? k.toUpperCase() : k); | |
| const combos = keys => String(keys ?? "").trim().split(/\s+/).filter(Boolean); | |
| const keycaps = keys => combos(keys).map(c => c.split("+").map(k => `<kbd>${esc(keyName(k))}</kbd>`).join("<i>+</i>")).join("<i>then</i>"); | |
| const quote = (t, n = 60) => "β" + (t.length > n ? t.slice(0, n) + "β¦" : t) + "β"; | |
| const argsOf = c => (c.args && typeof c.args === "object") ? c.args : {}; | |
| const ACT_IC = {left_click: "β", double_click: "β", triple_click: "β", right_click: "β", left_click_drag: "‑", mouse_move: "β", scroll: "β", key: "β¨", type: "β¨", view_reference: "β", submit: "β", wait: "β¦"}; | |
| function human(c){ | |
| const a = argsOf(c), p = a.coordinate, at = p ? ` at (${p[0]}, ${p[1]})` : "", mod = a.text ? a.text.split("+").map(keyName).join(" + ") + " + " : ""; | |
| switch (c.name) { | |
| case "left_click": return `${mod}Click${at}`; | |
| case "double_click": return `Double-click${at}`; | |
| case "triple_click": return `Triple-click${at}`; | |
| case "right_click": return `Right-click${at}`; | |
| case "left_click_drag": return `${mod}Drag from (${(a.start_coordinate || []).join(", ")}) to (${(p || []).join(", ")})`; | |
| case "mouse_move": return `Move the pointer to (${(p || []).join(", ")})`; | |
| case "scroll": return `Scroll ${a.scroll_direction || ""} Γ${a.scroll_amount ?? 1}${at}`; | |
| case "key": return `Press ${combos(a.keys).map(k => k.split("+").map(keyName).join(" + ")).join(", then ")}`; | |
| case "type": return `Type ${quote(String(a.text ?? ""))}`; | |
| case "view_reference": return "Look at the target again"; | |
| case "submit": return "Submit the design"; | |
| case "wait": return `Wait ${a.duration ?? ""} s`; | |
| default: return c.name; | |
| } | |
| } | |
| const actLine = c => `<div class="act"><span class="ic">${ACT_IC[c.name] || "Β·"}</span><b>${esc(human(c))}</b></div>`; | |
| function sig(c){ const a = c.args; const s = typeof a === "object" && a ? Object.entries(a).map(([k,v]) => `${k}=${JSON.stringify(v)}`).join(", ") : String(a ?? ""); return `<span class="fn">${esc(c.name)}</span>(${esc(s)})`; } | |
| function playerSteps(msgs){ | |
| const steps = []; let screen = null, target = null, sys = ""; | |
| for (const m of msgs) { | |
| if (m.role === "system") { sys = m.text; continue; } | |
| if (m.role === "user" && !steps.length) { target = m.images[0] ?? null; screen = m.images[m.images.length - 1] ?? null; steps.push({start: true, text: m.text, calls: [], on: screen, after: screen}); continue; } | |
| if (m.role === "assistant") { steps.push({text: m.text, calls: m.calls, on: screen, after: screen, results: []}); continue; } | |
| const last = steps[steps.length - 1]; | |
| if (m.images.length) { screen = m.images[m.images.length - 1]; if (last) last.after = screen; } | |
| if (last && m.role === "tool" && m.text) last.results.push(m.text); | |
| } | |
| return {steps, target, sys}; | |
| } | |
| let RUN = 0; // bumped to cancel whatever is animating (a new step, pause, leaving the page) | |
| class Cancelled {} | |
| async function traceView(id){ | |
| nav("t"); loading("Loading the episode"); | |
| const r = await api(`/api/trace/${encodeURIComponent(id)}`), c = r.catalog, m = r.meta; | |
| const W = (m.screen && m.screen.width) || 1280, H = (m.screen && m.screen.height) || 800, pixel = (m.coordinates || "pixels") === "pixels"; | |
| const {steps: S2, target, sys} = playerSteps(r.steps); | |
| const im = k => `/api/img/${encodeURIComponent(id)}/${k}`; | |
| $("#main").innerHTML = `<div class="crumbs"><a href="#/designs">Designs</a> / <a href="#/design/${c.task_id}">${esc(c.task_id)}</a> / ${esc(label(c.config))}</div> | |
| <section style="padding-top:clamp(16px,4vh,44px)"><p class="meta"><span>Episode</span></p> | |
| <h1 class="title sm">${esc(label(c.config))}</h1> | |
| <p class="meta" style="margin:16px 0 0"><span>reward <b>${pct(m.reward)}</b></span><span><b>${fmt(m.turns)}</b> turns</span><span><b>${fmt(m.actions)}</b> actions</span><span><b>${r.n_images}</b> screenshots</span></p></section> | |
| <div class="player"><div class="stage"> | |
| <div class="screens"><div><div class="screen"><img id="frame" alt="screen"><div class="fx"><svg id="fxsvg" viewBox="0 0 ${W} ${H}" preserveAspectRatio="none"></svg><div id="rips"></div><div class="cur" id="cur">${CURSOR}<span class="badge" id="badge"></span></div><div class="hud" id="hud"></div></div></div><p class="cap" id="fcap"></p></div> | |
| <div><div class="screen" id="tgt">${target != null ? `<img src="${im(target)}" alt="target">` : ""}</div><p class="cap">Target</p></div></div> | |
| <div class="ctl"><button class="ib play" id="play" title="Play / pause (space)" aria-label="Play or pause">${ICON.play}</button><button class="ib" id="prev" title="Previous (β)" aria-label="Previous step">${ICON.prev}</button><button class="ib" id="next" title="Next (β)" aria-label="Next step">${ICON.next}</button> | |
| <input type="range" id="rng" min="0" max="${S2.length - 1}" value="0" aria-label="Step"> | |
| <select id="spd" aria-label="Speed">${SPEEDS.map(([l], i) => `<option value="${i}" ${i === 1 ? "selected" : ""}>${l}</option>`).join("")}</select> | |
| <span class="ui i2" id="pos"></span></div> | |
| <div class="now" id="now"></div> | |
| <details><summary>System prompt</summary><pre class="sys">${esc(sys)}</pre></details> | |
| </div> | |
| <div class="steps" id="steps">${S2.map((s, k) => `<div class="st" data-k="${k}"><span class="no">${two(k)}</span>${s.start ? `<span class="i2">The editor as the episode starts</span>` : ""} | |
| ${s.text && !s.start ? `<span class="th">${esc(s.text.length > 200 ? s.text.slice(0, 200) + "β¦" : s.text)}</span>` : ""}${s.calls.map(actLine).join("")}</div>`).join("")}</div></div>`; | |
| const frame = $("#frame"), cur = $("#cur"), badge = $("#badge"), hud = $("#hud"), rips = $("#rips"), fxsvg = $("#fxsvg"); | |
| const reduced = matchMedia("(prefers-reduced-motion: reduce)").matches; | |
| const speed = () => SPEEDS[+$("#spd").value][1]; | |
| let at = 0, pos = null; // the step shown, and where the cursor is (screen pixels) | |
| const xy = p => [p[0] / W * 100 + "%", p[1] / H * 100 + "%"]; | |
| const hasPoint = c => pixel && Array.isArray(argsOf(c).coordinate); | |
| const warm = k => { for (let j = k; j < Math.min(S2.length, k + 6); j++) for (const f of [S2[j].on, S2[j].after]) if (f != null) { const i = new Image(); i.src = im(f); } }; | |
| const wait = (ms, tok) => new Promise((res, rej) => setTimeout(() => tok === RUN ? res() : rej(new Cancelled()), ms / speed())); | |
| const check = tok => { if (tok !== RUN) throw new Cancelled(); }; | |
| async function setFrame(k){ if (k == null || frame.dataset.k === String(k)) return; const i = new Image(); i.src = im(k); try { await i.decode(); } catch {} frame.src = i.src; frame.dataset.k = k; } | |
| // where the pointer is before step k: the last point any earlier action used | |
| function pointBefore(k){ for (let j = k - 1; j > 0; j--) { const cs = S2[j].calls.filter(hasPoint); if (cs.length) return argsOf(cs[cs.length - 1]).coordinate; } return null; } | |
| function moveTo(p, ms){ | |
| const [x, y] = xy(p); | |
| if (ms && pos && cur.classList.contains("on")) cur.animate([{left: cur.style.left, top: cur.style.top}, {left: x, top: y}], {duration: ms / speed(), easing: "cubic-bezier(.45,.05,.25,1)"}); | |
| cur.style.left = x; cur.style.top = y; cur.classList.add("on"); pos = p; | |
| } | |
| function ring(p, delay, still){ | |
| const el = document.createElement("div"); el.className = "ring" + (still ? " static" : ""); [el.style.left, el.style.top] = xy(p); rips.append(el); | |
| if (!still) el.animate([{transform: "scale(.3)", opacity: 1}, {transform: "scale(1.7)", opacity: 0}], {duration: 520 / speed(), delay: (delay || 0) / speed(), easing: "cubic-bezier(.2,.7,.3,1)", fill: "both"}).onfinish = () => el.remove(); | |
| } | |
| function path(a, b, ms){ | |
| const line = document.createElementNS("http://www.w3.org/2000/svg", "line"); | |
| line.setAttribute("x1", a[0]); line.setAttribute("y1", a[1]); line.setAttribute("x2", b[0]); line.setAttribute("y2", b[1]); | |
| line.setAttribute("stroke", "#d9431c"); line.setAttribute("stroke-width", W / 400); line.setAttribute("stroke-linecap", "round"); line.setAttribute("opacity", ".85"); | |
| const len = Math.hypot(b[0] - a[0], b[1] - a[1]); line.setAttribute("stroke-dasharray", len); | |
| fxsvg.append(line); | |
| if (ms) line.animate([{strokeDashoffset: len}, {strokeDashoffset: 0}], {duration: ms / speed(), easing: "cubic-bezier(.45,.05,.25,1)", fill: "both"}); | |
| const dot = document.createElementNS("http://www.w3.org/2000/svg", "circle"); dot.setAttribute("cx", a[0]); dot.setAttribute("cy", a[1]); dot.setAttribute("r", W / 230); dot.setAttribute("fill", "#d9431c"); fxsvg.append(dot); | |
| } | |
| const showHud = html => { hud.innerHTML = html; hud.classList.add("on"); }; | |
| const setBadge = t => { badge.textContent = t || ""; badge.classList.toggle("on", !!t); }; | |
| function clearFx(){ rips.innerHTML = ""; fxsvg.innerHTML = ""; hud.classList.remove("on"); setBadge(""); cur.classList.remove("down"); $("#tgt").classList.remove("look"); } | |
| const press = async (tok, n) => { for (let i = 0; i < n; i++) { cur.classList.add("down"); await wait(90, tok); cur.classList.remove("down"); if (i < n - 1) await wait(60, tok); } }; | |
| // one action; live = animate it, otherwise draw it as it stands at the moment of acting | |
| async function act(cl, tok, live){ | |
| const a = argsOf(cl), p = a.coordinate, n = cl.name; | |
| const mod = a.text && n !== "type" ? a.text : ""; | |
| if (n === "left_click_drag" && pixel && p && a.start_coordinate) { | |
| if (!live) { moveTo(p); path(a.start_coordinate, p); ring(p, 0, true); setBadge("drag"); if (mod) showHud(`${keycaps(mod)}<i>+ drag</i>`); return; } | |
| moveTo(a.start_coordinate, 520); await wait(560, tok); | |
| if (mod) showHud(`${keycaps(mod)}<i>+ drag</i>`); | |
| cur.classList.add("down"); setBadge("drag"); await wait(120, tok); | |
| path(a.start_coordinate, p, 760); moveTo(p, 760); await wait(800, tok); | |
| cur.classList.remove("down"); ring(p); await wait(250, tok); return; | |
| } | |
| if (hasPoint(cl)) { | |
| const clicks = {left_click: 1, double_click: 2, triple_click: 3, right_click: 1}[n] || 0; | |
| const tag = {double_click: "Γ2", triple_click: "Γ3", right_click: "right-click"}[n] || ""; | |
| if (!live) { moveTo(p); if (clicks) ring(p, 0, true); setBadge(n === "scroll" ? `scroll ${a.scroll_direction}` : tag); | |
| if (mod) showHud(`${keycaps(mod)}<i>+ click</i>`); if (n === "scroll") showHud(scrollHud(a)); return; } | |
| moveTo(p, 560); await wait(600, tok); | |
| if (mod) showHud(`${keycaps(mod)}<i>+ click</i>`); | |
| if (clicks) { setBadge(tag); for (let i = 0; i < clicks; i++) ring(p, i * 150); await press(tok, clicks); await wait(320, tok); } | |
| if (n === "scroll") { setBadge(`scroll ${a.scroll_direction}`); showHud(scrollHud(a)); await wait(700, tok); } | |
| return; | |
| } | |
| if (n === "key") { showHud(`<span class="lab">Keys</span>${keycaps(a.keys)}`); | |
| if (live) { hud.querySelectorAll("kbd").forEach((k, i) => k.animate([{transform: "translateY(2px)", borderBottomWidth: "0px"}, {transform: "none"}], {duration: 180 / speed(), delay: i * 70 / speed(), fill: "both"})); await wait(850, tok); } return; } | |
| if (n === "type") { const t = String(a.text ?? ""), shown = t.length > 80 ? t.slice(0, 80) + "β¦" : t; | |
| showHud(`<span class="lab">Type</span><span class="typed"></span><span class="caret"></span>`); const out = hud.querySelector(".typed"); | |
| if (!live) { out.textContent = shown; return; } | |
| const per = Math.max(18, Math.min(70, 1300 / Math.max(1, shown.length))); | |
| for (let i = 1; i <= shown.length; i++) { out.textContent = shown.slice(0, i); await wait(per, tok); } | |
| await wait(450, tok); return; } | |
| if (n === "view_reference") { showHud(`<span class="lab">Looks at</span>the target`); $("#tgt").classList.add("look"); if (live) { await wait(900, tok); $("#tgt").classList.remove("look"); } return; } | |
| if (n === "submit") { showHud(`<span class="lab">Submit</span>β the design is done`); if (live) await wait(900, tok); return; } | |
| if (n === "wait") { showHud(`<span class="lab">Wait</span>${esc(a.duration ?? "")} s`); if (live) await wait(600, tok); return; } | |
| if (live) await wait(300, tok); | |
| } | |
| const scrollHud = a => `<span class="lab">Scroll</span><kbd>${({up: "β", down: "β", left: "β", right: "β"})[a.scroll_direction] || "β"}</kbd><i>Γ${a.scroll_amount ?? 1}</i>`; | |
| function panels(k, phase){ | |
| const s = S2[k]; | |
| $("#rng").value = k; $("#pos").textContent = `${k} / ${S2.length - 1}`; | |
| $("#fcap").textContent = s.start ? "The editor as the episode starts" : phase === "after" ? `After step ${k}` : `Step ${k}: ${s.calls.length ? s.calls.map(human).join(", then ") : "no action"}`; | |
| $("#now").innerHTML = (s.text ? `<div class="th">${esc(s.text)}</div>` : `<span class="i2">${s.start ? "Start" : "(no text)"}</span>`) + | |
| s.calls.map(x => actLine(x) + `<div class="call">${sig(x)}</div>`).join("") + | |
| (s.results || []).filter(t => t && !/^(clicked|typed|pressed|moved|scrolled|dragged|triple-clicked|double-clicked|right-clicked)/.test(t)).map(t => `<div class="res">β ${esc(t.slice(0, 400))}</div>`).join(""); | |
| } | |
| function mark(k, scroll){ | |
| document.querySelectorAll(".st.on").forEach(e => e.classList.remove("on")); | |
| const el = $(`.st[data-k="${k}"]`); el.classList.add("on"); | |
| if (scroll) { const box = $("#steps"), top = el.offsetTop; if (top < box.scrollTop || top + el.offsetHeight > box.scrollTop + box.clientHeight) box.scrollTop = top - box.clientHeight / 3; } | |
| } | |
| // show step k: still = the moment of acting, drawn; live = play the actions, then the screen they led to | |
| async function go(k, live, scroll = true){ | |
| const tok = RUN; at = Math.max(0, Math.min(S2.length - 1, k)); | |
| const s = S2[at]; mark(at, scroll); warm(at + 1); clearFx(); | |
| const p0 = pointBefore(at); if (p0) moveTo(p0); else { cur.classList.remove("on"); pos = null; } | |
| if (s.start || !s.calls.length) { panels(at, "after"); await setFrame(s.after); return; } | |
| panels(at, "on"); await setFrame(s.on); check(tok); | |
| if (!live || reduced) { for (const cl of s.calls) await act(cl, tok, false); return; } | |
| for (const cl of s.calls) { await act(cl, tok, true); await wait(140, tok); if (cl !== s.calls[s.calls.length - 1]) { hud.classList.remove("on"); setBadge(""); } } | |
| await wait(250, tok); | |
| await setFrame(s.after); check(tok); | |
| hud.classList.remove("on"); setBadge(""); rips.innerHTML = ""; fxsvg.innerHTML = ""; $("#tgt").classList.remove("look"); | |
| panels(at, "after"); | |
| } | |
| const run = async (k, live, scroll) => { try { await go(k, live, scroll); return true; } catch (e) { if (e instanceof Cancelled) return false; throw e; } }; | |
| function stop(){ RUN++; PLAY = null; const b = $("#play"); if (b) b.innerHTML = ICON.play; } | |
| async function play(){ | |
| if (PLAY) return stop(); | |
| RUN++; PLAY = 1; $("#play").innerHTML = ICON.pause; | |
| if (at >= S2.length - 1) at = 0; | |
| while (PLAY && at < S2.length - 1) { const tok = RUN; if (!await run(at + 1, true, true)) return; try { await wait(380, tok); } catch { return; } } | |
| if (PLAY) stop(); | |
| } | |
| const jump = (k, live, scroll) => { stop(); run(k, live, scroll); }; | |
| $("#play").onclick = play; | |
| $("#rng").oninput = e => jump(+e.target.value, false, true); | |
| $("#prev").onclick = () => jump(at - 1, false, true); $("#next").onclick = () => jump(at + 1, true, true); | |
| $("#steps").onclick = e => { const el = e.target.closest(".st"); if (el) jump(+el.dataset.k, true, false); }; | |
| document.onkeydown = e => { if (!location.hash.startsWith("#/trace/") || ["INPUT","SELECT"].includes(e.target.tagName)) return; | |
| if (e.key === " ") { play(); e.preventDefault(); } | |
| if (e.key === "ArrowRight") { jump(at + 1, true, true); e.preventDefault(); } | |
| if (e.key === "ArrowLeft") { jump(at - 1, false, true); e.preventDefault(); } }; | |
| run(0, false, false); | |
| } | |
| let LAST = ""; | |
| async function route(){ | |
| RUN++; PLAY = null; | |
| if (!S) S = await api("/api/summary"); | |
| const h = location.hash.slice(1).split("?")[0] || "/", same = h === LAST; LAST = h; | |
| try { | |
| if (h === "/") await overview(); | |
| else if (h === "/designs") await designsView(); | |
| else if (h === "/traces") await tracesView(); | |
| else if (h === "/bench") await benchView(); | |
| else if (h.startsWith("/design/")) await designView(decodeURIComponent(h.slice(8))); | |
| else if (h.startsWith("/trace/")) await traceView(decodeURIComponent(h.slice(7))); | |
| if (!same) window.scrollTo(0, 0); | |
| } catch (e) { $("#main").innerHTML = `<p class="note bad" style="padding:60px 0">${esc(e.message)}</p>`; } | |
| } | |
| // a preview that is not there: leave its plate empty rather than show a broken image | |
| addEventListener("error", e => { const i = e.target; if (i.tagName === "IMG" && i.closest(".plate")) { i.closest(".plate").classList.add("miss"); i.remove(); } }, true); | |
| addEventListener("hashchange", route); route(); | |
| </script> | |
| </body> | |
| </html> | |