Files
100DaysOfCode/day89/src/components/cookieInput.devto
2022-12-20 23:10:04 -06:00

20 lines
877 B
Plaintext

<div class="mb-2">
<h2 class="text-xl font-semibold text-center">Username cookie is: {appState.contents.cookie}</h2>
</div>
<div class="flex justify-center flex-col mx-auto mb-2 w-fit">
<input placeholder="username..."
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="cookieData" />
<button
class="bg-blue-600 font-semibold rounded-md py-2.5 px-2 text-sm hover:bg-blue-700 active:bg-blue-800 transition-colors"
d-on:click="appState.contents.cookie = appState.contents.cookieData; setCookie('username', appState.contents.cookieData, '365', 'Lax');">Submit
Cookie</button>
</div>
<script setup>
console.log('page is first get')
</script>
<script>
console.log('page is fully loaded');
</script>