-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { defineConfig } from 'astro/config' | ||
import mdx from '@astrojs/mdx' | ||
import tailwind from '@astrojs/tailwind' | ||
import compress from 'astro-compress' | ||
import { defineConfig } from 'astro/config'; | ||
import mdx from '@astrojs/mdx'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import compress from 'astro-compress'; | ||
|
||
import preact from "@astrojs/preact"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
compressHTML: true, | ||
integrations: [mdx(), tailwind({ | ||
applyBaseStyles: false, | ||
}), compress()], | ||
}) | ||
applyBaseStyles: false | ||
}), compress(), preact()] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
--- | ||
import TextInput from "../scripts/textInput"; | ||
--- | ||
|
||
<div class="container"> | ||
<div class="mb-16 text-6xl text-center"> | ||
<div class="text-input mb-16 text-3xl text-center"> | ||
<input type="text" value="Buscar sitios que aceptan Bitcoin..." class="text-input" /> | ||
</div> | ||
<div class="text-input mb-16 text-3xl text-center"> | ||
<TextInput client:load /> | ||
</div> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.text-input { | ||
padding: 0.5rem; | ||
color: var(--neutral-700); | ||
background-color: var(--1000); | ||
font-family: 'Open Sans', sans-serif; | ||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; | ||
} | ||
</style> | ||
|
||
.text-input { | ||
padding: 0.5rem; | ||
color: var(--neutral-700); | ||
background-color: var(--1000); | ||
font-family: 'Open Sans', sans-serif; | ||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; | ||
} | ||
.input { | ||
padding: 0.5rem; | ||
color: var(--neutral-700); | ||
background-color: var(--1000); | ||
font-family: 'Open Sans', sans-serif; | ||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// TextInput.jsx | ||
import { h } from 'preact'; | ||
import { useEffect, useRef } from 'preact/hooks'; | ||
|
||
const TextInput = () => { | ||
const inputRef = useRef(null); | ||
|
||
useEffect(() => { | ||
const handleFocus = (event) => { | ||
event.target.select(); | ||
event.target.classList.add('blinking'); | ||
}; | ||
|
||
const handleBlur = (event) => { | ||
event.target.classList.remove('blinking'); | ||
}; | ||
|
||
const input = inputRef.current; | ||
input.addEventListener('focus', handleFocus); | ||
input.addEventListener('blur', handleBlur); | ||
|
||
return () => { | ||
input.removeEventListener('focus', handleFocus); | ||
input.removeEventListener('blur', handleBlur); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div class="text-input"> | ||
<input | ||
type="text" | ||
value="Buscar sitios que aceptan Bitcoin..." | ||
ref={inputRef} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TextInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "astro/tsconfigs/base", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "preact" | ||
} | ||
} |