Skip to content

Commit

Permalink
Update WidgetSpinner.vue
Browse files Browse the repository at this point in the history
edit style
  • Loading branch information
pernucia committed Nov 20, 2024
1 parent 8e43f07 commit 9903b04
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/frontend/src/widgets/WidgetSpinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<MkContainer data-cy-mkw-spinner class="mkw-spinner" >
<div ref="spinner" class="spinner-box transition" style="transform: 0.8s ease-in-out" :style="{ height: widgetProps.height + 'px' }" @click="rotation">
<div ref="spinner" class="spinner-box transition" :style="{ height: widgetProps.height + 'px', transform: `rotate(${widgetProps.degree}deg)`}" @click="rotation">
<img class="spinner" :src="widgetProps.imgURL" />
</div>
</MkContainer>
Expand All @@ -31,6 +31,11 @@ const widgetPropsDef = {
type: 'boolean' as const,
default: false,
},
degree: {
type: 'number' as const,
default: 0,
hidden: true,
},
};

type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
Expand All @@ -53,7 +58,7 @@ const rotation = () => {
let index = Math.round(Math.random());
let value = widgetProps.fullThrottle ? 360 : (Math.floor(Math.random()*12)+1)*30

Check failure on line 59 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Operator '*' must be spaced

Check failure on line 59 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Operator '+' must be spaced

Check failure on line 59 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Operator '*' must be spaced

Check failure on line 59 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Missing semicolon
deg.value = index == 0 ? deg.value + value : deg.value - value

Check failure on line 60 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Expected '===' and instead saw '=='

Check failure on line 60 in packages/frontend/src/widgets/WidgetSpinner.vue

View workflow job for this annotation

GitHub Actions / lint (frontend)

Missing semicolon
style.transform = `rotate(${deg.value}deg)`;
widgetProps.degree = deg.value;
};

defineExpose<WidgetComponentExpose>({
Expand All @@ -73,6 +78,7 @@ defineExpose<WidgetComponentExpose>({
display: flex;
justify-content: center;
align-items: center;
transition: transform 0.8s ease-in-out;

> .spinner {
position: absolute;
Expand Down

0 comments on commit 9903b04

Please sign in to comment.