diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..6463d62 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + plugins: [require('prettier-plugin-svelte')], +} \ No newline at end of file diff --git a/README.md b/README.md index 2d31912..e586902 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,15 @@ npm run prettier ``` Otherwise, the [GitHub Action](.github/workflows/ci.yaml) will create a commit in your branch with a cleanup. + +## Setting the CORS + +### Troubleshooting `aws` + +``` +ls /opt/homebrew/Cellar/awscli/ +/opt/homebrew/Cellar/awscli/${VERSION}/libexec/bin/python3 -m ensurepip --upgrade +/opt/homebrew/Cellar/awscli/${VERSION}/libexec/bin/python3 -m pip install awscli-plugin-endpoint +``` + +Update `~/.aws/config` with `cli_legacy_plugin_path = /opt/homebrew/Cellar/awscli/${VERSION}/libexec/lib/python3.11/site-packages` \ No newline at end of file diff --git a/cors-rules.json b/cors-rules.json index 772837e..4c1355e 100644 --- a/cors-rules.json +++ b/cors-rules.json @@ -8,7 +8,7 @@ "https://staging.gaiacharge.com", "https://partner.gaiacharge.com", "https://partner.staging.gaiagreen.dev", - "https://website-go7pwvgrd-gaia-charge.vercel.app", + "https://website-mlhicv43r-gaia-charge.vercel.app", "https://41ce7c90fae7.ngrok.app" ], "AllowedHeaders": [ diff --git a/package-lock.json b/package-lock.json index ea215a3..6fa2982 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@sentry/browser": "^8.7.0", "@sentry/sveltekit": "^8.7.0", "@sentry/tracing": "^7.71.0", + "aos": "^2.3.4", "axios": "^1.5.0", "negotiator": "^0.6.3", "siema": "^1.5.1", @@ -20,14 +21,15 @@ }, "devDependencies": { "@accuser/svelte-plausible-analytics": "^1.0.0", - "@beyonk/gdpr-cookie-consent-banner": "^10.2.1", - "@beyonk/svelte-hubspot": "^0.5.0", + "@beyonk/gdpr-cookie-consent-banner": "^12.1.4", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "autoprefixer": "^10.4.16", "npm-run-all": "^4.1.5", "postcss": "^8.4.30", + "postcss-import": "^16.1.0", + "postcss-nesting": "^12.1.5", "prettier": "^3.0.3", "prettier-plugin-svelte": "^3.0.3", "svelte": "^4.2.1", @@ -353,31 +355,57 @@ "node": ">=6.9.0" } }, - "node_modules/@beyonk/async-script-loader": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@beyonk/async-script-loader/-/async-script-loader-2.3.0.tgz", - "integrity": "sha512-/vbDM5j8OHmtnWLx87sef0T/jGWVvZV6ILm3QFLpfRwSg0KmhQoAZnOT4XSaUL/EjOC9eMzgX5qtS2jztKzY2A==", - "dev": true - }, "node_modules/@beyonk/gdpr-cookie-consent-banner": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/@beyonk/gdpr-cookie-consent-banner/-/gdpr-cookie-consent-banner-10.2.1.tgz", - "integrity": "sha512-vpqzaVhEgby4M13NgYAyeqmPbWkEE8ix1nr44ID5m01q0D6XaD3M/fTxYIP01dZvHoAulJW6SpmfaEPeuaILpg==", + "version": "12.1.4", + "resolved": "https://registry.npmjs.org/@beyonk/gdpr-cookie-consent-banner/-/gdpr-cookie-consent-banner-12.1.4.tgz", + "integrity": "sha512-W4S50psrX5WMAihwwqFsnNzL0ZF91OHv4EuIMelTD4yTMU09qTU1cKgUJ7Tt8qRvIyTzfbPwiXGrDYUtFJuOtw==", "dev": true, "dependencies": { "js-cookie": "^3.0.1" + } + }, + "node_modules/@csstools/selector-resolve-nested": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-1.1.0.tgz", + "integrity": "sha512-uWvSaeRcHyeNenKg8tp17EVDRkpflmdyvbE0DHo6D/GdBb6PDnCYYU6gRpXhtICMGMcahQmj2zGxwFM/WC8hCg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" }, "peerDependencies": { - "svelte": "^3.54.0 || ^4.0.0" + "postcss-selector-parser": "^6.0.13" } }, - "node_modules/@beyonk/svelte-hubspot": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@beyonk/svelte-hubspot/-/svelte-hubspot-0.5.0.tgz", - "integrity": "sha512-YyRYtjaA+vnQ4kpVgwf3fCUKqH2Tkt68Apvpq8FfBFQCeq8PsvxOJCMsTB69Hl2WmSN6ljZChyGwiDpmnXRh0g==", + "node_modules/@csstools/selector-specificity": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.1.1.tgz", + "integrity": "sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==", "dev": true, - "dependencies": { - "@beyonk/async-script-loader": "^2.2.1" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" } }, "node_modules/@esbuild/aix-ppc64": { @@ -2256,6 +2284,16 @@ "node": ">= 8" } }, + "node_modules/aos": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/aos/-/aos-2.3.4.tgz", + "integrity": "sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==", + "dependencies": { + "classlist-polyfill": "^1.0.3", + "lodash.debounce": "^4.0.6", + "lodash.throttle": "^4.0.1" + } + }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -2567,6 +2605,11 @@ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==" }, + "node_modules/classlist-polyfill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz", + "integrity": "sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ==" + }, "node_modules/cli-color": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz", @@ -4118,11 +4161,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -4807,9 +4860,9 @@ } }, "node_modules/postcss-import": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", - "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-16.1.0.tgz", + "integrity": "sha512-7hsAZ4xGXl4MW+OKEWCnF6T5jqBw80/EE9aXg1r2yyn1RsVEU8EtKXbijEODa+rg7iih4bKf7vlvTGYR4CnPNg==", "dev": true, "dependencies": { "postcss-value-parser": "^4.0.0", @@ -4817,7 +4870,7 @@ "resolve": "^1.1.7" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" }, "peerDependencies": { "postcss": "^8.0.0" @@ -4908,6 +4961,33 @@ "postcss": "^8.2.14" } }, + "node_modules/postcss-nesting": { + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-12.1.5.tgz", + "integrity": "sha512-N1NgI1PDCiAGWPTYrwqm8wpjv0bgDmkYHH72pNsqTCv9CObxjxftdYu6AKtGN+pnJa7FQjMm3v4sp8QJbFsYdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "dependencies": { + "@csstools/selector-resolve-nested": "^1.1.0", + "@csstools/selector-specificity": "^3.1.1", + "postcss-selector-parser": "^6.1.0" + }, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, "node_modules/postcss-selector-parser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", @@ -5935,6 +6015,23 @@ "node": ">=14.0.0" } }, + "node_modules/tailwindcss/node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", diff --git a/package.json b/package.json index a6a0ff5..99ba559 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "cy:run": "cypress run", "cy:open": "cypress open", "test": "run-p --race dev cy:run", - "prettier": "prettier --write **/*.{js,md,svelte}", + "prettier": "prettier --write **/*.{css,js,md,svelte}", "i18n:extract": "svelte-i18n extract 'src/**/*.svelte' > src/services/messages/en.json" }, "dependencies": { @@ -18,6 +18,7 @@ "@sentry/browser": "^8.7.0", "@sentry/sveltekit": "^8.7.0", "@sentry/tracing": "^7.71.0", + "aos": "^2.3.4", "axios": "^1.5.0", "negotiator": "^0.6.3", "siema": "^1.5.1", @@ -26,14 +27,15 @@ }, "devDependencies": { "@accuser/svelte-plausible-analytics": "^1.0.0", - "@beyonk/gdpr-cookie-consent-banner": "^10.2.1", - "@beyonk/svelte-hubspot": "^0.5.0", + "@beyonk/gdpr-cookie-consent-banner": "^12.1.4", "@sveltejs/adapter-auto": "^3.0.0", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "autoprefixer": "^10.4.16", "npm-run-all": "^4.1.5", "postcss": "^8.4.30", + "postcss-import": "^16.1.0", + "postcss-nesting": "^12.1.5", "prettier": "^3.0.3", "prettier-plugin-svelte": "^3.0.3", "svelte": "^4.2.1", @@ -46,4 +48,4 @@ "last 2 versions", "not ie < 10" ] -} \ No newline at end of file +} diff --git a/postcss.config.js b/postcss.config.js index 2e7af2b..68884fa 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -2,5 +2,7 @@ export default { plugins: { tailwindcss: {}, autoprefixer: {}, + 'postcss-import': {}, + 'postcss-nesting': {}, }, } diff --git a/src/app.css b/src/app.css index 7c0e6c9..e3e05e8 100644 --- a/src/app.css +++ b/src/app.css @@ -1,43 +1,4 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import "./styles/_main.css"; +@import "./styles/dots.css"; +@import "./styles/cookies.css"; -body { - background: theme(colors.gray); - overflow-x: hidden; -} - -section { - scroll-margin-block-start: 6rem; -} - -@media only screen and (max-width: 431px) { - body{ - width: 100vw; - } - .w-full { - height: 100vh; - } - h1{ - font-size: 40px !important; - line-height: 48px !important; - } - p{ - font-size: 18px !important; - line-height: 28px !important; - } - #svelte{ - overflow: hidden; - } - .contact{ - width: 190px !important; - height: 60px; - margin-block-start: 48px !important; - padding: 16px 26px !important;; - font-size: 18px !important;; - line-height: 28px !important; - } - .contact img { - width: 16px !important; - } -} \ No newline at end of file diff --git a/src/app.html b/src/app.html index 829e98e..94e6a78 100644 --- a/src/app.html +++ b/src/app.html @@ -23,6 +23,8 @@ + + %sveltekit.head%
+
{#each $locales as locale} {locale} @@ -71,13 +68,6 @@ diff --git a/src/components/Partners.svelte b/src/components/Partners.svelte index 4ebfb00..1da8d4d 100644 --- a/src/components/Partners.svelte +++ b/src/components/Partners.svelte @@ -30,13 +30,10 @@ diff --git a/src/components/Well.svelte b/src/components/Well.svelte index 79161d2..0727c1e 100644 --- a/src/components/Well.svelte +++ b/src/components/Well.svelte @@ -4,66 +4,63 @@ {#if !$isLoading} - - - - - {$_("whatForYou.evidence.uptitle", { - default: "We are not just another installer", - })} - - - - {$_("whatForYou.evidence.title", { - default: "Contact us and see the difference our service makes", - })} - - - - {$_("whatForYou.evidence.p1", { - default: "Free consultation", - })} - - - - {$_("whatForYou.evidence.p2", { - default: "Tailor-made solution", + + + + + {$_("whatForYou.evidence.uptitle", { + default: "We are not just another installer", })} - - - - {$_("whatForYou.evidence.p3", { - default: "No fine print", + + + + {$_("whatForYou.evidence.title", { + default: "Contact us and see the difference our service makes", })} - - - - - {$_("contactBtn.cta", { - default: "Contacto", - })} - - + + + + {$_("whatForYou.evidence.p1", { + default: "Free consultation", + })} + + + + {$_("whatForYou.evidence.p2", { + default: "Tailor-made solution", + })} + + + + {$_("whatForYou.evidence.p3", { + default: "No fine print", + })} + + + + + {$_("contactBtn.cta", { + default: "Contacto", + })} + + + - - + {/if} diff --git a/src/components/WhatWeDo.svelte b/src/components/WhatWeDo.svelte index 93dfcd3..939f04d 100644 --- a/src/components/WhatWeDo.svelte +++ b/src/components/WhatWeDo.svelte @@ -98,9 +98,13 @@ - + {$_("whatWeDo.maintenance.title")} @@ -117,9 +121,13 @@ - + {$_("whatWeDo.payments.title")} @@ -136,10 +144,6 @@ {/if} diff --git a/src/components/common/Carousel.svelte b/src/components/common/Carousel.svelte index 20a639d..10bd49e 100644 --- a/src/components/common/Carousel.svelte +++ b/src/components/common/Carousel.svelte @@ -9,7 +9,7 @@ let slider, prev, next, radioSlider; //let select = 0; - export let dots = true; + // export let dots = true; let currentIndex = 0; $: select = 0; $: pips = slider ? slider.innerElements : []; @@ -32,66 +32,56 @@ rtl: false, onInit: () => {}, onChange: () => {}, - }); //end Siema constructor + }); + //end Siema constructor prev = () => { slider.prev(); if (select > 0) { select--; + } else { + select = totalDots - 1; } }; + next = () => { slider.next(); - if (select >= 0) { + + if (select < totalDots - 1) { select++; + } else { + select = 0; } }; - }); //end onMount - - export function isDotActive(dotIndex) { - // if (currentIndex < 0) currentIndex = pips.length + currentIndex; - // return currentIndex >= dotIndex*currentPerPage && currentIndex < (dotIndex*currentPerPage)+currentPerPage - console.log(select, dotIndex); - return select === dotIndex; - } - - export function left() { - slider.prev(); - } - - export function right() { - slider.next(); - } + }); export function go(index) { slider.goTo(index); + select = index; } - const images = [ + let images = [ { + id: 'evSales', url: evsales, - header: $_("carousel.evSales.header", { - default: "Because the sales of electric vehicles keep increasing", - }), + header: "Because the sales of electric vehicles keep increasing", description: $_("carousel.evSales.description", { default: "Sales of EV already surpassed those of Diesel and the best selling car of the world is an EV.", }), }, { + id: 'greatCustomers', url: great_customers, - header: $_("carousel.greatCustomers.header", { - default: "Because the EV drivers make for great customers", - }), + header: "Because the EV drivers make for great customers", description: $_("carousel.greatCustomers.description", { default: "On average they are more welthy, spend more and are more loyal.", }), }, { + id: 'fleetSavings', url: fleet_savings, - header: $_("carousel.fleetSavings.header", { - default: "Because switching your fleet to EVs can save you money", - }), + header: "Because switching your fleet to EVs can save you money", description: $_("carousel.fleetSavings.description", { default: "Running costs of EVs are fraction of the price of combustion vehicles.", @@ -104,26 +94,40 @@ {#each images as src, imageIndex (src)} - {src.header} - + + {$_(`carousel.${src.id}.header`, { + default: src.header, + })} + + - {src.description} + {$_(`carousel.${src.id}.description`, { + default: src.description, + })} {/each} - + {#each { length: totalDots } as e, i} - go(i * currentPerPage)} - on:keypress={() => go(i * currentPerPage)} - class={isDotActive(i) ? "active" : ""} - > + go(i)} + > + {i} + {/each} - + - + - + - :root { - --ratio: 1440 * 1vw * 100; - } .slider { background-color: white; border-radius: calc(20 / var(--ratio)); @@ -187,23 +188,7 @@ left: -1%; } - ul { - list-style-type: none; - position: absolute; - display: flex; - justify-content: center; - width: 100%; - margin-top: -30px; - padding: 0; - } - ul li { - margin: 6px; - border-radius: 100%; - background-color: #dbdbdb; - height: 12px; - width: 12px; - } - ul li.active { - background-color: #6c6c6c; + .dots--visible { + margin-block-start: calc(40 / var(--ratio)); } diff --git a/src/components/common/CarouselMobile.svelte b/src/components/common/CarouselMobile.svelte index f33855a..b2ef197 100644 --- a/src/components/common/CarouselMobile.svelte +++ b/src/components/common/CarouselMobile.svelte @@ -45,7 +45,8 @@ if (indexSlideCarousel > 0) { indexSlideCarousel--; const w = - document.getElementById("carousel-mobile-slider").offsetWidth / 6; + document.getElementById("carousel-mobile-slider").offsetWidth / + numberOfSlideCarousel; document.getElementById("carousel-mobile-slider").scrollLeft -= w; } } @@ -53,12 +54,14 @@ if (indexSlideCarousel < numberOfSlideCarousel) { indexSlideCarousel++; const w = - document.getElementById("carousel-mobile-slider").offsetWidth / 6; + document.getElementById("carousel-mobile-slider").offsetWidth / + numberOfSlideCarousel; document.getElementById("carousel-mobile-slider").scrollLeft += w; } } let carousel; $: indexByDotCarousel = 0; + export const checkPosition = (position) => { if (position === 0) indexByDotCarousel = 0; else { @@ -70,13 +73,15 @@ indexByDotCarousel = Math.floor(position / w); } }; + export const goTo = (index) => { - const w = - document.getElementById("carousel-mobile-slider").scrollWidth / + const containerW = + document.getElementById("carousel-mobile-slider").offsetWidth * numberOfSlideCarousel; + const w = containerW / numberOfSlideCarousel; const to = (index - indexByDotCarousel) * w; + document.getElementById("carousel-mobile-slider").scrollLeft += to; - indexByDotCarousel = index; }; @@ -122,21 +127,23 @@ /> - + + {#each { length: numberOfSlideCarousel } as _, i} - goTo(i)} - > + > + {i} + {/each} - + {/if} diff --git a/src/components/menu/Hamburger.svelte b/src/components/menu/Hamburger.svelte index 6c14d31..db3fb06 100644 --- a/src/components/menu/Hamburger.svelte +++ b/src/components/menu/Hamburger.svelte @@ -1,46 +1,49 @@ - open = !open}> - - - - - + (open = !open)} +> + + + + + \ No newline at end of file + transform: translate(-12px, 13px) rotate(-45deg); + } + diff --git a/src/components/menu/SideBar.svelte b/src/components/menu/SideBar.svelte index 8c52073..ea35a33 100644 --- a/src/components/menu/SideBar.svelte +++ b/src/components/menu/SideBar.svelte @@ -1,81 +1,92 @@ - \ No newline at end of file + } + diff --git a/src/hooks.client.js b/src/hooks.client.js index d403b25..0aeaf55 100644 --- a/src/hooks.client.js +++ b/src/hooks.client.js @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/sveltekit'; +import * as Sentry from "@sentry/sveltekit"; Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, @@ -11,7 +11,7 @@ Sentry.init({ // If the entire session is not sampled, use the below sample rate to sample // sessions when an error occurs. replaysOnErrorSampleRate: 1.0, - + integrations: [ Sentry.replayIntegration({ // Additional SDK configuration goes in here, for example: diff --git a/src/hooks.server.js b/src/hooks.server.js index 07d4b91..f635844 100644 --- a/src/hooks.server.js +++ b/src/hooks.server.js @@ -1,6 +1,6 @@ import { sequence } from "@sveltejs/kit/hooks"; import { handleErrorWithSentry, sentryHandle } from "@sentry/sveltekit"; -import * as Sentry from '@sentry/sveltekit'; +import * as Sentry from "@sentry/sveltekit"; import { VITE_SENTRY_DSN } from "$env/static/private"; Sentry.init({ diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e36588c..d3fc389 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,14 +1,96 @@ @@ -17,7 +99,7 @@ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c551159..9c8c892 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -21,6 +21,7 @@ onMount(() => { console.log("the component has mounted"); + setTimeout(() => { const element = document.getElementById("contact"); if (contactStatus) element.scrollIntoView({ behavior: "instant" }); @@ -44,34 +45,3 @@ - - diff --git a/src/routes/[slug]/+layout.svelte b/src/routes/[slug]/+layout.svelte index 447890d..14575f7 100644 --- a/src/routes/[slug]/+layout.svelte +++ b/src/routes/[slug]/+layout.svelte @@ -1,5 +1,10 @@ @@ -17,7 +26,7 @@ diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte index a058c1c..b473263 100644 --- a/src/routes/[slug]/+page.svelte +++ b/src/routes/[slug]/+page.svelte @@ -21,6 +21,7 @@ onMount(() => { console.log("the component has mounted"); + setTimeout(() => { const element = document.getElementById("contact"); if (contactStatus) element.scrollIntoView({ behavior: "instant" }); @@ -44,34 +45,3 @@ - - diff --git a/src/schema.js b/src/schema.js index f5b8c6c..89da4a5 100644 --- a/src/schema.js +++ b/src/schema.js @@ -3,16 +3,10 @@ import * as yup from "yup"; const schema = yup.object().shape({ firstname: yup.string().required("First name is required"), lastname: yup.string().required("Last name is required"), - company: yup - .string() - .required("Company is required"), + company: yup.string().required("Company is required"), email: yup.string().required("Email is required").email("Email is invalid"), - phone: yup - .string() - .required("Phone is required"), - message: yup - .string() - .required("Message is required") + phone: yup.string().required("Phone is required"), + message: yup.string().required("Message is required"), }); -export default schema; \ No newline at end of file +export default schema; diff --git a/src/service-worker.js b/src/service-worker.js index ff496b4..654625f 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -14,7 +14,7 @@ self.addEventListener("install", (event) => { .then((cache) => cache.addAll(to_cache)) .then(() => { self.skipWaiting(); - }) + }), ); }); @@ -27,7 +27,7 @@ self.addEventListener("activate", (event) => { } self.clients.claim(); - }) + }), ); }); @@ -80,6 +80,6 @@ self.addEventListener("fetch", (event) => { throw err; } - }) + }), ); }); diff --git a/src/services/contents.js b/src/services/contents.js index b996ab7..4790dae 100644 --- a/src/services/contents.js +++ b/src/services/contents.js @@ -1,3 +1,3 @@ export default [ - "one","two" + "one", "two", "three", "four" ]; \ No newline at end of file diff --git a/src/services/messages/en.json b/src/services/messages/en.json index 0c0f0fb..87200d2 100644 --- a/src/services/messages/en.json +++ b/src/services/messages/en.json @@ -173,7 +173,23 @@ "howToStart": { "title": "How can you get started?", "subtitle": "You could call your electrician to install a basic EV charger from Amazon, but in realitythe installation is just the first step to a very complex ecosystem.", - "alt": "Example aspects to keep in mind" + "alt": "Example aspects to keep in mind", + "list": { + "hts01": "Usage reports", + "hts02": "Equipment upgrades", + "hts03": "Updates", + "hts04": "Network connection", + "hts05": "Business development", + "hts06": "Project preparation", + "hts07": "Billing", + "hts08": "Signage", + "hts09": "System integrations", + "hts10": "Preventive maintenance", + "hts11": "Certificate rotation", + "hts12": "Technical feasibility", + "hts13": "Status monitoring", + "hts14": "Legislative changes" + } }, "nav": { "need": "Why you need it", @@ -206,5 +222,27 @@ }, "privacyPolicy": { "title": "Privacy Policy" + }, + "sliderContent": { + "one": { + "description": "Gaia Charge made the process of installing an electric vehicle charger for our co-workers extremely easy. We just pay a monthly fee and forget about everything. It was all taken care of.", + "name": "Miracle Martinez", + "who": "Generador Coworking" + }, + "two": { + "description": "Since Gaia Charge manages the public charger I usually use, the previous nightmare is over. The availability and speed of charging has improved a lot and the technical service is now impeccable and fast in the few incidents that have occurred.", + "name": "Vicente Meneu", + "who": "User" + }, + "three": { + "description": "I got to know Gaia Charge as a customer of their electric chargers. I wanted to meet them personally because I had never received such a personalized and professional attention.", + "name": "Juan Fernando Bou Pérez", + "who": "Bou Consultores" + }, + "four": { + "description": "After years of experience, I can say that Gaia Charge has surprised me positively with its quick and direct attention in any situation (...) I hope that more towns will follow the example of Alboraya and the management company.", + "name": "Francisco J Montesinos Ramirez", + "who": "User" + } } } diff --git a/src/services/messages/es-ES.json b/src/services/messages/es-ES.json index 7d2ac62..daccb78 100644 --- a/src/services/messages/es-ES.json +++ b/src/services/messages/es-ES.json @@ -173,7 +173,23 @@ "howToStart": { "title": "¿Cómo puedes empezar?", "subtitle": "Podrías llamar a tu electricista para que te instale un cargador básico de Amazon, pero en realidad la instalación es sólo el primer paso de un ecosistema muy complejo.", - "alt": "Ejemplos de aspectos a tener en cuenta" + "alt": "Ejemplos de aspectos a tener en cuenta", + "list": { + "hts01": "Informes de uso", + "hts02": "Mejoreas del equipamientro", + "hts03": "Actualizaciones", + "hts04": "Conexión a la red", + "hts05": "Consultoría de negocios", + "hts06": "Preparación del proyecto", + "hts07": "Facturación", + "hts08": "Señalización", + "hts09": "Integraciones con sistemas propios", + "hts10": "Mantenimiento preventivo", + "hts11": "Rotación de certificados", + "hts12": "Viabilidad técnica", + "hts13": "Monitoreo de estado", + "hts14": "Cambios de legislación" + } }, "nav": { "need": "Por qué lo necesitas", @@ -206,5 +222,27 @@ }, "privacyPolicy": { "title": "Política de privacidad" + }, + "sliderContent": { + "one": { + "description": "Gaia Charge hizo que el proceso de instalación de un cargador de vehículos eléctricos para nuestros compañeros de trabajo fuera extremadamente fácil. Sólo pagamos una cuota mensual y nos olvidamos. Todo quedó resuelto.", + "name": "Miracle Martinez", + "who": "Generador Coworking" + }, + "two": { + "description": "Desde que Gaia Charge gestiona el cargador público que suelo utilizar, se acabó la pesadilla anterior. La disponibilidad y velocidad de carga ha mejorado mucho y el servicio técnico es ahora impecable y rápido en las pocas incidencias que ha habido.", + "name": "Vicente Meneu", + "who": "Usuario" + }, + "three": { + "description": "Conocí la empresa Gaia Charge al ser cliente de sus cargadores eléctricos. Quise conocerlos personalmente porqué nunca había recibido una atención tan personalizada y profesional.", + "name": "Juan Fernando Bou Pérez", + "who": "Bou Consultores" + }, + "four": { + "description": "Después de años de experiencias, puedo decir que Gaia Charge me ha sorprendido positivamente con su atención rápida y directa en cualquier situación. (...) Espero que más poblaciones sigan el ejemplo de Alboraya y la empresa gestora.", + "name": "Francisco J Montesinos Ramirez", + "who": "Usuario" + } } } \ No newline at end of file diff --git a/src/styles/_main.css b/src/styles/_main.css new file mode 100644 index 0000000..7d8d2c7 --- /dev/null +++ b/src/styles/_main.css @@ -0,0 +1,79 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --ratio: 1440 * 1vw * 100; +} + +html { + scroll-behavior: smooth; +} + +body { + background: theme(colors.gray); + overflow-x: hidden; +} + +section { + scroll-margin-block-start: 6rem; +} + +@media only screen and (max-width: 431px) { + body { + width: 100vw; + } + + .w-full { + height: 100vh; + } + + h1 { + font-size: 40px !important; + line-height: 48px !important; + } + + p { + font-size: 18px !important; + line-height: 28px !important; + } + + #svelte { + overflow: hidden; + } + + .contact { + width: 190px !important; + height: 60px; + margin-block-start: 48px !important; + padding: 16px 26px !important; + font-size: 18px !important; + line-height: 28px !important; + } + + .contact img { + width: 16px !important; + } +} + +em { + font-style: normal; + position: relative; + + &::before { + display: inline-block; + height: calc(4 / var(--ratio)); + width: 100%; + background: theme("colors.green"); + content: ""; + position: absolute; + left: 0; + bottom: calc(2 / var(--ratio)); + z-index: -1; + } +} + +h1 em::before { + height: calc(8 / var(--ratio)); + bottom: calc(8 / var(--ratio)); +} \ No newline at end of file diff --git a/src/styles/cookies.css b/src/styles/cookies.css new file mode 100644 index 0000000..43ff825 --- /dev/null +++ b/src/styles/cookies.css @@ -0,0 +1,113 @@ +@import "@beyonk/gdpr-cookie-consent-banner/banner.css"; + +.cookieConsentWrapper { + background: transparent; + padding-inline: 1rem; + width: 100%; + + position: fixed; + left: 50%; + transform: translateX(-50%); + bottom: 3rem; + + display: flex; + align-items: flex-start; + justify-content: bottom; + + @media (min-width: 600px) { + width: calc(1280 / var(--ratio)); + padding-inline: 0; + } +} + +.cookieConsent { + padding: 2rem; + background-color: theme("colors.white"); + color: theme("colors.black"); + border-radius: 1.25rem; + max-width: 40rem; + margin: 0; + + display: flex; + flex-direction: column; + align-items: stretch; + gap: 1.5em; + + font-size: .875rem; + + @media (min-width: 600px) { + font-size: 1rem; + padding: 3.75rem 2.5rem; + } +} + +.cookieConsentOperations__List { + border-radius: 1.25rem; +} + +.cookieConsentOperations__Item label::after { + background: theme("colors.white"); +} + +.cookieConsentOperations__Item input:checked+label::before { + background: theme("colors.green"); +} + +.cookieConsentOperations__Item.disabled label::after, +.cookieConsentOperations__Item.disabled label::before { + opacity: .6; +} + +/* LEFT */ +.cookieConsent__Content { + color: theme("colors.blue"); + margin: 0; + + display: flex; + align-items: flex-start; + flex-direction: column; + gap: 1em; +} + +.cookieConsent__Title { + font-family: theme("fontFamily.serif"); + font-weight: 500; + font-size: 2em; + margin: 0; +} + +.cookieConsent__Description { + font-weight: 300; + font-size: 1.125em; + margin: 0; +} + +.cookieConsent__Description a { + color: theme("colors.green"); +} + +/* RIGHT */ +.cookieConsent__Right { + gap: 0.5em; + margin: 0; + flex-wrap: wrap; +} + +.cookieConsent__Button { + border-radius: 5rem; + border: 1px solid theme("colors.medium-blue"); + color: theme("colors.medium-blue"); + margin: 0; +} + +.cookieConsent__Button--Close, +.cookieConsent__Button[aria-label="Confirm all"], +.cookieConsent__Button[aria-label="Accept all"] { + background-color: theme("colors.medium-blue"); + color: theme("colors.white"); + flex: 1 1 auto; +} + +.cookieConsent__Button--Close { + margin-left: auto; +} \ No newline at end of file diff --git a/src/styles/dots.css b/src/styles/dots.css new file mode 100644 index 0000000..236712f --- /dev/null +++ b/src/styles/dots.css @@ -0,0 +1,34 @@ +.dots { + display: none; + + justify-content: center; + gap: 12px; + width: 100%; + padding: 0; + + &.dots--visible { + display: flex; + } + + @media only screen and (max-width: 431px) { + display: flex; + } +} + +.dots__button { + appearance: none; + border-radius: 100%; + background-color: #dbdbdb; + height: 12px; + width: 12px; + transition: background-color .2s; + + &:hover, + &:active { + background-color: #999; + } + + &.active { + background-color: #6c6c6c; + } +} \ No newline at end of file diff --git a/static/global.css b/static/global.css index 5d78539..8da26c2 100644 --- a/static/global.css +++ b/static/global.css @@ -2,80 +2,111 @@ * New Spirit */ @font-face { - font-family: 'New Spirit'; - font-style: light; - font-weight: 300; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Light.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Light.woff) format("woff"); + font-family: "New Spirit"; + font-style: light; + font-weight: 300; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Light.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Light.woff) + format("woff"); } @font-face { - font-family: 'New Spirit'; - font-style: normal; - font-weight: 400; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Regular.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Regular.woff) format("woff"); + font-family: "New Spirit"; + font-style: normal; + font-weight: 400; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Regular.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Regular.woff) + format("woff"); } @font-face { - font-family: 'New Spirit'; - font-style: medium; - font-weight: 500; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Medium.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Medium.woff) format("woff"); + font-family: "New Spirit"; + font-style: medium; + font-weight: 500; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Medium.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Medium.woff) + format("woff"); } @font-face { - font-family: 'New Spirit'; - font-style: semibold; - font-weight: 600; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-SemiBold.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-SemiBold.woff) format("woff"); + font-family: "New Spirit"; + font-style: semibold; + font-weight: 600; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-SemiBold.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-SemiBold.woff) + format("woff"); } @font-face { - font-family: 'New Spirit'; - font-style: bold; - font-weight: 800; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Bold.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Bold.woff) format("woff"); + font-family: "New Spirit"; + font-style: bold; + font-weight: 800; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Bold.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Bold.woff) + format("woff"); } @font-face { - font-family: 'New Spirit'; - font-style: black; - font-weight: 900; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Heavy.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Heavy.woff) format("woff"); + font-family: "New Spirit"; + font-style: black; + font-weight: 900; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Heavy.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/NewSpirit-Heavy.woff) + format("woff"); } /* * Neue Haas Grotesk Display Pro */ @font-face { - font-family: 'Neue Haas Grotesk Display Pro'; - font-style: thin; - font-weight: 100; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaythin-webfont.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaythin-webfont.woff) format("woff"); + font-family: "Neue Haas Grotesk Display Pro"; + font-style: thin; + font-weight: 100; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaythin-webfont.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaythin-webfont.woff) + format("woff"); } @font-face { - font-family: 'Neue Haas Grotesk Display Pro'; - font-style: light; - font-weight: 300; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaylight-webfont.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaylight-webfont.woff) format("woff"); + font-family: "Neue Haas Grotesk Display Pro"; + font-style: light; + font-weight: 300; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaylight-webfont.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaylight-webfont.woff) + format("woff"); } @font-face { - font-family: 'Neue Haas Grotesk Display Pro'; - font-style: normal; - font-weight: 400; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplayroman-webfont.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplayroman-webfont.woff) format("woff"); + font-family: "Neue Haas Grotesk Display Pro"; + font-style: normal; + font-weight: 400; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplayroman-webfont.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplayroman-webfont.woff) + format("woff"); } @font-face { - font-family: 'Neue Haas Grotesk Display Pro'; - font-style: medium; - font-weight: 500; - src: url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaymediu-webfont.woff2) format("woff2"), - url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaymediu-webfont.woff) format("woff"); + font-family: "Neue Haas Grotesk Display Pro"; + font-style: medium; + font-weight: 500; + src: + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaymediu-webfont.woff2) + format("woff2"), + url(https://gaia-fonts.s3.fr-par.scw.cloud/neuehaasdisplaymediu-webfont.woff) + format("woff"); } -html, body { - font-family: 'Neue Haas Grotesk Display Pro', sans-serif; -} \ No newline at end of file +html, +body { + font-family: "Neue Haas Grotesk Display Pro", sans-serif; +} diff --git a/vite.config.js b/vite.config.js index 69b0b68..4741410 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,13 @@ +import { fileURLToPath, URL } from 'node:url' import { sentrySvelteKit } from "@sentry/sveltekit"; import { sveltekit } from "@sveltejs/kit/vite"; /** @type {import('vite').UserConfig} */ const config = { + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, plugins: [sentrySvelteKit({ sourceMapsUploadOptions: { org: "gaia-charge",
- {$_("whatForYou.evidence.uptitle", { - default: "We are not just another installer", - })} -
- {$_("whatForYou.evidence.p1", { - default: "Free consultation", - })} -
- {$_("whatForYou.evidence.p2", { - default: "Tailor-made solution", + + + + + {$_("whatForYou.evidence.uptitle", { + default: "We are not just another installer", })} - - - - {$_("whatForYou.evidence.p3", { - default: "No fine print", + + + + {$_("whatForYou.evidence.title", { + default: "Contact us and see the difference our service makes", })} - - - - - {$_("contactBtn.cta", { - default: "Contacto", - })} - - + + + + {$_("whatForYou.evidence.p1", { + default: "Free consultation", + })} + + + + {$_("whatForYou.evidence.p2", { + default: "Tailor-made solution", + })} + + + + {$_("whatForYou.evidence.p3", { + default: "No fine print", + })} + + + + + {$_("contactBtn.cta", { + default: "Contacto", + })} + + + -
+ {$_("whatForYou.evidence.uptitle", { + default: "We are not just another installer", })} -
- {$_("whatForYou.evidence.p3", { - default: "No fine print", +
+ {$_("whatForYou.evidence.p1", { + default: "Free consultation", + })} +
+ {$_("whatForYou.evidence.p2", { + default: "Tailor-made solution", + })} +
+ {$_("whatForYou.evidence.p3", { + default: "No fine print", + })} +
- {src.description} + {$_(`carousel.${src.id}.description`, { + default: src.description, + })}