diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..bd17d8e --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,30 @@ +// @ts-check +import { defineConfig } from 'astro/config' +import solidJs from '@astrojs/solid-js' +import compressor from 'astro-compressor' +import robotsTxt from '@itsmatteomanf/astro-robots-txt' +import purgecss from 'astro-purgecss' + +export default defineConfig({ + output: 'static', + prefetch: true, + integrations: [ + solidJs(), + compressor({ gzip: false, brotli: true }), + robotsTxt(), + purgecss({ + fontFace: true, + variables: true, + }), + ], + vite: { + css: { + transformer: 'lightningcss', + }, + }, + build: { + assets: '_fwt', + inlineStylesheets: 'never', + }, + site: 'http://localhost:4321', +}) diff --git a/src/components/Modal/ModalButton.tsx b/src/components/Modal/ModalButton.tsx index ac5ff10..7153a17 100644 --- a/src/components/Modal/ModalButton.tsx +++ b/src/components/Modal/ModalButton.tsx @@ -14,16 +14,12 @@ interface Props { width?: number wide?: boolean class?: string - function?: () => Promise } export default (props: Props) => { const [isOpen, setIsOpen] = createSignal(false) - const openHandler = async () => { - if (props.function) { - await props.function() - } + const openHandler = () => { setIsOpen(true) } @@ -36,7 +32,6 @@ export default (props: Props) => { - - - - - - - ))} + + + + + + + + diff --git a/src/utils/functions/generateFavicon.ts b/src/utils/functions/generateFavicon.ts deleted file mode 100644 index 48c11a6..0000000 --- a/src/utils/functions/generateFavicon.ts +++ /dev/null @@ -1,17 +0,0 @@ -// import sharp from 'sharp' - -// import * as path from 'path' - -// const generateFavicon = async () => { -// const inputSrc = 'src/assets/images/logo.png' -// const faviconPath = path.join(__dirname, '../public/favicon.png') - -// try { -// await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath) -// console.log('Favicon generated successfully') -// } catch (error) { -// console.error('Error generating favicon:', error) -// } -// } - -// export default generateFavicon diff --git a/src/utils/js/generateFavicon.js b/src/utils/js/generateFavicon.js new file mode 100644 index 0000000..4b7924d --- /dev/null +++ b/src/utils/js/generateFavicon.js @@ -0,0 +1,17 @@ +import sharp from 'sharp' + +const path = require('path') + +const generateFavicon = async () => { + const inputSrc = 'src/assets/images/logo.png' + const faviconPath = path.join(__dirname, '../public/favicon.png') + + try { + await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath) + console.log('Favicon generated successfully') + } catch (error) { + console.error('Error generating favicon:', error) + } +} + +export default generateFavicon