Merge branch 'develop' into reversi
This commit is contained in:
		@@ -4,29 +4,36 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
<Suspense>
 | 
			
		||||
	<template #fallback>
 | 
			
		||||
		<MkLoading v-if="!inline ?? true"/>
 | 
			
		||||
	</template>
 | 
			
		||||
	<code v-if="inline" :class="$style.codeInlineRoot">{{ code }}</code>
 | 
			
		||||
	<XCode v-else-if="show && lang" :code="code" :lang="lang"/>
 | 
			
		||||
	<pre v-else-if="show" :class="$style.codeBlockFallbackRoot"><code :class="$style.codeBlockFallbackCode">{{ code }}</code></pre>
 | 
			
		||||
	<button v-else :class="$style.codePlaceholderRoot" @click="show = true">
 | 
			
		||||
		<div :class="$style.codePlaceholderContainer">
 | 
			
		||||
			<div><i class="ti ti-code"></i> {{ i18n.ts.code }}</div>
 | 
			
		||||
			<div>{{ i18n.ts.clickToShow }}</div>
 | 
			
		||||
		</div>
 | 
			
		||||
<code v-if="inline" :class="$style.codeInlineRoot">{{ code }}</code>
 | 
			
		||||
<div v-else :class="$style.codeBlockRoot">
 | 
			
		||||
	<button :class="$style.codeBlockCopyButton" class="_button" @click="copy">
 | 
			
		||||
		<i class="ti ti-copy"></i>
 | 
			
		||||
	</button>
 | 
			
		||||
</Suspense>
 | 
			
		||||
	<Suspense>
 | 
			
		||||
		<template #fallback>
 | 
			
		||||
			<MkLoading />
 | 
			
		||||
		</template>
 | 
			
		||||
		<XCode v-if="show && lang" :code="code" :lang="lang"/>
 | 
			
		||||
		<pre v-else-if="show" :class="$style.codeBlockFallbackRoot"><code :class="$style.codeBlockFallbackCode">{{ code }}</code></pre>
 | 
			
		||||
		<button v-else :class="$style.codePlaceholderRoot" @click="show = true">
 | 
			
		||||
			<div :class="$style.codePlaceholderContainer">
 | 
			
		||||
				<div><i class="ti ti-code"></i> {{ i18n.ts.code }}</div>
 | 
			
		||||
				<div>{{ i18n.ts.clickToShow }}</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</button>
 | 
			
		||||
	</Suspense>
 | 
			
		||||
</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts" setup>
 | 
			
		||||
import { defineAsyncComponent, ref } from 'vue';
 | 
			
		||||
import * as os from '@/os.js';
 | 
			
		||||
import MkLoading from '@/components/global/MkLoading.vue';
 | 
			
		||||
import { defaultStore } from '@/store.js';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
 | 
			
		||||
 | 
			
		||||
defineProps<{
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
	code: string;
 | 
			
		||||
	lang?: string;
 | 
			
		||||
	inline?: boolean;
 | 
			
		||||
@@ -35,9 +42,30 @@ defineProps<{
 | 
			
		||||
const show = ref(!defaultStore.state.dataSaver.code);
 | 
			
		||||
 | 
			
		||||
const XCode = defineAsyncComponent(() => import('@/components/MkCode.core.vue'));
 | 
			
		||||
 | 
			
		||||
function copy() {
 | 
			
		||||
	copyToClipboard(props.code);
 | 
			
		||||
	os.success();
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style module lang="scss">
 | 
			
		||||
.codeBlockRoot {
 | 
			
		||||
	position: relative;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.codeBlockCopyButton {
 | 
			
		||||
	color: #D4D4D4;
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	top: 8px;
 | 
			
		||||
	right: 8px;
 | 
			
		||||
	opacity: 0.5;
 | 
			
		||||
 | 
			
		||||
	&:hover {
 | 
			
		||||
		opacity: 0.8;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.codeInlineRoot {
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
 | 
			
		||||
 
 | 
			
		||||
@@ -990,7 +990,7 @@ export class DropAndFusionGame extends EventEmitter<{
 | 
			
		||||
}> {
 | 
			
		||||
	private PHYSICS_QUALITY_FACTOR = 16; // 低いほどパフォーマンスが高いがガタガタして安定しなくなる、逆に高すぎても何故か不安定になる
 | 
			
		||||
	private COMBO_INTERVAL = 60; // frame
 | 
			
		||||
	public readonly GAME_VERSION = 2;
 | 
			
		||||
	public readonly GAME_VERSION = 3;
 | 
			
		||||
	public readonly GAME_WIDTH = 450;
 | 
			
		||||
	public readonly GAME_HEIGHT = 600;
 | 
			
		||||
	public readonly DROP_COOLTIME = 30; // frame
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user