mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 21:04:07 +02:00
wip
This commit is contained in:
@@ -5,9 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<template>
|
||||
<div :class="$style.root" class="_pageScrollable">
|
||||
<div :class="$style.screen">
|
||||
<div :class="[$style.screen, { [$style.zen]: isZenMode }]">
|
||||
<canvas ref="canvas" :class="$style.canvas" @keydown="onKeydown" @wheel="onWheel"></canvas>
|
||||
|
||||
<template v-if="!isZenMode">
|
||||
<div v-if="engine != null" class="_buttonsCenter" :class="$style.overlayControls">
|
||||
<template v-if="engine.isEditMode.value">
|
||||
<MkButton v-if="engine.ui.isGrabbing" @click="endGrabbing"><i class="ti ti-check"></i> (E)</MkButton>
|
||||
@@ -34,19 +35,22 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<template v-if="!isZenMode">
|
||||
<div v-if="engine != null" class="_buttons" :class="$style.controls">
|
||||
<!--<MkButton v-for="action in actions" :key="action.key" @click="action.fn">{{ action.label }}{{ hotkeyToLabel(action.hotkey) }}</MkButton>-->
|
||||
<MkButton @click="toggleLight">Toggle Light</MkButton>
|
||||
<MkButton :primary="engine.isEditMode.value" @click="toggleEditMode">Edit mode: {{ engine.isEditMode.value ? 'on' : 'off' }}</MkButton>
|
||||
<MkButton @click="addObject">addObject</MkButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, onMounted, onUnmounted, ref, shallowRef, useTemplateRef, watch } from 'vue';
|
||||
import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, shallowRef, useTemplateRef, watch } from 'vue';
|
||||
import { definePage } from '@/page.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { ensureSignin } from '@/i';
|
||||
@@ -118,9 +122,13 @@ const actions = computed<Action[]>(() => {
|
||||
return actions;
|
||||
});
|
||||
|
||||
const isZenMode = ref(false);
|
||||
|
||||
function onKeydown(ev: KeyboardEvent) {
|
||||
if (engine.value == null) return;
|
||||
|
||||
console.log(ev.code);
|
||||
|
||||
if (ev.code === 'KeyE') {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
@@ -149,6 +157,13 @@ function onKeydown(ev: KeyboardEvent) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
toggleEditMode();
|
||||
} else if (ev.code === 'KeyZ') {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
isZenMode.value = !isZenMode.value;
|
||||
nextTick(() => {
|
||||
resize();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,6 +574,9 @@ definePage(() => ({
|
||||
width: 100%;
|
||||
height: 90cqh;
|
||||
}
|
||||
.screen.zen {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.canvas {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user