Spaces:
Running
Running
Align model row and settings controls
Browse files- static/index.html +68 -20
- static/style.css +35 -25
static/index.html
CHANGED
|
@@ -24,7 +24,9 @@
|
|
| 24 |
</header>
|
| 25 |
|
| 26 |
<section class="model-strip is-loading" id="model-strip" aria-label="Model status">
|
| 27 |
-
<
|
|
|
|
|
|
|
| 28 |
<div class="model-copy">
|
| 29 |
<span class="model-kicker">Model</span>
|
| 30 |
<div class="model-name-row">
|
|
@@ -58,21 +60,23 @@
|
|
| 58 |
|
| 59 |
<div class="input-meta"><span id="count">0 characters</span><span>Checks after 650 ms</span></div>
|
| 60 |
|
| 61 |
-
<details class="settings-menu">
|
| 62 |
-
<summary>Advanced settings</summary>
|
| 63 |
-
<div class="settings-
|
| 64 |
-
<
|
| 65 |
-
<
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
<
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
| 76 |
</article>
|
| 77 |
|
| 78 |
<article class="workspace-card output-panel">
|
|
@@ -105,10 +109,54 @@
|
|
| 105 |
<div class="example-list" id="examples"></div>
|
| 106 |
</section>
|
| 107 |
</main>
|
| 108 |
-
</div>
|
| 109 |
-
|
| 110 |
-
<script>
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
{ label:"Agreement", text:"Their are many reason to study hard." },
|
| 113 |
{ label:"Verb forms", text:"I has went to the stor yesterday." },
|
| 114 |
{ label:"Pronouns", text:"Me and him was late for the meetting." },
|
|
|
|
| 24 |
</header>
|
| 25 |
|
| 26 |
<section class="model-strip is-loading" id="model-strip" aria-label="Model status">
|
| 27 |
+
<span class="model-logo-frame" aria-hidden="true">
|
| 28 |
+
<img id="model-logo" class="model-logo" width="60" height="63" alt="">
|
| 29 |
+
</span>
|
| 30 |
<div class="model-copy">
|
| 31 |
<span class="model-kicker">Model</span>
|
| 32 |
<div class="model-name-row">
|
|
|
|
| 60 |
|
| 61 |
<div class="input-meta"><span id="count">0 characters</span><span>Checks after 650 ms</span></div>
|
| 62 |
|
| 63 |
+
<details class="settings-menu">
|
| 64 |
+
<summary>Advanced settings</summary>
|
| 65 |
+
<div class="settings-reveal">
|
| 66 |
+
<div class="settings-grid" aria-label="Correction settings">
|
| 67 |
+
<label class="setting-card" for="mep">
|
| 68 |
+
<span class="setting-copy"><span>Confidence threshold</span><output id="mepv" for="mep">0.00</output></span>
|
| 69 |
+
<input type="range" id="mep" min="0" max="1" step="0.05" value="0">
|
| 70 |
+
<span class="setting-scale"><span>More corrections</span><span>More precise</span></span>
|
| 71 |
+
</label>
|
| 72 |
+
<label class="setting-card" for="mit">
|
| 73 |
+
<span class="setting-copy"><span>Correction passes</span><output id="mitv" for="mit">3</output></span>
|
| 74 |
+
<input type="range" id="mit" min="1" max="5" step="1" value="3">
|
| 75 |
+
<span class="setting-scale"><span>1 pass</span><span>5 passes</span></span>
|
| 76 |
+
</label>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
</details>
|
| 80 |
</article>
|
| 81 |
|
| 82 |
<article class="workspace-card output-panel">
|
|
|
|
| 109 |
<div class="example-list" id="examples"></div>
|
| 110 |
</section>
|
| 111 |
</main>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<script>
|
| 115 |
+
{
|
| 116 |
+
const settingsMenu = document.querySelector(".settings-menu");
|
| 117 |
+
const settingsSummary = settingsMenu.querySelector("summary");
|
| 118 |
+
const settingsReveal = settingsMenu.querySelector(".settings-reveal");
|
| 119 |
+
settingsSummary.setAttribute("aria-expanded", "false");
|
| 120 |
+
|
| 121 |
+
settingsSummary.addEventListener("click", async (event) => {
|
| 122 |
+
event.preventDefault();
|
| 123 |
+
if (settingsMenu.dataset.animating === "true") return;
|
| 124 |
+
|
| 125 |
+
const opening = !settingsMenu.open;
|
| 126 |
+
const duration = matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : 300;
|
| 127 |
+
if (!settingsReveal.animate || duration === 0) {
|
| 128 |
+
settingsMenu.open = opening;
|
| 129 |
+
settingsSummary.setAttribute("aria-expanded", String(opening));
|
| 130 |
+
return;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
settingsMenu.dataset.animating = "true";
|
| 134 |
+
if (opening) settingsMenu.open = true;
|
| 135 |
+
settingsSummary.setAttribute("aria-expanded", String(opening));
|
| 136 |
+
|
| 137 |
+
const expandedHeight = settingsReveal.scrollHeight;
|
| 138 |
+
const animation = settingsReveal.animate(
|
| 139 |
+
opening
|
| 140 |
+
? [
|
| 141 |
+
{ height: "0px", opacity: 0, transform: "translateY(-6px)" },
|
| 142 |
+
{ height: `${expandedHeight}px`, opacity: 1, transform: "translateY(0)" },
|
| 143 |
+
]
|
| 144 |
+
: [
|
| 145 |
+
{ height: `${settingsReveal.getBoundingClientRect().height}px`, opacity: 1, transform: "translateY(0)" },
|
| 146 |
+
{ height: "0px", opacity: 0, transform: "translateY(-6px)" },
|
| 147 |
+
],
|
| 148 |
+
{ duration, easing: "cubic-bezier(.2,.8,.2,1)" },
|
| 149 |
+
);
|
| 150 |
+
|
| 151 |
+
try { await animation.finished; } catch (_) {}
|
| 152 |
+
if (!opening) settingsMenu.open = false;
|
| 153 |
+
delete settingsMenu.dataset.animating;
|
| 154 |
+
});
|
| 155 |
+
}
|
| 156 |
+
</script>
|
| 157 |
+
|
| 158 |
+
<script>
|
| 159 |
+
const EXAMPLES = [
|
| 160 |
{ label:"Agreement", text:"Their are many reason to study hard." },
|
| 161 |
{ label:"Verb forms", text:"I has went to the stor yesterday." },
|
| 162 |
{ label:"Pronouns", text:"Me and him was late for the meetting." },
|
static/style.css
CHANGED
|
@@ -53,11 +53,11 @@ h1 em { color:var(--purple); font-weight:400; font-style:italic; }
|
|
| 53 |
.sub { max-width:900px; margin:0; color:var(--neutral-500); font-size:15px; line-height:1.45; }
|
| 54 |
.sub strong { color:var(--neutral-700); font-weight:600; }
|
| 55 |
|
| 56 |
-
.model-strip {
|
| 57 |
-
display:grid;
|
| 58 |
-
grid-template-columns:
|
| 59 |
-
align-items:center;
|
| 60 |
-
gap:
|
| 61 |
min-height:76px;
|
| 62 |
padding:12px 30px;
|
| 63 |
border-top:1px solid var(--border);
|
|
@@ -65,19 +65,24 @@ h1 em { color:var(--purple); font-weight:400; font-style:italic; }
|
|
| 65 |
background:linear-gradient(90deg,rgba(108,79,224,.018),rgba(205,130,240,.035),rgba(108,79,224,.018));
|
| 66 |
transition:background .3s ease;
|
| 67 |
}
|
|
|
|
| 68 |
.model-logo {
|
|
|
|
|
|
|
|
|
|
| 69 |
display:block;
|
| 70 |
-
width:
|
| 71 |
-
height:
|
| 72 |
-
|
|
|
|
| 73 |
image-rendering:pixelated;
|
| 74 |
}
|
| 75 |
-
.model-copy { display:flex; min-width:
|
| 76 |
-
.model-kicker { color:var(--neutral-500); font:600 10px/1.2 var(--mono); letter-spacing:.09em; text-transform:uppercase; }
|
| 77 |
-
.model-name-row { display:flex; align-items:
|
| 78 |
-
.model-copy a { font:400 22px/1.15 var(--serif); text-decoration:none; }
|
| 79 |
-
.model-copy a:hover { color:var(--purple); }
|
| 80 |
-
.model-variant { display:inline-flex; padding:
|
| 81 |
.load-block { min-width:0; }
|
| 82 |
.load-meta { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:8px; color:var(--neutral-500); font-size:12px; font-weight:600; }
|
| 83 |
#load-percent { font:600 11px/1 var(--mono); font-variant-numeric:tabular-nums; }
|
|
@@ -119,14 +124,15 @@ main { display:flex; min-height:0; flex:0 0 auto; flex-direction:column; margin-
|
|
| 119 |
.is-complete .output-stage { animation:editor-complete .62s ease both; }
|
| 120 |
|
| 121 |
.input-meta { display:flex; justify-content:space-between; gap:14px; margin:8px 2px 0; color:var(--neutral-300); font:500 10px/1.3 var(--mono); }
|
| 122 |
-
.settings-menu { margin-top:12px; }
|
| 123 |
.settings-menu > summary { display:flex; align-items:center; justify-content:space-between; box-sizing:border-box; gap:14px; height:54px; min-height:54px; padding:0 13px; border:1px solid var(--border); border-radius:10px; background:var(--neutral-50); color:var(--neutral-500); font:600 10px/1.25 var(--mono); letter-spacing:.055em; text-transform:uppercase; cursor:pointer; list-style:none; transition:border-color .16s,background .16s,color .16s; }
|
| 124 |
.settings-menu > summary::-webkit-details-marker { display:none; }
|
| 125 |
.settings-menu > summary::after { content:"+"; flex:none; color:var(--purple); font:500 20px/1 var(--sans); transition:transform .2s ease; }
|
| 126 |
.settings-menu > summary:hover { border-color:rgba(108,79,224,.28); background:rgba(108,79,224,.025); color:var(--neutral-700); }
|
| 127 |
-
.settings-menu[open] > summary { border-radius:10px 10px 0 0; color:var(--neutral-700); }
|
| 128 |
-
.settings-menu[open] > summary::after { transform:rotate(45deg); }
|
| 129 |
-
.settings-
|
|
|
|
| 130 |
.setting-card { display:block; min-width:0; padding:12px 13px 9px; border:1px solid var(--border); border-radius:10px; background:var(--neutral-50); }
|
| 131 |
.setting-copy { display:flex; align-items:baseline; justify-content:space-between; gap:10px; color:var(--neutral-500); font:600 10px/1.25 var(--mono); letter-spacing:.055em; text-transform:uppercase; }
|
| 132 |
.setting-copy output { color:var(--purple); font:700 12px/1 var(--mono); letter-spacing:0; font-variant-numeric:tabular-nums; }
|
|
@@ -153,7 +159,7 @@ mark::after { content:""; position:absolute; z-index:-1; top:18%; bottom:12%; le
|
|
| 153 |
.legend-swatch { width:12px; height:8px; border-radius:2px; }
|
| 154 |
.legend-swatch.modified { background:rgba(205,130,240,.42); }
|
| 155 |
.legend-swatch.removed { background:rgba(228,84,84,.11); border-bottom:1px solid var(--red); }
|
| 156 |
-
.stats-grid { display:grid; grid-template-columns:1.25fr repeat(3,1fr); gap:8px; margin-top:
|
| 157 |
.stat-card { min-width:0; height:54px; min-height:54px; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:var(--paper); }
|
| 158 |
.stat-card span { display:block; margin-bottom:5px; color:var(--neutral-500); font:600 9px/1 var(--mono); letter-spacing:.08em; text-transform:uppercase; }
|
| 159 |
.stat-card strong { display:block; overflow:hidden; color:var(--neutral-700); font:650 14px/1.25 var(--sans); text-overflow:ellipsis; white-space:nowrap; font-variant-numeric:tabular-nums; }
|
|
@@ -191,19 +197,23 @@ mark::after { content:""; position:absolute; z-index:-1; top:18%; bottom:12%; le
|
|
| 191 |
.wrap { width:100%; border:0; }
|
| 192 |
.site-intro { padding:20px; }
|
| 193 |
h1 { font-size:40px; }
|
| 194 |
-
.sub { font-size:14px; }
|
| 195 |
-
.model-strip { grid-template-columns:42px 1fr; padding:12px 20px; }
|
| 196 |
-
.
|
|
|
|
| 197 |
main { padding:15px 20px 20px; }
|
| 198 |
.examples-panel { align-items:flex-start; flex-direction:column; }
|
| 199 |
}
|
| 200 |
-
@media (max-width:520px) {
|
| 201 |
.workspace-card { padding:16px; }
|
| 202 |
.settings-grid,.stats-grid { grid-template-columns:1fr 1fr; }
|
| 203 |
.panel-header { align-items:flex-start; flex-direction:column; }
|
| 204 |
.output-heading { flex-direction:row; }
|
| 205 |
-
.input-meta { align-items:flex-start; flex-direction:column; gap:3px; }
|
| 206 |
-
}
|
|
|
|
|
|
|
|
|
|
| 207 |
@media (prefers-reduced-motion:reduce) {
|
| 208 |
*,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
|
| 209 |
}
|
|
|
|
| 53 |
.sub { max-width:900px; margin:0; color:var(--neutral-500); font-size:15px; line-height:1.45; }
|
| 54 |
.sub strong { color:var(--neutral-700); font-weight:600; }
|
| 55 |
|
| 56 |
+
.model-strip {
|
| 57 |
+
display:grid;
|
| 58 |
+
grid-template-columns:42px 280px minmax(240px,1fr);
|
| 59 |
+
align-items:center;
|
| 60 |
+
column-gap:16px;
|
| 61 |
min-height:76px;
|
| 62 |
padding:12px 30px;
|
| 63 |
border-top:1px solid var(--border);
|
|
|
|
| 65 |
background:linear-gradient(90deg,rgba(108,79,224,.018),rgba(205,130,240,.035),rgba(108,79,224,.018));
|
| 66 |
transition:background .3s ease;
|
| 67 |
}
|
| 68 |
+
.model-logo-frame { position:relative; display:block; width:42px; height:42px; overflow:hidden; }
|
| 69 |
.model-logo {
|
| 70 |
+
position:absolute;
|
| 71 |
+
top:50%;
|
| 72 |
+
left:50%;
|
| 73 |
display:block;
|
| 74 |
+
width:60px;
|
| 75 |
+
height:auto;
|
| 76 |
+
max-width:none;
|
| 77 |
+
transform:translate(-50%,-50%);
|
| 78 |
image-rendering:pixelated;
|
| 79 |
}
|
| 80 |
+
.model-copy { display:flex; min-width:0; flex-direction:column; align-items:flex-start; justify-content:center; gap:1px; }
|
| 81 |
+
.model-kicker { color:var(--neutral-500); font:600 10px/1.2 var(--mono); letter-spacing:.09em; text-transform:uppercase; }
|
| 82 |
+
.model-name-row { display:flex; min-height:25px; align-items:center; gap:10px; white-space:nowrap; }
|
| 83 |
+
.model-copy a { font:400 22px/1.15 var(--serif); text-decoration:none; }
|
| 84 |
+
.model-copy a:hover { color:var(--purple); }
|
| 85 |
+
.model-variant { display:inline-flex; height:18px; align-items:center; box-sizing:border-box; padding:0 7px; border:1px solid rgba(108,79,224,.14); border-radius:999px; background:rgba(108,79,224,.05); color:var(--purple); font:700 9px/1 var(--mono); letter-spacing:.035em; text-transform:uppercase; }
|
| 86 |
.load-block { min-width:0; }
|
| 87 |
.load-meta { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:8px; color:var(--neutral-500); font-size:12px; font-weight:600; }
|
| 88 |
#load-percent { font:600 11px/1 var(--mono); font-variant-numeric:tabular-nums; }
|
|
|
|
| 124 |
.is-complete .output-stage { animation:editor-complete .62s ease both; }
|
| 125 |
|
| 126 |
.input-meta { display:flex; justify-content:space-between; gap:14px; margin:8px 2px 0; color:var(--neutral-300); font:500 10px/1.3 var(--mono); }
|
| 127 |
+
.settings-menu { margin-top:auto; padding-top:12px; }
|
| 128 |
.settings-menu > summary { display:flex; align-items:center; justify-content:space-between; box-sizing:border-box; gap:14px; height:54px; min-height:54px; padding:0 13px; border:1px solid var(--border); border-radius:10px; background:var(--neutral-50); color:var(--neutral-500); font:600 10px/1.25 var(--mono); letter-spacing:.055em; text-transform:uppercase; cursor:pointer; list-style:none; transition:border-color .16s,background .16s,color .16s; }
|
| 129 |
.settings-menu > summary::-webkit-details-marker { display:none; }
|
| 130 |
.settings-menu > summary::after { content:"+"; flex:none; color:var(--purple); font:500 20px/1 var(--sans); transition:transform .2s ease; }
|
| 131 |
.settings-menu > summary:hover { border-color:rgba(108,79,224,.28); background:rgba(108,79,224,.025); color:var(--neutral-700); }
|
| 132 |
+
.settings-menu[open] > summary { border-radius:10px 10px 0 0; color:var(--neutral-700); }
|
| 133 |
+
.settings-menu[open] > summary::after { transform:rotate(45deg); }
|
| 134 |
+
.settings-reveal { overflow:hidden; }
|
| 135 |
+
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:8px; border:1px solid var(--border); border-top:0; border-radius:0 0 10px 10px; background:var(--neutral-50); }
|
| 136 |
.setting-card { display:block; min-width:0; padding:12px 13px 9px; border:1px solid var(--border); border-radius:10px; background:var(--neutral-50); }
|
| 137 |
.setting-copy { display:flex; align-items:baseline; justify-content:space-between; gap:10px; color:var(--neutral-500); font:600 10px/1.25 var(--mono); letter-spacing:.055em; text-transform:uppercase; }
|
| 138 |
.setting-copy output { color:var(--purple); font:700 12px/1 var(--mono); letter-spacing:0; font-variant-numeric:tabular-nums; }
|
|
|
|
| 159 |
.legend-swatch { width:12px; height:8px; border-radius:2px; }
|
| 160 |
.legend-swatch.modified { background:rgba(205,130,240,.42); }
|
| 161 |
.legend-swatch.removed { background:rgba(228,84,84,.11); border-bottom:1px solid var(--red); }
|
| 162 |
+
.stats-grid { display:grid; grid-template-columns:1.25fr repeat(3,1fr); gap:8px; margin-top:auto; }
|
| 163 |
.stat-card { min-width:0; height:54px; min-height:54px; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:var(--paper); }
|
| 164 |
.stat-card span { display:block; margin-bottom:5px; color:var(--neutral-500); font:600 9px/1 var(--mono); letter-spacing:.08em; text-transform:uppercase; }
|
| 165 |
.stat-card strong { display:block; overflow:hidden; color:var(--neutral-700); font:650 14px/1.25 var(--sans); text-overflow:ellipsis; white-space:nowrap; font-variant-numeric:tabular-nums; }
|
|
|
|
| 197 |
.wrap { width:100%; border:0; }
|
| 198 |
.site-intro { padding:20px; }
|
| 199 |
h1 { font-size:40px; }
|
| 200 |
+
.sub { font-size:14px; }
|
| 201 |
+
.model-strip { grid-template-columns:42px minmax(0,1fr); column-gap:16px; row-gap:10px; padding:12px 20px; }
|
| 202 |
+
.model-copy { min-width:0; }
|
| 203 |
+
.load-block { grid-column:1/-1; }
|
| 204 |
main { padding:15px 20px 20px; }
|
| 205 |
.examples-panel { align-items:flex-start; flex-direction:column; }
|
| 206 |
}
|
| 207 |
+
@media (max-width:520px) {
|
| 208 |
.workspace-card { padding:16px; }
|
| 209 |
.settings-grid,.stats-grid { grid-template-columns:1fr 1fr; }
|
| 210 |
.panel-header { align-items:flex-start; flex-direction:column; }
|
| 211 |
.output-heading { flex-direction:row; }
|
| 212 |
+
.input-meta { align-items:flex-start; flex-direction:column; gap:3px; }
|
| 213 |
+
}
|
| 214 |
+
@media (max-width:470px) {
|
| 215 |
+
.model-name-row { align-items:flex-start; flex-direction:column; gap:2px; }
|
| 216 |
+
}
|
| 217 |
@media (prefers-reduced-motion:reduce) {
|
| 218 |
*,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
|
| 219 |
}
|