parent
6f7d29185f
commit
fedc5ffb7a
13 changed files with 116 additions and 8 deletions
|
@ -57,7 +57,6 @@
|
||||||
- Quotes have solid border
|
- Quotes have solid border
|
||||||
- Reply limit bug fixed
|
- Reply limit bug fixed
|
||||||
- Make showing the update popup optional
|
- Make showing the update popup optional
|
||||||
- Obliteration of Ai-chan
|
|
||||||
- [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996)
|
- [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996)
|
||||||
- [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021)
|
- [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021)
|
||||||
- [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956)
|
- [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956)
|
||||||
|
|
|
@ -61,4 +61,5 @@ describe('After user signed in', () => {
|
||||||
buildWidgetTest('jobQueue');
|
buildWidgetTest('jobQueue');
|
||||||
buildWidgetTest('button');
|
buildWidgetTest('button');
|
||||||
buildWidgetTest('aiscript');
|
buildWidgetTest('aiscript');
|
||||||
|
buildWidgetTest('aichan');
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
_lang_: "English"
|
_lang_: "English"
|
||||||
headlineMisskey: "An open source, decentralized social media platform that's free forever! 🚀"
|
headlineMisskey: "A network connected by notes"
|
||||||
introMisskey: "Welcome! Calckey is an open source, decentralized microblogging service.\nCreate \"notes\" to share your thoughts with everyone around you. 📡\nWith \"reactions\", you can also quickly express your feelings about everyone's notes. 👍\nLet's explore a new world! 🚀"
|
introMisskey: "Welcome! Calckey is an open source, decentralized microblogging service.\nCreate \"notes\" to share your thoughts with everyone around you. 📡\nWith \"reactions\", you can also quickly express your feelings about everyone's notes. 👍\nLet's explore a new world! 🚀"
|
||||||
monthAndDay: "{month}/{day}"
|
monthAndDay: "{month}/{day}"
|
||||||
search: "Search"
|
search: "Search"
|
||||||
|
|
|
@ -15,7 +15,7 @@ export const packedUserLiteSchema = {
|
||||||
username: {
|
username: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
example: 'calc',
|
example: 'ai',
|
||||||
},
|
},
|
||||||
host: {
|
host: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|
|
@ -34,11 +34,11 @@ export const errors = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'418': {
|
'418': {
|
||||||
'I_AM_CALC': {
|
'I_AM_AI': {
|
||||||
value: {
|
value: {
|
||||||
error: {
|
error: {
|
||||||
message: 'You sent a request to Calc, Calckey\'s resident stoner furry, instead of the server.',
|
message: 'You sent a request to Ai-chan, Misskey\'s showgirl, instead of the server.',
|
||||||
code: 'I_AM_CALC',
|
code: 'I_AM_AI',
|
||||||
id: '60c46cd1-f23a-46b1-bebe-5d2b73951a84',
|
id: '60c46cd1-f23a-46b1-bebe-5d2b73951a84',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -156,7 +156,7 @@ export function genOpenapiSpec() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'418': {
|
'418': {
|
||||||
description: 'I\'m Calc',
|
description: 'I\'m Ai',
|
||||||
content: {
|
content: {
|
||||||
'application/json': {
|
'application/json': {
|
||||||
schema: {
|
schema: {
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default defineComponent({
|
||||||
async openDialog() {
|
async openDialog() {
|
||||||
os.alert({
|
os.alert({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: 'Oh my Calc',
|
title: 'Oh my Aichan',
|
||||||
text: 'Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
text: 'Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormSwitch v-model="disableDrawer" class="_formBlock">{{ i18n.ts.disableDrawer }}</FormSwitch>
|
<FormSwitch v-model="disableDrawer" class="_formBlock">{{ i18n.ts.disableDrawer }}</FormSwitch>
|
||||||
<FormSwitch v-model="showUpdates" class="_formBlock">{{ i18n.ts.showUpdates }}</FormSwitch>
|
<FormSwitch v-model="showUpdates" class="_formBlock">{{ i18n.ts.showUpdates }}</FormSwitch>
|
||||||
|
<FormSwitch v-model="aiChanMode">{{ i18n.ts.aiChanMode }}</FormSwitch>
|
||||||
|
|
||||||
<FormRadios v-model="fontSize" class="_formBlock">
|
<FormRadios v-model="fontSize" class="_formBlock">
|
||||||
<template #label>{{ i18n.ts.fontSize }}</template>
|
<template #label>{{ i18n.ts.fontSize }}</template>
|
||||||
|
@ -145,6 +146,7 @@ const enterSendsMessage = computed(defaultStore.makeGetterSetter('enterSendsMess
|
||||||
const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu'));
|
const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu'));
|
||||||
const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
|
const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
|
||||||
const showUpdates = computed(defaultStore.makeGetterSetter('showUpdates'));
|
const showUpdates = computed(defaultStore.makeGetterSetter('showUpdates'));
|
||||||
|
const aiChanMode = computed(defaultStore.makeGetterSetter('aiChanMode'));
|
||||||
|
|
||||||
watch(lang, () => {
|
watch(lang, () => {
|
||||||
localStorage.setItem('lang', lang.value as string);
|
localStorage.setItem('lang', lang.value as string);
|
||||||
|
@ -173,6 +175,7 @@ watch([
|
||||||
useSystemFont,
|
useSystemFont,
|
||||||
enableInfiniteScroll,
|
enableInfiniteScroll,
|
||||||
squareAvatars,
|
squareAvatars,
|
||||||
|
aiChanMode,
|
||||||
showGapBetweenNotesInTimeline,
|
showGapBetweenNotesInTimeline,
|
||||||
instanceTicker,
|
instanceTicker,
|
||||||
overridedDeviceKind,
|
overridedDeviceKind,
|
||||||
|
|
|
@ -84,6 +84,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
|
||||||
'squareAvatars',
|
'squareAvatars',
|
||||||
'numberOfPageCache',
|
'numberOfPageCache',
|
||||||
'showUpdates',
|
'showUpdates',
|
||||||
|
'aiChanMode',
|
||||||
];
|
];
|
||||||
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
||||||
'lightTheme',
|
'lightTheme',
|
||||||
|
|
|
@ -247,6 +247,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||||
where: 'device',
|
where: 'device',
|
||||||
default: 5,
|
default: 5,
|
||||||
},
|
},
|
||||||
|
aiChanMode: {
|
||||||
|
where: 'device',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
enterSendsMessage: {
|
enterSendsMessage: {
|
||||||
where: 'device',
|
where: 'device',
|
||||||
default: true,
|
default: true,
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
<XWidgets v-if="widgetsShowing" class="tray"/>
|
<XWidgets v-if="widgetsShowing" class="tray"/>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
|
<iframe v-if="$store.state.aiChanMode" ref="live2d" class="ivnzpscs" src="https://misskey-dev.github.io/mascot-web/?scale=2&y=1.4"></iframe>
|
||||||
|
|
||||||
<XCommon/>
|
<XCommon/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -144,6 +146,28 @@ onMounted(() => {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
isDesktop = (window.innerWidth >= DESKTOP_THRESHOLD);
|
isDesktop = (window.innerWidth >= DESKTOP_THRESHOLD);
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
|
|
||||||
|
if (defaultStore.state.aiChanMode) {
|
||||||
|
const iframeRect = live2d.getBoundingClientRect();
|
||||||
|
window.addEventListener('mousemove', ev => {
|
||||||
|
live2d.contentWindow.postMessage({
|
||||||
|
type: 'moveCursor',
|
||||||
|
body: {
|
||||||
|
x: ev.clientX - iframeRect.left,
|
||||||
|
y: ev.clientY - iframeRect.top,
|
||||||
|
},
|
||||||
|
}, '*');
|
||||||
|
}, { passive: true });
|
||||||
|
window.addEventListener('touchmove', ev => {
|
||||||
|
live2d.contentWindow.postMessage({
|
||||||
|
type: 'moveCursor',
|
||||||
|
body: {
|
||||||
|
x: ev.touches[0].clientX - iframeRect.left,
|
||||||
|
y: ev.touches[0].clientY - iframeRect.top,
|
||||||
|
},
|
||||||
|
}, '*');
|
||||||
|
}, { passive: true });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
74
packages/client/src/widgets/aichan.vue
Normal file
74
packages/client/src/widgets/aichan.vue
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
<template>
|
||||||
|
<MkContainer :naked="widgetProps.transparent" :show-header="false" class="mkw-aichan">
|
||||||
|
<iframe ref="live2d" class="dedjhjmo" src="https://misskey-dev.github.io/mascot-web/?scale=1.5&y=1.1&eyeY=100" @click="touched"></iframe>
|
||||||
|
</MkContainer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||||
|
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
|
||||||
|
import { GetFormResultType } from '@/scripts/form';
|
||||||
|
|
||||||
|
const name = 'ai';
|
||||||
|
|
||||||
|
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<{ (ev: 'updateProps', props: WidgetProps); }>();
|
||||||
|
|
||||||
|
const { widgetProps, configure } = useWidgetPropsManager(name,
|
||||||
|
widgetPropsDef,
|
||||||
|
props,
|
||||||
|
emit,
|
||||||
|
);
|
||||||
|
|
||||||
|
const live2d = ref<HTMLIFrameElement>();
|
||||||
|
|
||||||
|
const touched = () => {
|
||||||
|
//if (this.live2d) this.live2d.changeExpression('gurugurume');
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMousemove = (ev: MouseEvent) => {
|
||||||
|
const iframeRect = live2d.value.getBoundingClientRect();
|
||||||
|
live2d.value.contentWindow.postMessage({
|
||||||
|
type: 'moveCursor',
|
||||||
|
body: {
|
||||||
|
x: ev.clientX - iframeRect.left,
|
||||||
|
y: ev.clientY - iframeRect.top,
|
||||||
|
},
|
||||||
|
}, '*');
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
window.addEventListener('mousemove', onMousemove, { passive: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.removeEventListener('mousemove', onMousemove);
|
||||||
|
});
|
||||||
|
|
||||||
|
defineExpose<WidgetComponentExpose>({
|
||||||
|
name,
|
||||||
|
configure,
|
||||||
|
id: props.widget ? props.widget.id : null,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dedjhjmo {
|
||||||
|
width: 100%;
|
||||||
|
height: 350px;
|
||||||
|
border: none;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -22,6 +22,7 @@ export default function(app: App) {
|
||||||
app.component('MkwInstanceCloud', defineAsyncComponent(() => import('./instance-cloud.vue')));
|
app.component('MkwInstanceCloud', defineAsyncComponent(() => import('./instance-cloud.vue')));
|
||||||
app.component('MkwButton', defineAsyncComponent(() => import('./button.vue')));
|
app.component('MkwButton', defineAsyncComponent(() => import('./button.vue')));
|
||||||
app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue')));
|
app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue')));
|
||||||
|
app.component('MkwAichan', defineAsyncComponent(() => import('./aichan.vue')));
|
||||||
}
|
}
|
||||||
|
|
||||||
export const widgets = [
|
export const widgets = [
|
||||||
|
@ -46,4 +47,5 @@ export const widgets = [
|
||||||
'jobQueue',
|
'jobQueue',
|
||||||
'button',
|
'button',
|
||||||
'aiscript',
|
'aiscript',
|
||||||
|
'aichan',
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue