add day 5

This commit is contained in:
Zoe
2022-09-27 21:41:37 -05:00
parent 213b42bb9c
commit 2040570ea2
19 changed files with 2565 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import minus from '../icons/minus.svg'
import plus from '../icons/plus.svg'
import refresh from '../icons/refresh.svg'
export const Counter = () => {
return `
<div class="mb-2">
<h2 class="text-xl font-semibold text-center">count is: {count}</h2>
</div>
<div class="flex justify-center">
<button d-click="appState.contents.count--" class="transition-colors p-3 duration-300 active:bg-red-700 hover:bg-red-600 hover:text-zinc-100 mr-1">
<img src=${minus} alt="minus" />
</button>
<button d-click="appState.contents.count = 0" class="transition-colors p-3 duration-300 active:bg-zinc-700 hover:bg-zinc-800 hover:text-red-100 mr-1">
<img src=${refresh} alt="reset">
</button>
<button d-click="appState.contents.count++" class="transition-colors p-3 duration-300 active:bg-green-700 hover:bg-green-600 hover:text-green-100">
<img src=${plus} alt="plus" />
</button>
</div>
`
}

View File

@@ -0,0 +1,23 @@
export const MyDad = () => {
return `
<div class="mb-2">
<h2 class="text-xl font-semibold text-center">My dad {year}</h2>
</div>
<div class="flex justify-center">
<input placeholder="ex: 1985" class="no-arrows py-2 px-4 resize-none bg-zinc-800 rounded-md shadow-md my-2 border border-zinc-800 placeholder:italic placeholder:text-gray-300" type="number" d-model="year">
</div>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
</style>
`
}

View File

@@ -0,0 +1,5 @@
export const RouterLink = (link: string, name: string) => {
return `
<a href="#" d-click="event.preventDefault(); loadPage('${link}')">${name}</a>
`
}

View File

@@ -0,0 +1,10 @@
export const TextInput = () => {
return `
<div class="mb-2">
<h2 class="text-xl font-semibold text-center">Input is: {text}</h2>
</div>
<div class="flex justify-center">
<input placeholder="text..." class="py-2 px-4 resize-none bg-zinc-800 rounded-md shadow-md my-2 border border-zinc-800 placeholder:italic placeholder:text-gray-300" d-model="text" />
</div>
`
}