diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-09-04 17:54:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-04 17:54:24 +0900 |
| commit | 8407702b38ead9fab4aab6698b9e0be1457218a0 (patch) | |
| tree | b7ed8987d1bacc19a4e6b8a829bf92bc70ee5d76 /src/client/ui | |
| parent | Tune download (#2) (diff) | |
| download | misskey-8407702b38ead9fab4aab6698b9e0be1457218a0.tar.gz misskey-8407702b38ead9fab4aab6698b9e0be1457218a0.tar.bz2 misskey-8407702b38ead9fab4aab6698b9e0be1457218a0.zip | |
藍モード (#7687)
* wip
* wip
* シンボリックリンクやめた
* install lib dependency
* bring live2d assets from misskey-dev/assets
* refactor
* nanka iroiro
* コミット忘れ
* random motion
* wip
* run git submodule update --init
* コミット忘れ
* refactor
* fix bug
* Update misskey-assets
* lint
* lint
* lint
* 藍モード修正 (#7702)
* lazy load live2d script
* fix typo
* lazy load also widget
* hot link to cubism core
* https://github.com/misskey-dev/misskey/pull/7702/files#r695623821
* fix lint
* remove live2d stuff
* use iframe
* update
* Update gulpfile.ts
* update
* Update .gitattributes
* update
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Diffstat (limited to 'src/client/ui')
| -rw-r--r-- | src/client/ui/default.vue | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index 23b63114cc..eef693faef 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -54,12 +54,14 @@ <XWidgets v-if="widgetsShowing" class="tray"/> </transition> + <iframe v-if="$store.state.aiChanMode" class="ivnzpscs" ref="live2d" src="https://misskey-dev.github.io/mascot-web/?scale=2&y=1.4"></iframe> + <XCommon/> </div> </template> <script lang="ts"> -import { defineComponent, defineAsyncComponent } from 'vue'; +import { defineComponent, defineAsyncComponent, markRaw } from 'vue'; import { instanceName } from '@client/config'; import { StickySidebar } from '@client/scripts/sticky-sidebar'; import XSidebar from './default.sidebar.vue'; @@ -131,6 +133,19 @@ export default defineComponent({ this.isMobile = (window.innerWidth <= MOBILE_THRESHOLD); this.isDesktop = (window.innerWidth >= DESKTOP_THRESHOLD); }, { passive: true }); + + if (this.$store.state.aiChanMode) { + const iframeRect = this.$refs.live2d.getBoundingClientRect(); + window.addEventListener('mousemove', ev => { + this.$refs.live2d.contentWindow.postMessage({ + type: 'moveCursor', + body: { + x: ev.clientX - iframeRect.left, + y: ev.clientY - iframeRect.top, + } + }, '*'); + }, { passive: true }); + } }, methods: { @@ -201,6 +216,10 @@ export default defineComponent({ } }], e); }, + + onAiClick(ev) { + //if (this.live2d) this.live2d.click(ev); + } } }); </script> @@ -458,5 +477,15 @@ export default defineComponent({ overflow: auto; background: var(--bg); } + + > .ivnzpscs { + position: fixed; + bottom: 0; + right: 0; + width: 300px; + height: 600px; + border: none; + pointer-events: none; + } } </style> |