-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.html
More file actions
197 lines (194 loc) · 7.25 KB
/
widget.html
File metadata and controls
197 lines (194 loc) · 7.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!doctype html>
<html lang="en" class="h-screen">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="/src/style.css" />
<title>Typox</title>
</head>
<body
class="m-0 select-none bg-neutral-900 h-full flex flex-col overflow-hidden"
style="-webkit-user-select: none; user-select: none"
>
<!-- Skeleton: shown while AI is processing -->
<div
id="skeleton-view"
class="grid grid-cols-[1fr_1px_1fr] flex-1 px-4 pt-3 pb-2 gap-0"
>
<div class="flex flex-col gap-2 pr-3 pt-4">
<div class="h-2 rounded bg-white/10 animate-pulse w-full"></div>
<div class="h-2 rounded bg-white/10 animate-pulse w-4/5"></div>
<div class="h-2 rounded bg-white/10 animate-pulse w-3/5"></div>
</div>
<div class="bg-white/10 mx-0"></div>
<div class="flex flex-col gap-2 pl-3 pt-4">
<div class="h-2 rounded bg-white/10 animate-pulse w-full"></div>
<div class="h-2 rounded bg-white/10 animate-pulse w-4/5"></div>
<div class="h-2 rounded bg-white/10 animate-pulse w-3/5"></div>
</div>
</div>
<!-- Diff view: shown after correction-ready with changes -->
<div
id="diff-view"
class="hidden grid-cols-[1fr_1px_1fr] flex-1 overflow-hidden px-4 pt-3 pb-2 gap-0"
>
<div class="flex flex-col overflow-hidden pr-3">
<div class="flex items-center justify-between mb-1 shrink-0">
<span class="text-[10px] uppercase tracking-widest text-white/30"
>Before</span
>
<button
id="btn-copy-before"
class="text-white/20 hover:text-white/60 transition-colors cursor-pointer"
title="Copy"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
<path
d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
/>
</svg>
</button>
</div>
<div
id="before-text"
class="text-sm text-white/40 leading-relaxed overflow-y-auto min-h-0 select-text cursor-text"
></div>
</div>
<div class="bg-white/10 mx-0"></div>
<div class="flex flex-col overflow-hidden pl-3">
<div class="flex items-center justify-between mb-1 shrink-0">
<span class="text-[10px] uppercase tracking-widest text-white/30"
>After</span
>
<button
id="btn-copy-after"
class="text-white/20 hover:text-white/60 transition-colors cursor-pointer"
title="Copy"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
<path
d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
/>
</svg>
</button>
</div>
<div
id="after-text"
class="text-sm text-white/90 leading-relaxed overflow-y-auto min-h-0 select-text cursor-text"
></div>
</div>
</div>
<!-- No-changes view -->
<div
id="no-changes-view"
class="hidden flex-1 items-center justify-center px-4"
>
<span class="text-sm text-white/50">Everything looks fine ✓</span>
</div>
<!-- Error view -->
<div
id="error-view"
class="hidden flex-1 flex-col items-center justify-center gap-2 px-6 text-center"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="text-red-400/70"
>
<circle cx="12" cy="12" r="10" />
<line x1="12" y1="8" x2="12" y2="12" />
<line x1="12" y1="16" x2="12.01" y2="16" />
</svg>
<span
id="error-message"
class="text-xs text-white/50 leading-relaxed"
></span>
</div>
<div class="shrink-0 border-t border-white/8 px-4 py-2">
<!-- Skeleton buttons -->
<div id="btn-skeleton" class="flex justify-end items-center gap-2">
<div class="h-6 w-14 rounded-lg bg-white/10 animate-pulse"></div>
<div class="h-6 w-12 rounded-lg bg-white/10 animate-pulse"></div>
<div class="h-6 w-20 rounded-lg bg-white/10 animate-pulse"></div>
<div class="h-6 w-16 rounded-lg bg-white/10 animate-pulse"></div>
</div>
<!-- Error buttons -->
<div id="btn-error" class="hidden justify-end items-center gap-2">
<button
id="btn-error-retry"
class="px-3 py-1 text-xs rounded-lg border border-white/10 bg-white/5 text-white/60 hover:bg-white/10 cursor-pointer transition-colors"
>
Retry <kbd class="text-[10px] opacity-60 font-sans ml-1">R</kbd>
</button>
<button
id="btn-error-dismiss"
class="px-3 py-1 text-xs rounded-lg border border-white/10 bg-white/5 text-white/60 hover:bg-white/10 cursor-pointer transition-colors"
>
Dismiss <kbd class="text-[10px] opacity-60 font-sans ml-1">Esc</kbd>
</button>
</div>
<!-- Real buttons -->
<div id="btn-real" class="hidden justify-between items-center gap-2">
<span
id="changes-count"
class="hidden text-[10px] text-white/30"
></span>
<div class="flex items-center gap-2 ml-auto">
<button
id="btn-retry"
class="hidden px-3 py-1 text-xs rounded-lg border border-white/10 bg-white/5 text-white/60 hover:bg-white/10 cursor-pointer transition-colors"
>
Retry <kbd class="text-[10px] opacity-60 font-sans ml-1">R</kbd>
</button>
<button
id="btn-edit"
class="hidden px-3 py-1 text-xs rounded-lg border border-white/10 bg-white/5 text-white/60 hover:bg-white/10 cursor-pointer transition-colors"
>
Edit <kbd class="text-[10px] opacity-60 font-sans ml-1">E</kbd>
</button>
<button
id="btn-dismiss"
class="px-3 py-1 text-xs rounded-lg border border-white/10 bg-white/5 text-white/60 hover:bg-white/10 cursor-pointer transition-colors"
>
Dismiss <kbd class="text-[10px] opacity-60 font-sans ml-1">Esc</kbd>
</button>
<button
id="btn-apply"
class="hidden px-3 py-1 text-xs rounded-lg border border-purple-500/50 bg-purple-600/30 text-purple-200 hover:bg-purple-600/45 cursor-pointer transition-colors"
>
Apply <kbd class="text-[10px] opacity-60 font-sans ml-1">↵</kbd>
</button>
</div>
</div>
</div>
<script type="module" src="/src/widget.ts"></script>
</body>
</html>