feat(web): setup basic svelte-tailwind webapp
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<script lang="ts">
|
||||
let count = $state(0);
|
||||
|
||||
function increment() {
|
||||
count += 1;
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen bg-zinc-950 text-zinc-100 flex items-center justify-center">
|
||||
<div class="text-center">
|
||||
<h1 class="mb-6 text-3xl font-bold">
|
||||
svelte tests
|
||||
</h1>
|
||||
|
||||
<button
|
||||
onclick={increment}
|
||||
class="
|
||||
rounded-lg
|
||||
bg-blue-600
|
||||
px-5 py-2.5
|
||||
font-semibold
|
||||
text-white
|
||||
shadow-lg
|
||||
transition
|
||||
hover:bg-blue-500
|
||||
active:scale-95
|
||||
"
|
||||
>
|
||||
Clicked {count} {count === 1 ? "time" : "times"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
}
|
||||
+7
-12
@@ -1,14 +1,9 @@
|
||||
import { Color, Solver } from "wordle-solver";
|
||||
import "./app.css";
|
||||
import { mount } from "svelte";
|
||||
import App from "./App.svelte";
|
||||
|
||||
const button = document.getElementById("my-button")! as HTMLButtonElement;
|
||||
const out = document.getElementById("out")! as HTMLTextAreaElement;
|
||||
const guess = document.getElementById("guess")! as HTMLInputElement;
|
||||
|
||||
var s: Solver = Solver.new();
|
||||
out.innerText = s.stats();
|
||||
|
||||
button.addEventListener("click", () => {
|
||||
let val = guess.value;
|
||||
s.guess(val, Array.from({ length: val.length }, () => Color.GREY ));
|
||||
out.innerText = s.stats();
|
||||
const app = mount(App, {
|
||||
target: document.getElementById("app")!,
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user