add day 8

This commit is contained in:
Zoe
2022-09-30 16:27:12 -05:00
parent 99c70324ee
commit d21957e97c
28 changed files with 4165 additions and 0 deletions

29
day8/src/pages/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import { Counter } from '../components/counter';
import { TextInput } from '../components/textInput';
import { MyDad } from '../components/myDad';
import { RouterLink } from '../components/routerLink';
export default () => {
return `
<div class="grid place-items-center p-3 content-center min-h-screen">
<div class="p-6 border-neutral-800 rounded-lg container__content border">
${Counter()}
<br/>
${TextInput()}
<br/>
${MyDad()}
<br/>
1 + 2 = {1 + 2}
<br/>
<p d-if="appState.contents.count == 3">The cound is exactly 3.</p>
"string" substringed with 0, 1 = {"string".substring(0, 1)}
<div class="flex gap-1 justify-center">
Go to ${RouterLink('/page2', 'Page 2')}
</div>
</div>
</div>
`;
}
export const layout = 'default'

22
day8/src/pages/page2.ts Normal file
View File

@@ -0,0 +1,22 @@
import { Counter } from '../components/counter';
import { TextInput } from '../components/textInput';
import { RouterLink } from '../components/routerLink';
import { CookieInput } from '../components/cookieInput';
export default () => {
return `
<div class="grid place-items-center p-3 content-center min-h-screen">
<div class="p-6 border-neutral-800 rounded-lg container__content border">
${Counter()}
<br/>
${TextInput()}
<br/>
${CookieInput()}
<br/>
<div class="flex gap-1 justify-center">
Go to ${RouterLink('/subroute/page', 'subroute page')}
</div>
</div>
</div>
`
}

View File

@@ -0,0 +1,16 @@
import { Counter } from '../../components/counter';
import { RouterLink } from '../../components/routerLink';
export default () => {
return `
<div class="grid place-items-center p-3 content-center min-h-screen">
<div class="p-6 border-neutral-800 rounded-lg container__content border">
${Counter()}
<br/>
<div class="flex gap-1 justify-center">
return ${RouterLink('/', 'home')}
</div>
</div>
</div>
`
}