Skip to content

Commit

Permalink
enhance(reversi): tweak reversi
Browse files Browse the repository at this point in the history
Resolve #13048
  • Loading branch information
syuilo committed Jan 20, 2024
1 parent f6b7754 commit 3cb543f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file added packages/frontend/assets/reversi/matched.mp3
Binary file not shown.
1 change: 1 addition & 0 deletions packages/frontend/src/pages/reversi/game.board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ $gap: 4px;
aspect-ratio: 1;
transform-style: preserve-3d;
perspective: 150px;
transition: border 0.25s ease, opacity 0.25s ease;

&.boardCell_empty {
border: solid 2px var(--divider);
Expand Down
10 changes: 9 additions & 1 deletion packages/frontend/src/pages/reversi/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<img src="/client-assets/reversi/logo.png" style="display: block; max-width: 100%; max-height: 200px; margin: auto;"/>
</div>

<div class="_panel" style="padding: 16px;">
<div class="_panel _gaps" style="padding: 16px;">
<div class="_buttonsCenter">
<MkButton primary gradate rounded @click="matchAny">{{ i18n.ts._reversi.freeMatch }}</MkButton>
<MkButton primary gradate rounded @click="matchUser">{{ i18n.ts.invite }}</MkButton>
</div>
<div style="font-size: 90%; opacity: 0.7; text-align: center;"><i class="ti ti-music"></i> {{ i18n.ts.soundWillBePlayed }}</div>
</div>

<MkFolder v-if="invitations.length > 0" :defaultOpen="true">
Expand Down Expand Up @@ -101,6 +102,7 @@ import MkPagination from '@/components/MkPagination.vue';
import { useRouter } from '@/global/router/supplier.js';
import * as os from '@/os.js';
import { useInterval } from '@/scripts/use-interval.js';
import * as sound from '@/scripts/sound.js';

const myGamesPagination = {
endpoint: 'reversi/games' as const,
Expand Down Expand Up @@ -141,6 +143,12 @@ const matchingAny = ref<boolean>(false);
function startGame(game: Misskey.entities.ReversiGameDetailed) {
matchingUser.value = null;
matchingAny.value = false;

sound.playUrl('/client-assets/reversi/matched.mp3', {
volume: 1,
playbackRate: 1,
});

router.push(`/reversi/g/${game.id}`);
}

Expand Down

0 comments on commit 3cb543f

Please sign in to comment.