forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and misskey-project | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<template> | ||
<MkContainer :naked="widgetProps.transparent" :showHeader="false" class="mkw-paplin"> | ||
<img :class="transition" src="https://pub-61d9927ea6b24ad7b33e1db00f6950bf.r2.dev/misskey/files/thumbnail-fa9d86ac-a94b-4226-9712-f2c687c49f74.webp" @click="OnClick" v-bind:style="{transform: `rotate(${deg}deg)`}" alt="refresh-icon-btn" /> | ||
Check failure on line 8 in packages/frontend/src/widgets/WidgetPaplin.vue GitHub Actions / lint (frontend)
Check failure on line 8 in packages/frontend/src/widgets/WidgetPaplin.vue GitHub Actions / lint (frontend)
|
||
</MkContainer> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { onMounted, onUnmounted, shallowRef } from 'vue'; | ||
import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js'; | ||
import { GetFormResultType } from '@/scripts/form.js'; | ||
|
||
const name = 'paplin'; | ||
|
||
const deg = 0; | ||
|
||
const widgetPropsDef = { | ||
transparent: { | ||
type: 'boolean' as const, | ||
default: false, | ||
}, | ||
}; | ||
|
||
type WidgetProps = GetFormResultType<typeof widgetPropsDef>; | ||
|
||
const props = defineProps<WidgetComponentProps<WidgetProps>>(); | ||
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>(); | ||
|
||
const { widgetProps, configure } = useWidgetPropsManager(name, | ||
widgetPropsDef, | ||
props, | ||
emit, | ||
); | ||
|
||
const OnClick = () => { | ||
this.deg += 360; | ||
//if (this.live2d) this.live2d.changeExpression('gurugurume'); | ||
}; | ||
|
||
onMounted(() => { | ||
window.addEventListener('mousemove', onMousemove, { passive: true }); | ||
}); | ||
|
||
onUnmounted(() => { | ||
window.removeEventListener('mousemove', onMousemove); | ||
}); | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.root { | ||
width: 100%; | ||
height: 350px; | ||
border: none; | ||
pointer-events: none; | ||
color-scheme: light; | ||
} | ||
.transition { | ||
transition: transform 1s ease-in-out; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78f97fc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chromatic detects changes. Please review the changes on Chromatic.