@@ -258,6 +258,29 @@ const sparkline = ref(
258
258
]
259
259
)
260
260
261
+ function calcTickStart (angle , distance = 1 ) {
262
+ const angleStart = 29.85 ;
263
+ return {
264
+ x: 200 + 160 * Math .cos (angleStart + angle * Math .PI / 180 ) * distance,
265
+ y: 200 + 160 * Math .sin (angleStart + angle * Math .PI / 180 ) * distance
266
+ }
267
+ }
268
+
269
+ const ticks = computed (() => {
270
+ const tickArray = [];
271
+ const tickAmount = 100 ;
272
+ for (let i = 0 ; i < tickAmount; i += 1 ) {
273
+ tickArray .push ({
274
+ x1: calcTickStart ((360 / tickAmount) * i).x ,
275
+ y1: calcTickStart ((360 / tickAmount) * i).y ,
276
+ x2: calcTickStart ((360 / tickAmount) * i, 0.9 ).x ,
277
+ y2: calcTickStart ((360 / tickAmount) * i, 0.9 ).y ,
278
+ color: skeletonConfig .value .style .wheel .color
279
+ })
280
+ }
281
+ return tickArray;
282
+ })
283
+
261
284
</script >
262
285
263
286
<template >
@@ -271,6 +294,63 @@ const sparkline = ref(
271
294
</g >
272
295
</svg >
273
296
</template >
297
+ <!-- TYPE RINGS -->
298
+ <template v-if =" type === ' rings' " >
299
+ <svg data-cy =" skeleton-rings" width =" 100%" viewBox =" 0 0 400 400" :style =" `background:${skeletonConfig.style.backgroundColor}`" >
300
+ <circle
301
+ :cx =" 200"
302
+ :cy =" 200"
303
+ :r =" 180"
304
+ :fill =" `${skeletonConfig.style.rings.color}${opacity[40]}`"
305
+ />
306
+ <circle
307
+ :cx =" 200"
308
+ :cy =" 250"
309
+ :r =" 130"
310
+ :fill =" `${skeletonConfig.style.rings.color}${opacity[60]}`"
311
+ />
312
+ <circle
313
+ :cx =" 200"
314
+ :cy =" 290"
315
+ :r =" 90"
316
+ :fill =" `${skeletonConfig.style.rings.color}${opacity[100]}`"
317
+ />
318
+ </svg >
319
+ </template >
320
+
321
+ <!-- TYPE WHEEL -->
322
+ <template v-if =" type === ' wheel' " >
323
+ <svg data-cy =" skeleton-wheel" width =" 100%" viewBox =" 0 0 400 400" :style =" `background:${skeletonConfig.style.backgroundColor}`" >
324
+ <line
325
+ v-for =" (tick, i) in ticks"
326
+ :x1 =" tick.x1"
327
+ :x2 =" tick.x2"
328
+ :y1 =" tick.y1"
329
+ :y2 =" tick.y2"
330
+ :stroke =" i < 66 ? tick.color : `${tick.color}${opacity[50]}`"
331
+ :stroke-width =" 5"
332
+ stroke-linecap =" round"
333
+ />
334
+ <circle
335
+ :cx =" 200"
336
+ :cy =" 200"
337
+ :r =" 130"
338
+ :stroke-width =" 3"
339
+ :stroke =" `${skeletonConfig.style.wheel.color}${opacity[50]}`"
340
+ fill =" none"
341
+ />
342
+ <rect
343
+ :fill =" `${skeletonConfig.style.wheel.color}${opacity[50]}`"
344
+ :rx =" 12"
345
+ :x =" 160"
346
+ :y =" 170"
347
+ :height =" 60"
348
+ :width =" 80"
349
+ stroke =" none"
350
+ />
351
+ </svg >
352
+ </template >
353
+
274
354
<!-- TYPE SPARKLINE -->
275
355
<template v-if =" type === ' sparkline' " >
276
356
<svg data-cy =" skeleton-sparkline" width =" 100%" viewBox =" 0 0 150 32" :style =" `background:${skeletonConfig.style.backgroundColor}`" >
0 commit comments