Obliteration of Ai-chan 🐱🔫
This commit is contained in:
parent
4cfda11f8c
commit
7095abf728
@ -57,6 +57,7 @@
|
||||
- Quotes have solid border
|
||||
- Reply limit bug fixed
|
||||
- Make showing the update popup optional
|
||||
- Obliteration of Ai-chan
|
||||
- [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996)
|
||||
- [OAuth bearer token authentication](https://github.com/misskey-dev/misskey/pull/9021)
|
||||
- [Styled Repair Tools](https://github.com/misskey-dev/misskey/pull/8956)
|
||||
|
@ -61,5 +61,4 @@ describe('After user signed in', () => {
|
||||
buildWidgetTest('jobQueue');
|
||||
buildWidgetTest('button');
|
||||
buildWidgetTest('aiscript');
|
||||
buildWidgetTest('aichan');
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
_lang_: "English"
|
||||
headlineMisskey: "A network connected by notes"
|
||||
headlineMisskey: "An open source, decentralized social media platform that's free forever! 🚀"
|
||||
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}"
|
||||
search: "Search"
|
||||
|
@ -15,7 +15,7 @@ export const packedUserLiteSchema = {
|
||||
username: {
|
||||
type: 'string',
|
||||
nullable: false, optional: false,
|
||||
example: 'ai',
|
||||
example: 'calc',
|
||||
},
|
||||
host: {
|
||||
type: 'string',
|
||||
|
@ -34,11 +34,11 @@ export const errors = {
|
||||
},
|
||||
},
|
||||
'418': {
|
||||
'I_AM_AI': {
|
||||
'I_AM_CALC': {
|
||||
value: {
|
||||
error: {
|
||||
message: 'You sent a request to Ai-chan, Misskey\'s showgirl, instead of the server.',
|
||||
code: 'I_AM_AI',
|
||||
message: 'You sent a request to Calc, Calckey\'s resident stoner furry, instead of the server.',
|
||||
code: 'I_AM_CALC',
|
||||
id: '60c46cd1-f23a-46b1-bebe-5d2b73951a84',
|
||||
},
|
||||
},
|
||||
|
@ -156,7 +156,7 @@ export function genOpenapiSpec() {
|
||||
},
|
||||
},
|
||||
'418': {
|
||||
description: 'I\'m Ai',
|
||||
description: 'I\'m Calc',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
|
@ -59,7 +59,7 @@ export default defineComponent({
|
||||
async openDialog() {
|
||||
os.alert({
|
||||
type: 'warning',
|
||||
title: 'Oh my Aichan',
|
||||
title: 'Oh my Calc',
|
||||
text: 'Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
|
||||
});
|
||||
},
|
||||
|
@ -57,7 +57,6 @@
|
||||
</FormSwitch>
|
||||
<FormSwitch v-model="disableDrawer" class="_formBlock">{{ i18n.ts.disableDrawer }}</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">
|
||||
<template #label>{{ i18n.ts.fontSize }}</template>
|
||||
@ -146,7 +145,6 @@ const enterSendsMessage = computed(defaultStore.makeGetterSetter('enterSendsMess
|
||||
const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu'));
|
||||
const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
|
||||
const showUpdates = computed(defaultStore.makeGetterSetter('showUpdates'));
|
||||
const aiChanMode = computed(defaultStore.makeGetterSetter('aiChanMode'));
|
||||
|
||||
watch(lang, () => {
|
||||
localStorage.setItem('lang', lang.value as string);
|
||||
@ -175,7 +173,6 @@ watch([
|
||||
useSystemFont,
|
||||
enableInfiniteScroll,
|
||||
squareAvatars,
|
||||
aiChanMode,
|
||||
showGapBetweenNotesInTimeline,
|
||||
instanceTicker,
|
||||
overridedDeviceKind,
|
||||
|
@ -84,7 +84,6 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
|
||||
'squareAvatars',
|
||||
'numberOfPageCache',
|
||||
'showUpdates',
|
||||
'aiChanMode',
|
||||
];
|
||||
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
||||
'lightTheme',
|
||||
|
@ -247,10 +247,6 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||
where: 'device',
|
||||
default: 5,
|
||||
},
|
||||
aiChanMode: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
enterSendsMessage: {
|
||||
where: 'device',
|
||||
default: true,
|
||||
|
@ -34,8 +34,6 @@
|
||||
<XWidgets v-if="widgetsShowing" class="tray"/>
|
||||
</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/>
|
||||
</div>
|
||||
</template>
|
||||
@ -146,28 +144,6 @@ onMounted(() => {
|
||||
window.addEventListener('resize', () => {
|
||||
isDesktop = (window.innerWidth >= DESKTOP_THRESHOLD);
|
||||
}, { 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>
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
<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,7 +22,6 @@ export default function(app: App) {
|
||||
app.component('MkwInstanceCloud', defineAsyncComponent(() => import('./instance-cloud.vue')));
|
||||
app.component('MkwButton', defineAsyncComponent(() => import('./button.vue')));
|
||||
app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue')));
|
||||
app.component('MkwAichan', defineAsyncComponent(() => import('./aichan.vue')));
|
||||
}
|
||||
|
||||
export const widgets = [
|
||||
@ -47,5 +46,4 @@ export const widgets = [
|
||||
'jobQueue',
|
||||
'button',
|
||||
'aiscript',
|
||||
'aichan',
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user