@@ -130,6 +130,21 @@ const length = computed(() => chunks.find(i => i?.[1])?.[1] || 0)
130
130
const id = computed (() => chunks .find (i => i ?.[0 ])?.[0 ] || 0 )
131
131
const picked = computed (() => Array .from ({ length: length .value }, (_ , idx ) => chunks [idx ]))
132
132
const dataUrl = ref <string >()
133
+ const dots = useTemplateRef <HTMLDivElement []>(' dots' )
134
+
135
+ function pluse(index : number ) {
136
+ const el = dots .value ?.[index ]
137
+ if (! el )
138
+ return
139
+ el .style .transition = ' none'
140
+ el .style .transform = ' scale(1.3)'
141
+ el .style .filter = ' hue-rotate(90deg)'
142
+ // // force reflow
143
+ void el .offsetWidth
144
+ el .style .transition = ' transform 0.3s, filter 0.3s'
145
+ el .style .transform = ' none'
146
+ el .style .filter = ' none'
147
+ }
133
148
134
149
async function scanFrame() {
135
150
shutterCount .value += 1
@@ -146,6 +161,7 @@ async function scanFrame() {
146
161
const data = JSON .parse (result .text ) as SliceData
147
162
if (Array .isArray (data )) {
148
163
chunks [data [2 ]] = data
164
+ pluse (data [2 ])
149
165
150
166
// Bandwidth calculation
151
167
{
@@ -188,19 +204,28 @@ watch(() => results.value.size, (size) => {
188
204
<a v-if =" dataUrl" :href =" dataUrl" download =" foo.png" >Download</a >
189
205
<pre v-if =" error" text-red v-text =" error" />
190
206
<div relative h-full max-h-150 max-w-150 w-full >
191
- <video ref =" video" autoplay muted playsinline aspect-ratio-1 h-full w-full controls =" false" />
207
+ <video ref =" video" autoplay muted playsinline aspect-ratio-1 h-full w-full rounded-lg controls =" false" />
192
208
<p absolute bottom-1 right-1 border rounded-md bg-black px2 py1 text-white font-mono shadow >
193
209
{{ fps.toFixed(0) }}hz | {{ shutterCount }} | {{ currentBandwidthFormatted }}
194
210
</p >
211
+ <div absolute left-1 right-1 top-1 >
212
+ <div flex =" ~ gap-0.4 wrap" >
213
+ <div
214
+ v-for =" x, idx in picked"
215
+ :key =" idx"
216
+ ref =" dots"
217
+ h-4
218
+ w-4
219
+ border =" ~ gray rounded"
220
+ :class =" x ? 'bg-green border-green4' : 'bg-gray:50'"
221
+ />
222
+ </div >
223
+ <div mt-1 w-max rounded bg-black:40 px1 text-sm >
224
+ {{ picked.filter(p => !!p).length }} / {{ length }}
225
+ </div >
226
+ </div >
195
227
</div >
196
- <div flex =" ~ gap-1 wrap" max-w-150 w-full >
197
- <div
198
- v-for =" x, idx in picked" :key =" idx"
199
- h-5 w-5
200
- border =" ~ gray:10 rounded"
201
- :class =" x ? 'bg-green' : '' "
202
- />
203
- </div >
228
+
204
229
<div >{{ { length, id } }}</div >
205
230
<!-- <div>{{ chunks }}</div> -->
206
231
</div >
0 commit comments