-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luca Hendrik Helms
committed
Nov 13, 2022
1 parent
a84867f
commit 34fb7f0
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import { TheChessboard, type ChessboardAPI, type BoardConfig } from '@/index'; | ||
import '@/assets/board.css'; | ||
const boardAPI = ref<ChessboardAPI>(); | ||
const boardConfig: BoardConfig = { | ||
coordinates: false, | ||
autoCastle: false, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<main> | ||
<section role="region" aria-label="Board Controls"> | ||
<button type="button" @click="boardAPI?.board.toggleOrientation()"> | ||
Toggle orientation | ||
</button> | ||
<button type="button" @click="boardAPI?.resetBoard()">Reset</button> | ||
<button type="button" @click="boardAPI?.undoLastMove()">Undo</button> | ||
<button type="button" @click="boardAPI?.toggleThreats()">Threats</button> | ||
</section> | ||
<TheChessboard :board-config="boardConfig" /> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createApp } from 'vue'; | ||
import App from './App.vue'; | ||
|
||
createApp(App).mount('#app'); |