easel-canvas 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -24
- package/bin/mcp.mjs +10 -7
- package/examples/demo/CLAUDE.md +8 -0
- package/examples/demo/assets/fonts/OFL-Anton.txt +93 -0
- package/examples/demo/assets/fonts/OFL-JetBrainsMono.txt +93 -0
- package/examples/demo/assets/fonts/anton-latin-400.woff2 +0 -0
- package/examples/demo/assets/fonts/jetbrains-mono-latin-400.woff2 +0 -0
- package/examples/demo/assets/ticket-qr.svg +5 -0
- package/examples/demo/board.json +47 -20
- package/examples/demo/comments.json +27 -7
- package/examples/demo/screens/brand.html +155 -0
- package/examples/demo/screens/clash.html +94 -0
- package/examples/demo/screens/empty-day.html +114 -0
- package/examples/demo/screens/film.html +98 -0
- package/examples/demo/screens/home-daylight.html +144 -0
- package/examples/demo/screens/home.html +132 -38
- package/examples/demo/screens/poster.html +77 -0
- package/examples/demo/screens/programme.html +125 -0
- package/examples/demo/screens/site.html +118 -0
- package/examples/demo/screens/square.html +71 -0
- package/examples/demo/screens/ticket.html +107 -0
- package/examples/demo/screens/timetable.html +192 -0
- package/examples/demo/tokens.json +54 -22
- package/package.json +3 -2
- package/server/args.mjs +3 -2
- package/server/chat.mjs +26 -16
- package/server/html.mjs +1 -1
- package/examples/demo/screens/empty.html +0 -43
- package/examples/demo/screens/habit.html +0 -55
- package/examples/demo/screens/landing.html +0 -44
- package/examples/demo/screens/new-habit.html +0 -47
- package/examples/demo/screens/settings.html +0 -43
- package/examples/demo/screens/stats.html +0 -50
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="board-size" content="390x844">
|
|
7
|
+
<title>Ticket</title>
|
|
8
|
+
<style>
|
|
9
|
+
/* ===== Intercut base: the same block opens every board ===== */
|
|
10
|
+
@font-face{font-family:"Anton";src:url("../assets/fonts/anton-latin-400.woff2") format("woff2");font-display:block}
|
|
11
|
+
@font-face{font-family:"JetBrains Mono";src:url("../assets/fonts/jetbrains-mono-latin-400.woff2") format("woff2");font-display:block}
|
|
12
|
+
:root{
|
|
13
|
+
/* colour tokens: tokens.json, theme Night */
|
|
14
|
+
--field:#0A0A0A; --ink:#FFFFFF; --muted:#9C9C9C; --rule:#333333; --safelight:#FF3D14; --on-safelight:#0A0A0A; --signal:#FF3D14;
|
|
15
|
+
/* faces: swap them here, then retune the two numbers below */
|
|
16
|
+
--display:"Anton","HelveticaNeue-CondensedBlack",Impact,sans-serif;
|
|
17
|
+
--mono:"JetBrains Mono",Menlo,monospace;
|
|
18
|
+
--cap:.86; /* cap height ÷ font size: a display line box is exactly its caps */
|
|
19
|
+
--cap-nudge:.0065em; /* moves the caps down onto the box, so cap top = box top */
|
|
20
|
+
}
|
|
21
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
22
|
+
html,body{background:var(--field);color:var(--ink)}
|
|
23
|
+
body{font-family:var(--mono);font-size:16px;line-height:24px;-webkit-font-smoothing:antialiased}
|
|
24
|
+
a{color:inherit;text-decoration:none}
|
|
25
|
+
/* display: Anton caps in a box exactly cap-high, so stacked lines butt and the waist sits at 50% */
|
|
26
|
+
.display{display:block;font-family:var(--display);font-weight:400;text-transform:uppercase;line-height:var(--cap);translate:0 var(--cap-nudge);white-space:nowrap}
|
|
27
|
+
/* small print: JetBrains Mono caps */
|
|
28
|
+
.mono{font-family:var(--mono);font-size:12px;line-height:16px;letter-spacing:.04em;text-transform:uppercase}
|
|
29
|
+
/* the splice: one live text node cut at the cap waist by an SVG filter (the filters sit in .defs at the end of body) */
|
|
30
|
+
.splice{filter:url(#splice)}
|
|
31
|
+
.cut-red{color:var(--safelight)} /* the wordmark under 56px: the cut becomes colour */
|
|
32
|
+
.slit{flood-color:var(--safelight)}
|
|
33
|
+
.defs{position:absolute;width:0;height:0;overflow:hidden}
|
|
34
|
+
/* ===== end of base ===== */
|
|
35
|
+
/* ===== Ticket: the queue screen. Safelight field, title edge to edge, a QR you can scan ===== */
|
|
36
|
+
body{background:var(--safelight);color:var(--on-safelight)}
|
|
37
|
+
.screen{width:390px;height:844px;position:relative;overflow:clip;background:var(--safelight);color:var(--on-safelight)}
|
|
38
|
+
.status{height:44px;display:flex;justify-content:space-between;align-items:center;padding:0 24px}
|
|
39
|
+
.status .time{font-family:var(--display);font-size:20px;line-height:20px}
|
|
40
|
+
.film-nav{height:48px;display:flex;border-bottom:1px solid var(--on-safelight)}
|
|
41
|
+
.film-nav a{display:flex;align-items:center;padding:0 16px;border-left:1px solid var(--on-safelight)}
|
|
42
|
+
.film-nav .back{margin-right:auto;border-left:0}
|
|
43
|
+
.ticket-title{padding:16px 0 24px}
|
|
44
|
+
.ticket-title .mono{display:block;padding:0 16px 16px}
|
|
45
|
+
.ticket-title .display{font-size:120px;padding-left:12px}
|
|
46
|
+
.ticket-title .display + .display{margin-top:8px}
|
|
47
|
+
/* the QR: ../assets/ticket-qr.svg, real modules, 8px a module with a four-module quiet zone; reuse it with the same <img> */
|
|
48
|
+
.qr-panel{display:grid;grid-template-columns:264px 1fr;gap:16px;padding:0 16px}
|
|
49
|
+
.qr{display:block;width:264px;height:264px}
|
|
50
|
+
.qr-side{display:flex;flex-direction:column;justify-content:space-between;border-left:1px solid var(--on-safelight);padding-left:12px}
|
|
51
|
+
.qr-side .display{font-size:28px}
|
|
52
|
+
.qr-side .mono{display:block}
|
|
53
|
+
.scan{position:absolute;left:16px;right:16px;bottom:136px;display:flex;justify-content:space-between}
|
|
54
|
+
.stub{position:absolute;left:0;right:0;bottom:0;height:120px;display:grid;grid-template-columns:repeat(3,1fr);border-top:1px dashed var(--on-safelight)}
|
|
55
|
+
.stub div{padding:16px 0 0 16px;border-right:1px solid var(--on-safelight)}
|
|
56
|
+
.stub div:last-child{border-right:0}
|
|
57
|
+
.stub .mono{display:block}
|
|
58
|
+
.stub .display{font-size:56px;margin-top:16px}
|
|
59
|
+
.slit-ink{flood-color:var(--ink)}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<main class="screen">
|
|
64
|
+
<div class="status"><span class="time">19:12</span><span class="mono">5G · 79%</span></div>
|
|
65
|
+
|
|
66
|
+
<nav class="film-nav mono" aria-label="Ticket">
|
|
67
|
+
<a class="back" href="home.html">← My cut</a>
|
|
68
|
+
<a href="film.html">Film</a>
|
|
69
|
+
<a href="ticket.html">Wallet</a>
|
|
70
|
+
</nav>
|
|
71
|
+
|
|
72
|
+
<header class="ticket-title">
|
|
73
|
+
<span class="mono">Admit one · Sat 06.03 · 19:30</span>
|
|
74
|
+
<h1 class="display">Salt</h1>
|
|
75
|
+
<span class="display splice">Winter</span>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<section class="qr-panel" aria-label="Ticket code">
|
|
79
|
+
<img class="qr" src="../assets/ticket-qr.svg" alt="Ticket code 14-0603-C1-F12">
|
|
80
|
+
<div class="qr-side">
|
|
81
|
+
<span><span class="mono">Cinema</span><span class="display">C1</span><span class="mono">Meridian</span></span>
|
|
82
|
+
<span><span class="mono">Screen</span><span class="display">1</span><span class="mono">Stalls</span></span>
|
|
83
|
+
<span><span class="mono">No.</span><span class="mono">14-0603</span><span class="mono">-C1-F12</span></span>
|
|
84
|
+
</div>
|
|
85
|
+
</section>
|
|
86
|
+
|
|
87
|
+
<p class="scan mono"><span>Scan at the door</span><span>Screen up, brightness up</span></p>
|
|
88
|
+
|
|
89
|
+
<footer class="stub">
|
|
90
|
+
<div><span class="mono">Seat</span><span class="display">F12</span></div>
|
|
91
|
+
<div><span class="mono">Doors</span><span class="display">19:10</span></div>
|
|
92
|
+
<div><span class="mono">Run</span><span class="display">112′</span></div>
|
|
93
|
+
</footer>
|
|
94
|
+
</main>
|
|
95
|
+
|
|
96
|
+
<svg class="defs" aria-hidden="true" focusable="false">
|
|
97
|
+
<!-- The splice: one text node, cut at the cap waist. Fractions of the filter box; Anton's cap waist sits at 50% of it in every
|
|
98
|
+
engine, so only the slit's two y numbers retune with the face. dx = shift ÷ element width; change dx if the width changes. -->
|
|
99
|
+
<filter id="splice" x="-.2" y="-.05" width="1.6" height="1.1" primitiveUnits="objectBoundingBox" color-interpolation-filters="sRGB">
|
|
100
|
+
<feOffset in="SourceGraphic" dx="0" x="-.2" y="-.05" width="1.6" height=".5258" result="upper"/>
|
|
101
|
+
<feFlood class="slit-ink" x="0" y=".4758" width="1" height=".0398" result="slit"/>
|
|
102
|
+
<feOffset in="SourceGraphic" dx=".1231" x="-.2" y=".5156" width="1.6" height=".5344" result="lower"/>
|
|
103
|
+
<feMerge><feMergeNode in="upper"/><feMergeNode in="slit"/><feMergeNode in="lower"/></feMerge>
|
|
104
|
+
</filter>
|
|
105
|
+
</svg>
|
|
106
|
+
</body>
|
|
107
|
+
</html>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="board-size" content="1440x900">
|
|
7
|
+
<title>Desktop: timetable</title>
|
|
8
|
+
<style>
|
|
9
|
+
/* ===== Intercut base: the same block opens every board ===== */
|
|
10
|
+
@font-face{font-family:"Anton";src:url("../assets/fonts/anton-latin-400.woff2") format("woff2");font-display:block}
|
|
11
|
+
@font-face{font-family:"JetBrains Mono";src:url("../assets/fonts/jetbrains-mono-latin-400.woff2") format("woff2");font-display:block}
|
|
12
|
+
:root{
|
|
13
|
+
/* colour tokens: tokens.json, theme Night */
|
|
14
|
+
--field:#0A0A0A; --ink:#FFFFFF; --muted:#9C9C9C; --rule:#333333; --safelight:#FF3D14; --on-safelight:#0A0A0A; --signal:#FF3D14;
|
|
15
|
+
/* faces: swap them here, then retune the two numbers below */
|
|
16
|
+
--display:"Anton","HelveticaNeue-CondensedBlack",Impact,sans-serif;
|
|
17
|
+
--mono:"JetBrains Mono",Menlo,monospace;
|
|
18
|
+
--cap:.86; /* cap height ÷ font size: a display line box is exactly its caps */
|
|
19
|
+
--cap-nudge:.0065em; /* moves the caps down onto the box, so cap top = box top */
|
|
20
|
+
}
|
|
21
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
22
|
+
html,body{background:var(--field);color:var(--ink)}
|
|
23
|
+
body{font-family:var(--mono);font-size:16px;line-height:24px;-webkit-font-smoothing:antialiased}
|
|
24
|
+
a{color:inherit;text-decoration:none}
|
|
25
|
+
/* display: Anton caps in a box exactly cap-high, so stacked lines butt and the waist sits at 50% */
|
|
26
|
+
.display{display:block;font-family:var(--display);font-weight:400;text-transform:uppercase;line-height:var(--cap);translate:0 var(--cap-nudge);white-space:nowrap}
|
|
27
|
+
/* small print: JetBrains Mono caps */
|
|
28
|
+
.mono{font-family:var(--mono);font-size:12px;line-height:16px;letter-spacing:.04em;text-transform:uppercase}
|
|
29
|
+
/* the splice: one live text node cut at the cap waist by an SVG filter (the filters sit in .defs at the end of body) */
|
|
30
|
+
.splice{filter:url(#splice)}
|
|
31
|
+
.cut-red{color:var(--safelight)} /* the wordmark under 56px: the cut becomes colour */
|
|
32
|
+
.slit{flood-color:var(--safelight)}
|
|
33
|
+
.defs{position:absolute;width:0;height:0;overflow:hidden}
|
|
34
|
+
/* ===== end of base ===== */
|
|
35
|
+
/* ===== Desktop: the day as a timetable. 240px for the cinemas, then 80px an hour from 10:00 to 01:00 ===== */
|
|
36
|
+
.page{width:1440px;height:900px;position:relative;overflow:clip}
|
|
37
|
+
.site-nav{height:72px;display:flex;align-items:center;border-bottom:1px solid var(--rule)}
|
|
38
|
+
.wordmark{display:flex;width:240px;padding-left:24px}
|
|
39
|
+
.wordmark .display{font-size:40px}
|
|
40
|
+
.site-nav .links{display:flex;height:72px}
|
|
41
|
+
.site-nav .links a{display:flex;align-items:center;padding:0 24px;color:var(--muted)}
|
|
42
|
+
.site-nav .links a.on{color:var(--ink);box-shadow:inset 0 -4px 0 var(--safelight)}
|
|
43
|
+
.site-nav .app{margin-left:auto;height:72px;display:flex;align-items:center;padding:0 24px;border-left:1px solid var(--rule)}
|
|
44
|
+
.day-head{height:184px;display:grid;grid-template-columns:240px 1fr;border-bottom:1px solid var(--rule)}
|
|
45
|
+
.day-head .summary{padding:24px 0 0 24px;color:var(--muted);display:flex;flex-direction:column;gap:8px}
|
|
46
|
+
.day-head .summary b{font-weight:400;color:var(--ink)}
|
|
47
|
+
.day-title{display:flex;align-items:flex-end;justify-content:space-between;padding:0 24px 24px 0}
|
|
48
|
+
.day-title .display{font-size:160px}
|
|
49
|
+
.days{display:grid;grid-template-columns:repeat(11,48px);height:64px;align-self:flex-end;border-left:1px solid var(--rule)}
|
|
50
|
+
.day-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;border-right:1px solid var(--rule);border-top:1px solid var(--rule)}
|
|
51
|
+
.day-cell .display{font-size:28px}
|
|
52
|
+
.day-cell .mono{color:var(--muted)}
|
|
53
|
+
.day-cell.past{color:var(--muted)}
|
|
54
|
+
.day-cell.today{background:var(--safelight);color:var(--on-safelight);border-color:var(--safelight)}
|
|
55
|
+
.day-cell.today .mono{color:var(--on-safelight)}
|
|
56
|
+
/* the grid: hour rules every 80px drawn behind the rows */
|
|
57
|
+
.grid{position:relative;height:612px}
|
|
58
|
+
.grid::before{content:"";position:absolute;left:240px;top:0;right:0;bottom:0;background:repeating-linear-gradient(90deg,var(--rule) 0 1px,transparent 1px 80px)}
|
|
59
|
+
.ruler{position:relative;height:36px;border-bottom:1px solid var(--rule)}
|
|
60
|
+
.ruler .mono{position:absolute;top:12px;left:calc(240px + var(--h) * 80px);padding-left:8px;color:var(--muted)}
|
|
61
|
+
.cinema-row{position:relative;height:96px;border-bottom:1px solid var(--rule)}
|
|
62
|
+
.cinema-label{position:absolute;left:0;top:0;width:240px;height:95px;display:flex;align-items:center;gap:16px;padding-left:24px;border-right:1px solid var(--rule);background:var(--field)}
|
|
63
|
+
.cinema-label .display{font-size:56px}
|
|
64
|
+
.cinema-label .mono{color:var(--muted)}
|
|
65
|
+
.screening{position:absolute;top:12px;height:72px;left:calc(240px + var(--at) * 80px / 60);width:calc(var(--run) * 80px / 60);display:flex;flex-direction:column;justify-content:space-between;padding:8px;border:1px solid var(--ink);background:var(--field);overflow:hidden;z-index:2}
|
|
66
|
+
.screening .display{font-size:20px;white-space:normal;line-height:1}
|
|
67
|
+
.screening .mono{color:var(--muted);white-space:nowrap}
|
|
68
|
+
.screening.cut{background:var(--safelight);color:var(--on-safelight);border-color:var(--safelight)}
|
|
69
|
+
.screening.cut .mono{color:var(--on-safelight)}
|
|
70
|
+
.screening.seen{background:var(--field);color:var(--muted);border-color:var(--rule)}
|
|
71
|
+
.screening.seen .display{text-decoration:line-through;text-decoration-thickness:2px}
|
|
72
|
+
.screening.seen .mono{color:var(--muted)}
|
|
73
|
+
.now{position:absolute;z-index:1;top:0;bottom:-32px;left:calc(240px + var(--at) * 80px / 60);width:2px}
|
|
74
|
+
.now::before{content:"";position:absolute;inset:0;background:var(--safelight)}
|
|
75
|
+
.now .mono{position:absolute;bottom:8px;left:8px;color:var(--signal);white-space:nowrap}
|
|
76
|
+
.legend{position:absolute;left:0;right:0;bottom:0;height:32px;display:flex;align-items:center;gap:32px;padding-left:24px;color:var(--muted);border-top:1px solid var(--rule);background:var(--field)}
|
|
77
|
+
.legend .key{display:inline-block;width:12px;height:12px;margin-right:8px;translate:0 1px;border:1px solid var(--ink)}
|
|
78
|
+
.legend .key.cut{background:var(--safelight);border-color:var(--safelight)}
|
|
79
|
+
</style>
|
|
80
|
+
</head>
|
|
81
|
+
<body>
|
|
82
|
+
<main class="page">
|
|
83
|
+
<nav class="site-nav mono" aria-label="Site">
|
|
84
|
+
<a class="wordmark" href="site.html" aria-label="Intercut"><span class="display">Inter</span><span class="display cut-red">Cut</span></a>
|
|
85
|
+
<span class="links">
|
|
86
|
+
<a class="on" href="timetable.html">Programme</a>
|
|
87
|
+
<a href="timetable.html">Cinemas</a>
|
|
88
|
+
<a href="site.html">Passes</a>
|
|
89
|
+
<a href="home.html">My cut</a>
|
|
90
|
+
</span>
|
|
91
|
+
<a class="app" href="home.html">Get the app</a>
|
|
92
|
+
</nav>
|
|
93
|
+
|
|
94
|
+
<header class="day-head">
|
|
95
|
+
<p class="summary mono"><span>Programme</span><span><b>30</b> screenings</span><span><b>6</b> cinemas</span><span>Your cut <b>4</b> · 6 h 35</span></p>
|
|
96
|
+
<div class="day-title">
|
|
97
|
+
<h1 class="display">Sat 06.03</h1>
|
|
98
|
+
<nav class="days" aria-label="Festival days">
|
|
99
|
+
<a class="day-cell past" href="timetable.html"><span class="display">04</span><span class="mono">Th</span></a>
|
|
100
|
+
<a class="day-cell past" href="timetable.html"><span class="display">05</span><span class="mono">Fr</span></a>
|
|
101
|
+
<a class="day-cell today" href="timetable.html"><span class="display">06</span><span class="mono">Sa</span></a>
|
|
102
|
+
<a class="day-cell" href="timetable.html"><span class="display">07</span><span class="mono">Su</span></a>
|
|
103
|
+
<a class="day-cell" href="timetable.html"><span class="display">08</span><span class="mono">Mo</span></a>
|
|
104
|
+
<a class="day-cell" href="timetable.html"><span class="display">09</span><span class="mono">Tu</span></a>
|
|
105
|
+
<a class="day-cell" href="timetable.html"><span class="display">10</span><span class="mono">We</span></a>
|
|
106
|
+
<a class="day-cell" href="timetable.html"><span class="display">11</span><span class="mono">Th</span></a>
|
|
107
|
+
<a class="day-cell" href="timetable.html"><span class="display">12</span><span class="mono">Fr</span></a>
|
|
108
|
+
<a class="day-cell" href="timetable.html"><span class="display">13</span><span class="mono">Sa</span></a>
|
|
109
|
+
<a class="day-cell" href="timetable.html"><span class="display">14</span><span class="mono">Su</span></a>
|
|
110
|
+
</nav>
|
|
111
|
+
</div>
|
|
112
|
+
</header>
|
|
113
|
+
|
|
114
|
+
<section class="grid" aria-label="Timetable, Saturday 6 March">
|
|
115
|
+
<div class="ruler">
|
|
116
|
+
<span class="mono" style="--h:0">10</span>
|
|
117
|
+
<span class="mono" style="--h:1">11</span>
|
|
118
|
+
<span class="mono" style="--h:2">12</span>
|
|
119
|
+
<span class="mono" style="--h:3">13</span>
|
|
120
|
+
<span class="mono" style="--h:4">14</span>
|
|
121
|
+
<span class="mono" style="--h:5">15</span>
|
|
122
|
+
<span class="mono" style="--h:6">16</span>
|
|
123
|
+
<span class="mono" style="--h:7">17</span>
|
|
124
|
+
<span class="mono" style="--h:8">18</span>
|
|
125
|
+
<span class="mono" style="--h:9">19</span>
|
|
126
|
+
<span class="mono" style="--h:10">20</span>
|
|
127
|
+
<span class="mono" style="--h:11">21</span>
|
|
128
|
+
<span class="mono" style="--h:12">22</span>
|
|
129
|
+
<span class="mono" style="--h:13">23</span>
|
|
130
|
+
<span class="mono" style="--h:14">00</span>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="cinema-row">
|
|
133
|
+
<div class="cinema-label"><span class="display">C1</span><span class="mono">Meridian<br>412 seats</span></div>
|
|
134
|
+
<a class="screening" href="film.html" style="--at:90;--run:98"><span class="display">Hollow Bay</span><span class="mono">11:30 98′</span></a>
|
|
135
|
+
<a class="screening" href="film.html" style="--at:240;--run:121"><span class="display">Copper Hours</span><span class="mono">14:00 121′</span></a>
|
|
136
|
+
<a class="screening" href="film.html" style="--at:405;--run:117"><span class="display">The Long Green</span><span class="mono">16:45 117′</span></a>
|
|
137
|
+
<a class="screening cut" href="film.html" style="--at:570;--run:112"><span class="display">Salt Winter</span><span class="mono">19:30 112′</span></a>
|
|
138
|
+
<a class="screening" href="film.html" style="--at:750;--run:90"><span class="display">Second Sun</span><span class="mono">22:30 90′</span></a>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="cinema-row">
|
|
141
|
+
<div class="cinema-label"><span class="display">C2</span><span class="mono">Arcade<br>260 seats</span></div>
|
|
142
|
+
<a class="screening" href="film.html" style="--at:30;--run:88"><span class="display">Kites over Brine</span><span class="mono">10:30 88′</span></a>
|
|
143
|
+
<a class="screening" href="film.html" style="--at:195;--run:95"><span class="display">A Room for Swans</span><span class="mono">13:15 95′</span></a>
|
|
144
|
+
<a class="screening" href="film.html" style="--at:360;--run:102"><span class="display">Static Summer</span><span class="mono">16:00 102′</span></a>
|
|
145
|
+
<a class="screening" href="film.html" style="--at:510;--run:126"><span class="display">Eleven Ferries</span><span class="mono">18:30 126′</span></a>
|
|
146
|
+
<a class="screening" href="film.html" style="--at:675;--run:94"><span class="display">Blue Hour Union</span><span class="mono">21:15 94′</span></a>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="cinema-row">
|
|
149
|
+
<div class="cinema-label"><span class="display">C3</span><span class="mono">Lantern<br>180 seats</span></div>
|
|
150
|
+
<a class="screening" href="film.html" style="--at:105;--run:85"><span class="display">Dog Days in Velle</span><span class="mono">11:45 85′</span></a>
|
|
151
|
+
<a class="screening cut seen" href="film.html" style="--at:255;--run:104"><span class="display">Nobody Swims</span><span class="mono">14:15 104′</span></a>
|
|
152
|
+
<a class="screening" href="film.html" style="--at:420;--run:110"><span class="display">Northern Interval</span><span class="mono">17:00 110′</span></a>
|
|
153
|
+
<a class="screening" href="film.html" style="--at:600;--run:99"><span class="display">Lanterns Out</span><span class="mono">20:00 99′</span></a>
|
|
154
|
+
<a class="screening" href="film.html" style="--at:750;--run:92"><span class="display">Undertow Hotel</span><span class="mono">22:30 92′</span></a>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="cinema-row">
|
|
157
|
+
<div class="cinema-label"><span class="display">C4</span><span class="mono">Northlight<br>220 seats</span></div>
|
|
158
|
+
<a class="screening" href="film.html" style="--at:0;--run:75"><span class="display">Small Hours</span><span class="mono">10:00 75′</span></a>
|
|
159
|
+
<a class="screening" href="film.html" style="--at:150;--run:108"><span class="display">Red Cartographer</span><span class="mono">12:30 108′</span></a>
|
|
160
|
+
<a class="screening" href="film.html" style="--at:330;--run:97"><span class="display">Night Bus to Ostra</span><span class="mono">15:30 97′</span></a>
|
|
161
|
+
<a class="screening" href="film.html" style="--at:480;--run:89"><span class="display">Low Tide Choir</span><span class="mono">18:00 89′</span></a>
|
|
162
|
+
<a class="screening" href="film.html" style="--at:660;--run:101"><span class="display">Mirror Weather</span><span class="mono">21:00 101′</span></a>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="cinema-row">
|
|
165
|
+
<div class="cinema-label"><span class="display">C5</span><span class="mono">Pavilion<br>340 seats</span></div>
|
|
166
|
+
<a class="screening cut seen" href="film.html" style="--at:60;--run:96"><span class="display">Glass Orchard</span><span class="mono">11:00 96′</span></a>
|
|
167
|
+
<a class="screening" href="film.html" style="--at:225;--run:100"><span class="display">Velvet Ration</span><span class="mono">13:45 100′</span></a>
|
|
168
|
+
<a class="screening" href="film.html" style="--at:390;--run:113"><span class="display">Lamplighters</span><span class="mono">16:30 113′</span></a>
|
|
169
|
+
<a class="screening" href="film.html" style="--at:540;--run:104"><span class="display">Pale Season</span><span class="mono">19:00 104′</span></a>
|
|
170
|
+
<a class="screening" href="film.html" style="--at:705;--run:88"><span class="display">Wide Awake Tuesday</span><span class="mono">21:45 88′</span></a>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="cinema-row">
|
|
173
|
+
<div class="cinema-label"><span class="display">C6</span><span class="mono">Harbour<br>150 seats</span></div>
|
|
174
|
+
<a class="screening" href="film.html" style="--at:120;--run:70"><span class="display">Gull Island</span><span class="mono">12:00 70′</span></a>
|
|
175
|
+
<a class="screening" href="film.html" style="--at:300;--run:115"><span class="display">Mother of Rivers</span><span class="mono">15:00 115′</span></a>
|
|
176
|
+
<a class="screening" href="film.html" style="--at:465;--run:93"><span class="display">Kiln</span><span class="mono">17:45 93′</span></a>
|
|
177
|
+
<a class="screening" href="film.html" style="--at:615;--run:105"><span class="display">Last Orders</span><span class="mono">20:15 105′</span></a>
|
|
178
|
+
<a class="screening cut" href="film.html" style="--at:765;--run:83"><span class="display">Feral Monday</span><span class="mono">22:45 83′</span></a>
|
|
179
|
+
</div>
|
|
180
|
+
<span class="now" style="--at:532"><span class="mono">Now 18:52</span></span>
|
|
181
|
+
</section>
|
|
182
|
+
|
|
183
|
+
<footer class="legend mono">
|
|
184
|
+
<span><span class="key cut"></span>Your cut</span>
|
|
185
|
+
<span><span class="key"></span>On the programme</span>
|
|
186
|
+
<span>Struck out: seen</span>
|
|
187
|
+
<span>Start, run in minutes</span>
|
|
188
|
+
</footer>
|
|
189
|
+
</main>
|
|
190
|
+
|
|
191
|
+
</body>
|
|
192
|
+
</html>
|
|
@@ -1,29 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"active": "
|
|
3
|
+
"active": "Night",
|
|
4
4
|
"themes": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
5
|
+
"Night": {
|
|
6
|
+
"Field": "#0A0A0A",
|
|
7
|
+
"Ink": "#FFFFFF",
|
|
8
|
+
"Muted": "#9C9C9C",
|
|
9
|
+
"Rule": "#333333",
|
|
10
|
+
"Safelight": "#FF3D14",
|
|
11
|
+
"On safelight": "#0A0A0A",
|
|
12
|
+
"Signal": "#FF3D14"
|
|
13
|
+
},
|
|
14
|
+
"Daylight": {
|
|
15
|
+
"Field": "#FFFFFF",
|
|
16
|
+
"Ink": "#0A0A0A",
|
|
17
|
+
"Muted": "#333333",
|
|
18
|
+
"Rule": "#9C9C9C",
|
|
19
|
+
"Safelight": "#FF3D14",
|
|
20
|
+
"On safelight": "#0A0A0A",
|
|
21
|
+
"Signal": "#0A0A0A"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
"fontSizes": [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
"fontSizes": [
|
|
25
|
+
12,
|
|
26
|
+
16,
|
|
27
|
+
20,
|
|
28
|
+
28,
|
|
29
|
+
40,
|
|
30
|
+
56,
|
|
31
|
+
80,
|
|
32
|
+
120,
|
|
33
|
+
160,
|
|
34
|
+
320,
|
|
35
|
+
480
|
|
36
|
+
],
|
|
37
|
+
"fontWeights": [
|
|
38
|
+
400
|
|
39
|
+
],
|
|
40
|
+
"radii": [
|
|
41
|
+
0
|
|
42
|
+
],
|
|
43
|
+
"spacing": [
|
|
44
|
+
0,
|
|
45
|
+
4,
|
|
46
|
+
8,
|
|
47
|
+
12,
|
|
48
|
+
16,
|
|
49
|
+
20,
|
|
50
|
+
24,
|
|
51
|
+
32,
|
|
52
|
+
40,
|
|
53
|
+
48,
|
|
54
|
+
64,
|
|
55
|
+
80,
|
|
56
|
+
96,
|
|
57
|
+
120
|
|
58
|
+
],
|
|
59
|
+
"fontFamily": "\"Anton\", \"HelveticaNeue-CondensedBlack\", Impact, sans-serif",
|
|
28
60
|
"minTarget": 44
|
|
29
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easel-canvas",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Easel: an HTML design canvas for AI agents. Shows screens/*.html as boards and edits the source directly, with Claude Code / Codex via MCP",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hyun Park",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"mcp": "node bin/mcp.mjs",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "node --test test/*.test.mjs",
|
|
28
|
-
"test:e2e": "node --test --test-concurrency=1 test/e2e/*.e2e.mjs"
|
|
28
|
+
"test:e2e": "node --test --test-concurrency=1 test/e2e/*.e2e.mjs",
|
|
29
|
+
"design:css": "node tools/mkcss.mjs"
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|
|
31
32
|
"node": ">=20"
|
package/server/args.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// AI-generated with Claude Code, 2026-10-09, reviewed by Hyun Park
|
|
2
2
|
// Command-line args: [connect] [--dir <design folder>] [--port 4317] [--open] [--demo] [--init] [--help] [--version],
|
|
3
3
|
// plus --agents a,b and --dry-run for connect, --out, --page, --boards a,b, --single-file, --pdf, --png for export,
|
|
4
|
-
// and --permission for easel-mcp (
|
|
4
|
+
// and --chat / --permission for easel-mcp (the server of an in-app chat run: canvas tools and its permission tool / that tool only).
|
|
5
5
|
// Default design folder: <repo>/docs/design when Easel lives in <repo>/tools/<name> (submodule); otherwise
|
|
6
6
|
// ./docs/design or the current folder if it has screens/ (npx).
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
@@ -25,7 +25,7 @@ export const DEFAULT_DIR = defaultDir();
|
|
|
25
25
|
const expand = (p) => path.resolve(p.replace(/^~(?=\/)/, process.env.HOME ?? "~"));
|
|
26
26
|
|
|
27
27
|
export function parseArgs(argv = process.argv.slice(2)) {
|
|
28
|
-
const out = { command: null, dir: null, port: DEFAULT_PORT, portGiven: false, dirGiven: false, agents: null, dryRun: false, out: null, page: null, boards: null, singleFile: false, pdf: false, png: false, permission: false, open: false, noOpen: false, demo: false, init: false, help: false, version: false, prod: false };
|
|
28
|
+
const out = { command: null, dir: null, port: DEFAULT_PORT, portGiven: false, dirGiven: false, agents: null, dryRun: false, out: null, page: null, boards: null, singleFile: false, pdf: false, png: false, permission: false, chat: false, open: false, noOpen: false, demo: false, init: false, help: false, version: false, prod: false };
|
|
29
29
|
for (let i = 0; i < argv.length; i++) {
|
|
30
30
|
const a = argv[i];
|
|
31
31
|
const next = () => argv[++i];
|
|
@@ -52,6 +52,7 @@ export function parseArgs(argv = process.argv.slice(2)) {
|
|
|
52
52
|
else if (a === "--init") out.init = true;
|
|
53
53
|
else if (a === "--prod") out.prod = true;
|
|
54
54
|
else if (a === "--permission") out.permission = true;
|
|
55
|
+
else if (a === "--chat") out.chat = true;
|
|
55
56
|
else if (a === "-h" || a === "--help") out.help = true;
|
|
56
57
|
else if (a === "-v" || a === "--version") out.version = true;
|
|
57
58
|
}
|
package/server/chat.mjs
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// In-canvas chat: spawns claude -p / codex exec and turns their output (JSONL) into uniform events streamed over WS.
|
|
3
3
|
// Attaches the selection, visible boards, comments, references and errors as context; for "N variants" it first creates copies side by side.
|
|
4
4
|
// Each run copies the tracked files to .easel/runs/<id>/ first (POST /api/chat/revert), and everything it changes becomes one undo step
|
|
5
|
-
// that "Undo this run" takes back. Claude Code's
|
|
5
|
+
// that "Undo this run" takes back. A Claude Code run gets Easel's canvas tools from bin/mcp.mjs --chat, bound to this canvas and run,
|
|
6
|
+
// and its permission prompts come back through the same server as cards in the chat.
|
|
6
7
|
import { spawn } from "node:child_process";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import fs from "node:fs/promises";
|
|
@@ -35,26 +36,30 @@ export const INSTALL_URL = {
|
|
|
35
36
|
cursor: "https://cursor.com/cli",
|
|
36
37
|
gemini: "https://github.com/google-gemini/gemini-cli#-installation",
|
|
37
38
|
};
|
|
38
|
-
/** MCP server name
|
|
39
|
-
export const
|
|
39
|
+
/** MCP server name of a Claude Code run's own Easel tools and permission prompts: distinct from a project-configured "easel" server */
|
|
40
|
+
export const RUN_SERVER = "easel-chat";
|
|
41
|
+
/** Names `easel-canvas connect` (and older setups) give Easel's MCP server: denied in a run, which has its own, so the model sees one set */
|
|
42
|
+
export const OTHER_EASEL_SERVERS = ["easel", "design-canvas"];
|
|
40
43
|
const fakeAgents = () => (process.env.DESIGN_CANVAS_AGENT_CMD ? JSON.parse(process.env.DESIGN_CANVAS_AGENT_CMD) : {});
|
|
41
44
|
|
|
42
45
|
/** Model names passed to --model / -m: aliases or full ids only (they reach a shell on Windows) */
|
|
43
46
|
export const validModel = (m) => (typeof m === "string" && /^[\w.:/[\]-]{1,100}$/.test(m.trim()) ? m.trim() : "");
|
|
44
47
|
|
|
45
|
-
/** Inline --mcp-config for a Claude Code run: this package's MCP server
|
|
46
|
-
export function
|
|
48
|
+
/** Inline --mcp-config for a Claude Code run: this package's MCP server (canvas tools and the permission tool), bound to this canvas and run */
|
|
49
|
+
export function runMcpConfig({ port, runId }) {
|
|
47
50
|
const env = { DESIGN_CANVAS_PORT: String(port), EASEL_RUN_ID: runId };
|
|
48
|
-
return JSON.stringify({ mcpServers: { [
|
|
51
|
+
return JSON.stringify({ mcpServers: { [RUN_SERVER]: { type: "stdio", command: process.execPath, args: [path.join(TOOL_ROOT, "bin/mcp.mjs"), "--chat", "--port", String(port)], env } } });
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
/**
|
|
52
55
|
* Agent launch command. Tests override it with DESIGN_CANVAS_AGENT_CMD='{"claude":["node","fake.mjs"]}'.
|
|
53
|
-
*
|
|
56
|
+
* run: { port, runId } gives a Claude Code run its own Easel tools for this canvas and routes its permission prompts to the chat
|
|
57
|
+
* (anything else is refused in headless mode); any other easel server the project or the user configured is denied, so there is one set
|
|
54
58
|
*/
|
|
55
|
-
export function agentCommand(agent, { prompt, resume, root, images = [], model = "",
|
|
59
|
+
export function agentCommand(agent, { prompt, resume, root, images = [], model = "", run = null }) {
|
|
56
60
|
const override = fakeAgents()[agent];
|
|
57
|
-
|
|
61
|
+
// A stand-in for claude gets the run's --mcp-config too, so tests reach the canvas tools the way a real run does
|
|
62
|
+
if (override) return { cmd: override[0], args: [...override.slice(1), ...(agent === "claude" && run ? ["--mcp-config", runMcpConfig(run)] : []), prompt] };
|
|
58
63
|
if (agent === "codex") {
|
|
59
64
|
const common = ["--json", "--skip-git-repo-check", "-s", "workspace-write", ...(model ? ["-m", model] : []), ...images.flatMap((i) => ["-i", i])];
|
|
60
65
|
return resume ? { cmd: "codex", args: ["exec", "resume", resume, ...common, prompt] } : { cmd: "codex", args: ["exec", ...common, "-C", root, prompt] };
|
|
@@ -75,9 +80,9 @@ export function agentCommand(agent, { prompt, resume, root, images = [], model =
|
|
|
75
80
|
"--permission-mode",
|
|
76
81
|
"acceptEdits",
|
|
77
82
|
"--allowedTools",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
...(run
|
|
84
|
+
? [`mcp__${RUN_SERVER}`, "--disallowedTools", ...OTHER_EASEL_SERVERS.map((n) => `mcp__${n}`), "--mcp-config", runMcpConfig(run), "--permission-prompt-tool", `mcp__${RUN_SERVER}__permission`]
|
|
85
|
+
: OTHER_EASEL_SERVERS.map((n) => `mcp__${n}`)),
|
|
81
86
|
...(model ? ["--model", model] : []),
|
|
82
87
|
...(resume ? ["--resume", resume] : []),
|
|
83
88
|
],
|
|
@@ -238,13 +243,16 @@ export function parseLine(agent, line, st) {
|
|
|
238
243
|
} else if (o.type === "stream_event" && o.event?.type === "message_start") out.push({ kind: "break" });
|
|
239
244
|
else if (o.type === "assistant") {
|
|
240
245
|
for (const c of o.message?.content ?? []) {
|
|
241
|
-
if (c.type === "tool_use") out.push({ kind: "tool", name: c.name, detail: short(c.input?.file_path ?? c.input?.path ?? c.input?.command ?? c.input) });
|
|
246
|
+
if (c.type === "tool_use") out.push({ kind: "tool", name: easelToolName(c.name), detail: short(c.input?.file_path ?? c.input?.path ?? c.input?.command ?? c.input) });
|
|
242
247
|
else if (c.type === "text" && !st.streamed) out.push({ kind: "text", text: c.text });
|
|
243
248
|
}
|
|
244
249
|
} else if (o.type === "result") out.push(o.is_error ? { kind: "error", text: o.result ?? o.subtype } : { kind: "done", cost: o.total_cost_usd });
|
|
245
250
|
return out;
|
|
246
251
|
}
|
|
247
252
|
|
|
253
|
+
/** mcp__easel-chat__check_tokens → check_tokens: Easel's own tools read as their names in the chat; other MCP tools stay as they are */
|
|
254
|
+
export const easelToolName = (name) => String(name ?? "").replace(new RegExp(`^mcp__(?:${[RUN_SERVER, ...OTHER_EASEL_SERVERS].join("|")})__`), "");
|
|
255
|
+
|
|
248
256
|
/** Windows shell argument: wrap in double quotes and double any inner double quotes */
|
|
249
257
|
export const winQuote = (a) => (/^[\w./:=-]+$/.test(a) ? a : `"${String(a).replace(/"/g, '""')}"`);
|
|
250
258
|
|
|
@@ -291,8 +299,10 @@ export async function buildPrompt(ctx, body, state) {
|
|
|
291
299
|
}
|
|
292
300
|
// Design tokens from tokens.json. Without one the AI gets no default palette, only "keep to the file's styles"
|
|
293
301
|
const tk = await readTokens(ctx.dir);
|
|
302
|
+
// A Claude Code run always has Easel's tools (its own inline server); other agents only when the project is connected
|
|
303
|
+
const claudeRun = AGENTS.includes(body.agent) ? body.agent === "claude" : !String(body.agent ?? "").startsWith("custom:");
|
|
294
304
|
const palette = Object.entries(tk.themes?.[tk.active] ?? {}).map(([n, v]) => `${n} ${v}`).join(", ");
|
|
295
|
-
const tokenRule = tk.registered ? `Use the design tokens (theme "${tk.active}"): colors ${palette}; font sizes ${tk.fontSizes.join("/")}px; radii ${tk.radii.join("/")}px; spacing in multiples of 4; font ${tk.fontFamily}. Check with check_tokens if available
|
|
305
|
+
const tokenRule = tk.registered ? `Use the design tokens (theme "${tk.active}"): colors ${palette}; font sizes ${tk.fontSizes.join("/")}px; radii ${tk.radii.join("/")}px; spacing in multiples of 4; font ${tk.fontFamily}. ${claudeRun ? "Check with check_tokens." : "Check with check_tokens if available."}` : NO_TOKENS_NOTE;
|
|
296
306
|
lines.push(
|
|
297
307
|
`Rules: Only edit design files inside ${rel}/screens. Change only what is asked and leave everything else as is. New screens must include <meta name="board-size" content="390x844">; after creating one, use place_board to set its name and position. ${tokenRule}`,
|
|
298
308
|
"",
|
|
@@ -381,7 +391,7 @@ export function chatRoutes({ getSelection } = {}) {
|
|
|
381
391
|
const prompt = await buildPrompt(ctx, body, state);
|
|
382
392
|
const images = (body.attach?.refs ?? []).filter((r) => r.kind === "image").map((r) => path.join(ctx.dir, r.value));
|
|
383
393
|
const model = custom ? "" : validModel(body.model);
|
|
384
|
-
const { cmd, args } = custom ? customArgv(custom.command, prompt) : agentCommand(agent, { prompt, resume: body.resume, root: rootOf(ctx.dir), images, model,
|
|
394
|
+
const { cmd, args } = custom ? customArgv(custom.command, prompt) : agentCommand(agent, { prompt, resume: body.resume, root: rootOf(ctx.dir), images, model, run: { port: req.socket.localPort, runId: id } });
|
|
385
395
|
let proc;
|
|
386
396
|
try {
|
|
387
397
|
// Windows: claude/codex are .cmd wrappers so a shell is needed, and there is no process-group kill so detached is not used.
|
|
@@ -483,7 +493,7 @@ export function chatRoutes({ getSelection } = {}) {
|
|
|
483
493
|
},
|
|
484
494
|
],
|
|
485
495
|
["GET", "/api/chat", async (req, res, url) => sendJson(res, 200, { events: runs.get(url.searchParams.get("id"))?.events ?? [] })],
|
|
486
|
-
// Claude Code asks (through bin/mcp.mjs --
|
|
496
|
+
// Claude Code asks (through bin/mcp.mjs --chat, header X-Easel-Run): a card in the chat, or an answer right away when
|
|
487
497
|
// a remembered "Always allow" rule covers it. The MCP tool then polls GET until the user answers
|
|
488
498
|
[
|
|
489
499
|
"POST",
|
package/server/html.mjs
CHANGED
|
@@ -57,7 +57,7 @@ export function textOf(node) {
|
|
|
57
57
|
return (node.childNodes ?? []).map(textOf).join("");
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// Block elements read as separate words in a label: "
|
|
60
|
+
// Block elements read as separate words in a label: "Salt Winter" + "19:30" is "Salt Winter 19:30", not "Salt Winter19:30"
|
|
61
61
|
const BLOCK = new Set("address article aside blockquote dd div dl dt figcaption figure footer form h1 h2 h3 h4 h5 h6 header li main nav ol p pre section table td th tr ul".split(" "));
|
|
62
62
|
|
|
63
63
|
/** Text for showing an element by name (layers list): like textOf, with a space between block children */
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<meta name="board-size" content="390x844">
|
|
7
|
-
<title>Empty state</title>
|
|
8
|
-
<style>
|
|
9
|
-
*{box-sizing:border-box}body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;color:#14161a;background:#fff;-webkit-font-smoothing:antialiased}
|
|
10
|
-
.s{width:390px;height:844px;position:relative;overflow:hidden;background:#F7F6F2;display:flex;flex-direction:column}
|
|
11
|
-
.bar{height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:15px;font-weight:600}
|
|
12
|
-
.h1{font-size:30px;font-weight:700;letter-spacing:-.02em;margin:4px 20px 4px}
|
|
13
|
-
.sub{color:#6b6f76;font-size:15px;margin:0 20px 16px}
|
|
14
|
-
.card{background:#fff;border-radius:20px;margin:0 16px 12px;padding:16px;box-shadow:0 1px 2px rgba(20,22,26,.04),0 4px 16px rgba(20,22,26,.05)}
|
|
15
|
-
.row{display:flex;align-items:center;gap:12px}
|
|
16
|
-
.ic{width:44px;height:44px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:22px;flex:none}
|
|
17
|
-
.t{font-size:16px;font-weight:600}.m{font-size:13px;color:#6b6f76;margin-top:4px}
|
|
18
|
-
.chk{margin-left:auto;width:28px;height:28px;border-radius:50%;border:2px solid #d9dbe0;flex:none}
|
|
19
|
-
.chk.on{background:#3E7BFA;border-color:#3E7BFA;box-shadow:inset 0 0 0 4px #fff}
|
|
20
|
-
.btn{display:flex;align-items:center;justify-content:center;height:54px;border-radius:16px;background:#14161a;color:#fff;font-size:16px;font-weight:600;text-decoration:none;margin:0 16px}
|
|
21
|
-
.btn.blue{background:#3E7BFA}
|
|
22
|
-
.tabs{position:absolute;left:16px;right:16px;bottom:20px;height:64px;border-radius:20px;background:#fff;display:flex;align-items:center;justify-content:space-around;box-shadow:0 8px 24px rgba(20,22,26,.10)}
|
|
23
|
-
.tab{font-size:12px;font-weight:600;color:#9aa0a8;display:flex;flex-direction:column;align-items:center;gap:4px}.tab.on{color:#14161a}
|
|
24
|
-
.dot{width:6px;height:6px;border-radius:50%;background:currentColor}
|
|
25
|
-
.pill{display:inline-flex;align-items:center;height:28px;padding:0 12px;border-radius:999px;background:#fff;font-size:13px;font-weight:600;margin-right:8px}
|
|
26
|
-
.pill.on{background:#14161a;color:#fff}
|
|
27
|
-
.ring{width:132px;height:132px;border-radius:50%;background:conic-gradient(#3E7BFA 0 72%,#E8EAF0 72% 100%);display:flex;align-items:center;justify-content:center}
|
|
28
|
-
.ring>div{width:104px;height:104px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center}
|
|
29
|
-
.bars{display:flex;align-items:flex-end;gap:8px;height:120px;padding:0 4px}
|
|
30
|
-
.bars div{flex:1;border-radius:8px;background:#E3EAFE}.bars div.on{background:#3E7BFA}
|
|
31
|
-
.field{height:52px;border-radius:14px;background:#fff;border:1.5px solid #e6e7eb;display:flex;align-items:center;padding:0 16px;font-size:16px;margin:0 16px 12px;color:#14161a}
|
|
32
|
-
.lab{font-size:13px;font-weight:600;color:#6b6f76;margin:8px 20px 8px}
|
|
33
|
-
</style>
|
|
34
|
-
</head>
|
|
35
|
-
<body>
|
|
36
|
-
<div class="s" style="align-items:center;justify-content:center;text-align:center;padding:0 40px">
|
|
37
|
-
<svg width="160" height="140" viewBox="0 0 160 140" aria-hidden="true"><rect x="20" y="30" width="120" height="90" rx="20" fill="#E3EAFE"/><rect x="38" y="52" width="60" height="10" rx="5" fill="#fff"/><rect x="38" y="72" width="84" height="10" rx="5" fill="#fff"/><circle cx="122" cy="34" r="18" fill="#3E7BFA"/><path d="M114 34l6 6 10-11" stroke="#fff" stroke-width="4" fill="none" stroke-linecap="round"/></svg>
|
|
38
|
-
<div class="h1" style="margin:24px 0 8px">Start your first habit</div>
|
|
39
|
-
<p class="sub" style="margin:0 0 28px">Small steps every day. Pick one thing you want to do more often.</p>
|
|
40
|
-
<a class="btn blue" href="new-habit.html" style="width:100%;margin:0">Add a habit</a>
|
|
41
|
-
</div>
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|