4 Commits

Author SHA1 Message Date
c5c06ea85d Update src/app/page.tsx 2026-06-03 14:38:38 +00:00
681b0bbc91 Add public/service-worker.js 2026-06-03 14:38:38 +00:00
e9e5a0c5d1 Merge version_2 into main
Merge version_2 into main
2026-06-03 14:37:12 +00:00
1122bff8dd Merge version_2 into main
Merge version_2 into main
2026-06-03 14:36:41 +00:00
2 changed files with 74 additions and 11 deletions

50
public/service-worker.js Normal file
View File

@@ -0,0 +1,50 @@
const CACHE_NAME = 'grunauer-cache-v1';
const urlsToCache = [
'/',
'/index.html',
// Add other critical static assets here, e.g., images, fonts, main CSS/JS bundles
// For a Next.js app, consider using a library like Workbox for more robust asset pre-caching and runtime caching strategies.
'/favicon.ico'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => {
console.log('Service Worker: Opened cache');
return cache.addAll(urlsToCache);
})
.then(() => self.skipWaiting()) // Forces the waiting service worker to become the active service worker.
);
});
self.addEventListener('activate', (event) => {
const cacheWhitelist = [CACHE_NAME];
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheWhitelist.indexOf(cacheName) === -1) {
console.log('Service Worker: Deleting old cache', cacheName);
return caches.delete(cacheName); // Delete old caches
}
return null;
})
);
}).then(() => self.clients.claim()) // Takes control of the clients associated with the current service worker.
);
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request)
.then((response) => {
// Cache hit - return response
if (response) {
return response;
}
// No cache hit - fetch from network
return fetch(event.request);
})
);
});

View File

@@ -1,19 +1,22 @@
"use client"; "use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import React, { Suspense } from "react";
import ReactLenis from "lenis/react"; import ReactLenis from "lenis/react";
import ContactCenter from '@/components/sections/contact/ContactCenter';
import FaqDouble from '@/components/sections/faq/FaqDouble';
import FeatureCardTwentyEight from '@/components/sections/feature/FeatureCardTwentyEight'; import FeatureCardTwentyEight from '@/components/sections/feature/FeatureCardTwentyEight';
import FooterLogoReveal from '@/components/sections/footer/FooterLogoReveal';
import HeroBillboard from '@/components/sections/hero/HeroBillboard'; import HeroBillboard from '@/components/sections/hero/HeroBillboard';
import MetricCardThree from '@/components/sections/metrics/MetricCardThree';
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import ProductCardThree from '@/components/sections/product/ProductCardThree'; import ProductCardThree from '@/components/sections/product/ProductCardThree';
import TestimonialCardSixteen from '@/components/sections/testimonial/TestimonialCardSixteen';
import TextAbout from '@/components/sections/about/TextAbout'; import TextAbout from '@/components/sections/about/TextAbout';
import { Star, Utensils, Globe } from "lucide-react"; import { Star, Utensils, Globe } from "lucide-react";
// Lazy imports for below-the-fold sections
const LazyTestimonialCardSixteen = React.lazy(() => import('@/components/sections/testimonial/TestimonialCardSixteen'));
const LazyMetricCardThree = React.lazy(() => import('@/components/sections/metrics/MetricCardThree'));
const LazyFaqDouble = React.lazy(() => import('@/components/sections/faq/FaqDouble'));
const LazyContactCenter = React.lazy(() => import('@/components/sections/contact/ContactCenter'));
const LazyFooterLogoReveal = React.lazy(() => import('@/components/sections/footer/FooterLogoReveal'));
export default function LandingPage() { export default function LandingPage() {
return ( return (
<ThemeProvider <ThemeProvider
@@ -170,7 +173,8 @@ export default function LandingPage() {
</div> </div>
<div id="reviews" data-section="reviews"> <div id="reviews" data-section="reviews">
<TestimonialCardSixteen <Suspense fallback={<div>Loading Reviews...</div>}>
<LazyTestimonialCardSixteen
animationType="slide-up" animationType="slide-up"
textboxLayout="default" textboxLayout="default"
useInvertedBackground={false} useInvertedBackground={false}
@@ -206,10 +210,12 @@ export default function LandingPage() {
description="Hear from diners who have experienced the authentic taste and warm hospitality of Grünauer. With over 4,000 positive reviews, our reputation speaks for itself." description="Hear from diners who have experienced the authentic taste and warm hospitality of Grünauer. With over 4,000 positive reviews, our reputation speaks for itself."
tag="Guest Reviews" tag="Guest Reviews"
/> />
</Suspense>
</div> </div>
<div id="metrics" data-section="metrics"> <div id="metrics" data-section="metrics">
<MetricCardThree <Suspense fallback={<div>Loading Metrics...</div>}>
<LazyMetricCardThree
animationType="slide-up" animationType="slide-up"
textboxLayout="default" textboxLayout="default"
useInvertedBackground={true} useInvertedBackground={true}
@@ -228,10 +234,12 @@ export default function LandingPage() {
description="Proudly serving our community with culinary excellence and unwavering dedication." description="Proudly serving our community with culinary excellence and unwavering dedication."
tag="Our Achievements" tag="Our Achievements"
/> />
</Suspense>
</div> </div>
<div id="faq" data-section="faq"> <div id="faq" data-section="faq">
<FaqDouble <Suspense fallback={<div>Loading FAQ...</div>}>
<LazyFaqDouble
textboxLayout="default" textboxLayout="default"
useInvertedBackground={false} useInvertedBackground={false}
faqs={[ faqs={[
@@ -249,10 +257,12 @@ export default function LandingPage() {
tag="Need Help?" tag="Need Help?"
faqsAnimation="slide-up" faqsAnimation="slide-up"
/> />
</Suspense>
</div> </div>
<div id="contact" data-section="contact"> <div id="contact" data-section="contact">
<ContactCenter <Suspense fallback={<div>Loading Contact...</div>}>
<LazyContactCenter
useInvertedBackground={true} useInvertedBackground={true}
background={{ background={{
variant: "plain"}} variant: "plain"}}
@@ -263,16 +273,19 @@ export default function LandingPage() {
buttonText="Send Inquiry" buttonText="Send Inquiry"
termsText="By sending an inquiry, you agree to our privacy policy." termsText="By sending an inquiry, you agree to our privacy policy."
/> />
</Suspense>
</div> </div>
<div id="footer" data-section="footer"> <div id="footer" data-section="footer">
<FooterLogoReveal <Suspense fallback={<div>Loading Footer...</div>}>
<LazyFooterLogoReveal
logoText="Grünauer" logoText="Grünauer"
leftLink={{ leftLink={{
text: "Privacy Policy", href: "#"}} text: "Privacy Policy", href: "#"}}
rightLink={{ rightLink={{
text: "Terms of Service", href: "#"}} text: "Terms of Service", href: "#"}}
/> />
</Suspense>
</div> </div>
</ReactLenis> </ReactLenis>
</ThemeProvider> </ThemeProvider>