Skip to content

Commit

Permalink
add: sw replacement + bigger img on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
domysh committed Sep 4, 2024
1 parent 3aaf6c7 commit 881e8fe
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
1 change: 0 additions & 1 deletion public/_headers
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Cache fix:
/*
Cache-Control: public, max-age=300, s-maxage=600
Clear-Site-Data: "storage"
22 changes: 22 additions & 0 deletions public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// sw.js from https://developer.chrome.com/docs/workbox/remove-buggy-service-workers?hl=it

self.addEventListener('install', () => {
// Skip over the "waiting" lifecycle state, to ensure that our
// new service worker is activated immediately, even if there's
// another tab open controlled by our older service worker code.
self.skipWaiting();
});

self.addEventListener('activate', () => {
// Optional: Get a list of all the current open windows/tabs under
// our service worker's control, and force them to reload.
// This can "unbreak" any open windows/tabs as soon as the new
// service worker activates, rather than users having to manually reload.
self.clients.matchAll({
type: 'window'
}).then(windowClients => {
windowClients.forEach((windowClient) => {
windowClient.navigate(windowClient.url);
});
});
});
1 change: 1 addition & 0 deletions src/components/Common/PageHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const {
_iub.csConfiguration = {"siteId":3746707,"cookiePolicyId":86405163,"lang":"it"};
</script>
<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/3746707.js"></script>
<script type="text/javascript" src="/sw.js" async></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/stable/iubenda_cs.js" charset="UTF-8" async></script>

<title> {title ?? DEVFEST_NAME}</title>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/Jumbo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const t = useTranslations(lang);
<div
class="absolute top-10 md:top-20 left-0 right-0 p-10 text-center text-primary-content flex flex-col align-center z-20"
>
<img src="/assets/vectors/logo_big.svg" class="h-36 m-12" />
<img src="/assets/vectors/logo_big.svg" class="h-36 m-1 my-12 md:m-12" />
<p class="text-3xl md:text-4xl font-semibold">
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/redirect/[url_encoded].astro
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ const t = useTranslations(lang);
</script>
<main class="flex flex-col justify-center items-center" style="width: 100vw; height:100vh">
<div class="jumbo h-192 lg:h-220 p-10 text-center text-primary-content flex flex-col align-center z-20 justify-center" style="width: 100%; height: 100%;">
<img src="/assets/vectors/logo_big.svg" class="h-36 m-2" />
<p class="text-xl md:text-2xl font-semibold">
<img src="/assets/vectors/logo_big.svg" class="h-36 m-2 md:m-6" />
<p class="text-xl md:text-3xl font-semibold">
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
day: "numeric",
Expand All @@ -74,7 +74,7 @@ const t = useTranslations(lang);
})
}
</p>
<p class="text-xl md:text-2xl font-semibold mb-5">{t("info.locationName")}</p>
<p class="text-xl md:text-3xl font-semibold mb-5">{t("info.locationName")}</p>
<p class="mb-2 underline">Per utilizzare questa pagina ti chiediamo di usare il tuo browser!</p>
<p class="underline">Clicca i 3 puntini in alto e seleziona "Apri nel browser esterno"</p>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/ticket.astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import { WebsiteConfig } from "../config"
})
</script>
<div class="jumbo h-192 lg:h-220 p-10 text-center text-primary-content flex flex-col align-center z-20 justify-center" style="width: 100%; height: 100%;">
<img src="/assets/vectors/logo_big.svg" class="h-36 m-12" />
<p class="text-3xl md:text-4xl font-semibold">
<img src="/assets/vectors/logo_big.svg" class="h-36 m-2 md:m-6" />
<p class="text-3xl md:text-4xl font-semibold mt-5">
{
WebsiteConfig.EVENT_START.toLocaleDateString(lang, {
day: "numeric",
Expand All @@ -41,7 +41,6 @@ import { WebsiteConfig } from "../config"
}
</p>
<p class="text-3xl md:text-4xl font-semibold">{t("info.locationName")}</p>

<div class="my-12 flex gap-4 justify-center flex-col md:flex-row">
<a
class="btn-content text-xl"
Expand Down

0 comments on commit 881e8fe

Please sign in to comment.