Skip to content

Commit

Permalink
add index page for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Hendrik Helms committed Nov 13, 2022
1 parent a84867f commit 34fb7f0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.html
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>
25 changes: 25 additions & 0 deletions src/App.vue
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>
4 changes: 4 additions & 0 deletions src/main.ts
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');

0 comments on commit 34fb7f0

Please sign in to comment.