Compare commits

..

2 Commits

Author SHA1 Message Date
45f8fdc52d feat: edit widgets color 2022-02-07 18:24:02 +09:00
a3354213d0 feat: edit widgets color 2022-02-07 18:18:26 +09:00
4 changed files with 1 additions and 54 deletions

View File

@ -1252,7 +1252,6 @@ _widgets:
serverMetric: "サーバーメトリクス"
aiscript: "AiScriptコンソール"
aichan: "藍"
nyancat: "Nyan Cat"
_cw:
hide: "隠す"

View File

@ -20,7 +20,6 @@ export default function(app: App) {
app.component('MkwButton', defineAsyncComponent(() => import('./button.vue')));
app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue')));
app.component('MkwAichan', defineAsyncComponent(() => import('./aichan.vue')));
app.component('MkwNyancat', defineAsyncComponent(() => import('./nyancat.vue')));
}
export const widgets = [
@ -43,5 +42,4 @@ export const widgets = [
'button',
'aiscript',
'aichan',
'nyancat',
];

View File

@ -1,50 +0,0 @@
<template>
<MkContainer :naked="widgetProps.transparent" :show-header="false">
<img class="kjhasfa" src="https://raw.githubusercontent.com/Gowee/nyancat-svg/main/nyancat.svg">
</MkContainer>
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { GetFormResultType } from '@/scripts/form';
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
const name = 'nyancat';
const widgetPropsDef = {
transparent: {
type: 'boolean' as const,
default: false,
},
};
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// 現時点ではvueの制限によりimportしたtypeをジェネリックに渡せない
//const props = defineProps<WidgetComponentProps<WidgetProps>>();
//const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps>; }>();
const emit = defineEmits<{ (e: 'updateProps', props: WidgetProps); }>();
const { widgetProps, configure } = useWidgetPropsManager(name,
widgetPropsDef,
props,
emit,
);
defineExpose<WidgetComponentExpose>({
name,
configure,
id: props.widget ? props.widget.id : null,
});
</script>
<style lang="scss" scoped>
.kjhasfa {
width: 100%;
height: auto;
border: none;
pointer-events: none;
}
</style>

View File

@ -29,7 +29,7 @@ const props = defineProps<{
const r = 0.45;
const color = $computed(() => `hsl(${180 - (props.value * 180)}, 80%, 70%)`);
const color = `hsl(248%, 80%, 70%)`;
const strokeDashoffset = $computed(() => (1 - props.value) * (Math.PI * (r * 2)));
</script>