Insta, spotlight, fonts

This commit is contained in:
2024-09-24 12:47:02 +05:30
parent 18c719a22d
commit 1e49dab4c1
32 changed files with 261 additions and 107 deletions

Binary file not shown.

BIN
public/fonts/Renner-300.otf Normal file

Binary file not shown.

BIN
public/fonts/Renner-500.otf Normal file

Binary file not shown.

BIN
public/fonts/Renner-700.otf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 KiB

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1014 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 942 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -3,21 +3,24 @@
@tailwind utilities; @tailwind utilities;
:root { :root {
--background: #ffffff; --background: #f8f6f5;
--foreground: #171717; --foreground: #703133;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--background: #0a0a0a; --background: #f8f6f5;
--foreground: #ededed; --foreground: #703133;
} }
} }
body { body {
margin: 0;
padding: 0;
color: var(--foreground); color: var(--foreground);
background: var(--background); background-color: var(--background);
font-family: Arial, Helvetica, sans-serif; font-family: Renner, sans-serif;
font-weight: 300;
} }
@layer utilities { @layer utilities {
@ -26,10 +29,37 @@ body {
} }
} }
body { @font-face {
margin: 0; font-family: 'Montera';
padding: 0; src: url('/fonts/MonetaSans-Regular.otf') format('opentype');
background-color: #f0f0f0; /* Optional background color */ font-weight: 400;
font-family: Arial, sans-serif; font-style: normal;
color: black; }
@font-face {
font-family: 'Renner';
src: url('/fonts/Renner-300.otf') format('opentype');
font-weight: 300;
font-style: light;
}
@font-face {
font-family: 'Renner';
src: url('/fonts/Renner-500.otf') format('opentype');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Renner';
src: url('/fonts/Renner-700.otf') format('opentype');
font-weight: 700;
font-style: bold;
}
@font-face {
font-family: 'Samantha';
src: url('/fonts/SamanthaSignature.otf') format('opentype');
font-weight: 400;
font-style: normal;
} }

View File

@ -2,8 +2,8 @@ import './globals.css';
// import './globalicons.css'; // import './globalicons.css';
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import Navbar from '../components/navbar'; import { Footer } from '@/components/footer';
import Footer from '../components/footer'; import { Navbar } from '@/components/navbar';
export default function RootLayout({ children }: { children: ReactNode }) { export default function RootLayout({ children }: { children: ReactNode }) {
return ( return (

27
src/app/lib/instagram.ts Normal file
View File

@ -0,0 +1,27 @@
// Define the shape of Instagram post data using TypeScript interfaces
export interface InstagramPost {
id: string;
caption: string;
media_url: string;
permalink: string;
media_type: string;
}
// Fetch Instagram posts from Instagram Graph API
export async function fetchInstagramPosts(): Promise<InstagramPost[]> {
const accessToken = process.env.NEXT_PUBLIC_INSTAGRAM_ACCESS_TOKEN;
// const url = `https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=${accessToken}`;
const url = `https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=${accessToken}`;
const res = await fetch(url);
const data = await res.json();
if (data?.data) {
console.log(data.data);
return data.data
.filter((post: InstagramPost) => post.media_type === 'IMAGE')
.slice(0, 5);
}
return [];
}

View File

@ -4,29 +4,31 @@ import { HomepageVideo } from '@/components/homepage-video';
import { HeroSwiper } from '@/components/swiper'; import { HeroSwiper } from '@/components/swiper';
import { Collections } from '@/components/our-collection'; import { Collections } from '@/components/our-collection';
import { ChocolateCategories } from '@/components/category-slider'; import { ChocolateCategories } from '@/components/category-slider';
import { InstagramFeed } from '@/components/instagram';
import { Spotlight } from '@/components/spotlight';
export default function HomePage() { export default function HomePage() {
return ( return (
<div className='overflow-x-hidden'> <div className='overflow-x-hidden'>
<HeroSwiper /> <HeroSwiper />
{/* First Two-Column Layout */} {/* First Two-Column Layout */}
<section className='flex flex-col md:flex-row items-center'> <section className='flex flex-col md:flex-row items-center bg-white'>
{/* Left Column - Text with Header */} {/* Left Column - Text with Header */}
<div className='w-full md:w-1/2'> <div className='w-full md:w-1/2'>
<div className='m-8 space-y-10'> <div className='m-8 space-y-10'>
<h1 className='text-6xl font-normal text-justify font-sans'> <h1 className='text-6xl font-normal text-justify font-montera'>
Brand Story Brand Story
</h1> </h1>
<p className='text-xl font-light'> <p className='text-xl text-justify'>
Mozimo&apos;s journey is a passionate pursuit of crafting Mozimo&apos;s journey is a passionate pursuit of crafting
exceptional chocolate that celebrates the origin of each cocoa exceptional chocolate that celebrates the origin of each cocoa
bean. bean.
</p> </p>
<p className='text-xl font-light text-justify'> <p className='text-xl text-justify'>
We meticulously roast, crack, winnow, and refine beans in-house, We meticulously roast, crack, winnow, and refine beans in-house,
using modern techniques to highlight their natural flavors. using modern techniques to highlight their natural flavors.
</p> </p>
<p className='text-xl font-light text-justify'> <p className='text-xl text-justify'>
Each chocolate is a masterpiece, capturing the essence of cocoa in Each chocolate is a masterpiece, capturing the essence of cocoa in
its purest form. its purest form.
</p> </p>
@ -43,7 +45,7 @@ export default function HomePage() {
</div> </div>
</section> </section>
{/* Second Two-Column Layout (Video and Text) */} {/* Second Two-Column Layout (Video and Text) */}
<section className='flex flex-col md:flex-row items-center'> <section className='flex flex-col md:flex-row items-center bg-white'>
{/* Left Column - Video */} {/* Left Column - Video */}
<div className='w-full md:w-1/2'> <div className='w-full md:w-1/2'>
<div className='aspect-w-16 aspect-h-9'> <div className='aspect-w-16 aspect-h-9'>
@ -54,11 +56,14 @@ export default function HomePage() {
{/* Right Column - Text */} {/* Right Column - Text */}
<div className='w-full md:w-1/2'> <div className='w-full md:w-1/2'>
<div className='m-8 space-y-10'> <div className='m-8 space-y-10'>
<h2 className='text-6xl font-bold'> <h2 className='text-6xl font-normal text-justify font-montera'>
Discover the delicate art of our Discover the delicate art of our
</h2> </h2>
<h3 className='text-3xl font-bold'> Chocolate Tempering</h3> <h3 className='text-8xl font-normal text-justify font-samantha'>
<p className='text-xl'> {' '}
Chocolate Tempering
</h3>
<p className='text-xl text-justify'>
Crafted to perfection Mozimo delivers a sublime sensory experience Crafted to perfection Mozimo delivers a sublime sensory experience
with every bite. Experience the epitome of indulgence with our with every bite. Experience the epitome of indulgence with our
perfectly tempered chocolate: velvety smooth, exquisitely rich, perfectly tempered chocolate: velvety smooth, exquisitely rich,
@ -68,18 +73,28 @@ export default function HomePage() {
</div> </div>
</div> </div>
</section> </section>
{/* Third Layout (Our Collections) */} {/* Fourth Three-Column Layout (Collections) */}
<section className='flex flex-col md:flex-row'> <section className='flex flex-col items-center py-12 px-4 sm:px-6 lg:px-8'>
<div className='bg-[#f9f6f5] w-full text-6xl font-normal font-sans text-center'> <div className='w-full text-6xl font-normal font-montera text-center py-12 px-4 sm:px-6 lg:px-8'>
Our Collections Our Collections
</div> </div>
</section>
{/* Fourth Three-Column Layout (Collections) */}
<section className='flex flex-col md:flex-row items-center "bg-[#f9f6f5] py-12 px-4 sm:px-6 lg:px-8"'>
<Collections /> <Collections />
</section> </section>
{/* Fifth Layout (Categories) */} {/* Fifth Layout (Categories) */}
<ChocolateCategories /> <ChocolateCategories />
{/* Sixth Layout (Instagram) */}
<section className='flex flex-col items-center py-12 px-4 sm:px-6 lg:px-8'>
<div className='w-full text-6xl font-normal font-montera text-center py-12 px-4 sm:px-6 lg:px-8'>
Follow us on Instagram
</div>
<InstagramFeed />
</section>
<section className='flex flex-col items-center bg-white py-12 px-4 sm:px-6 lg:px-8'>
<div className='w-full text-6xl font-normal font-montera text-center py-12 px-4 sm:px-6 lg:px-8'>
In the Spotlight
</div>
<Spotlight />
</section>
</div> </div>
); );
} }

View File

@ -15,14 +15,14 @@ export function ChocolateCategories() {
const [currentImage, setCurrentImage] = useState(categories[0].image); const [currentImage, setCurrentImage] = useState(categories[0].image);
return ( return (
<section className='flex flex-col md:flex-row bg-[#f9f6f5] py-12 px-4 sm:px-6 lg:px-8'> <section className='flex flex-col md:flex-row bg-white py-12 px-4 sm:px-6 lg:px-8'>
<div className='w-full md:w-1/2 bg-white h-auto'> <div className='w-full md:w-1/2 bg-white h-auto'>
<ul className='m-8 space-y-10 text-[#5a352a] font-serif text-5xl justify-center text-left'> <ul className='m-8 space-y-10 text-[#5a352a] font-serif text-5xl justify-center text-left'>
{categories.map((category) => ( {categories.map((category) => (
<li <li
key={category.name} key={category.name}
onMouseEnter={() => setCurrentImage(category.image)} onMouseEnter={() => setCurrentImage(category.image)}
className='hover:text-[#c19a6b] cursor-pointer' className='hover:text-[#c19a6b] cursor-pointer font-montera font-normal text-9xl'
> >
{category.name} {category.name}
</li> </li>

View File

@ -1,7 +1,9 @@
// components/Footer.js import { FaPhoneAlt } from 'react-icons/fa';
export default function Footer() { import { FaMapLocationDot } from 'react-icons/fa6';
export function Footer() {
return ( return (
<footer className='bg-white text-brown-800 py-12'> <footer className='bg-[#f8f6f5] py-12 border-t-2 border-black'>
<div className='max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-4 gap-8 px-4'> <div className='max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-4 gap-8 px-4'>
{/* First Column: Logo and Description */} {/* First Column: Logo and Description */}
<div className='space-y-4'> <div className='space-y-4'>
@ -22,12 +24,12 @@ export default function Footer() {
<div className='space-y-4'> <div className='space-y-4'>
<h3 className='font-semibold'>Get in touch</h3> <h3 className='font-semibold'>Get in touch</h3>
<p className='text-sm flex items-center'> <p className='text-sm flex items-center'>
<span className='material-symbols-outlined'>call</span> <FaPhoneAlt />
0172-4045414 &nbsp; 0172-4045414
</p> </p>
<p className='text-sm flex items-center'> <p className='text-sm flex items-center'>
<span className='material-symbols-outlined'>pin_drop</span> <FaMapLocationDot />
SCO 8, Inner Market, 9-D, Sector 9, Chandigarh, 160009 &nbsp; SCO 8, Inner Market, 9-D, Sector 9, Chandigarh, 160009
</p> </p>
</div> </div>
@ -115,10 +117,7 @@ export default function Footer() {
> >
<img src='/icons/youtube.svg' /> <img src='/icons/youtube.svg' />
</a> </a>
<a <a href='https://linkedin.com' className=''>
href='https://linkedin.com'
className='text-brown-600 hover:text-brown-800'
>
<img src='/icons/linkedin.svg' /> <img src='/icons/linkedin.svg' />
</a> </a>
</div> </div>

View File

@ -1,5 +1,5 @@
// components/Header.js // components/Header.js
export default function Header() { export function Header() {
return ( return (
<header className='bg-white shadow'> <header className='bg-white shadow'>
<div className='container mx-auto px-4 py-6'> <div className='container mx-auto px-4 py-6'>

View File

@ -0,0 +1,32 @@
'use client';
import { InstagramPost, fetchInstagramPosts } from '@/app/lib/instagram';
import { useEffect, useState } from 'react';
export function InstagramFeed() {
const [posts, setPosts] = useState<InstagramPost[]>([]);
useEffect(() => {
async function getInstagramData() {
const data = await fetchInstagramPosts();
setPosts(data);
}
getInstagramData();
}, []);
return (
<div className='grid grid-cols-1 md:grid-cols-5 gap-8'>
{posts.map((post) => (
<div key={post.id} className='flex flex-col items-center'>
<a href={post.permalink} target='_blank' rel='noopener noreferrer'>
<img
src={post.media_url}
alt={post.caption}
className='rounded-lg shadow-lg'
/>
</a>
</div>
))}
</div>
);
}

View File

@ -1,12 +1,12 @@
// components/Layout.js // components/Layout.js
import Header from './header'; import { Header } from './header';
import Footer from './footer'; import { Footer } from './footer';
import { ReactNode } from 'react'; // Import ReactNode import { ReactNode } from 'react'; // Import ReactNode
interface LayoutProps { interface LayoutProps {
children: ReactNode; // Define the type of children prop children: ReactNode; // Define the type of children prop
} }
export default function Layout({ children }: LayoutProps) { export function Layout({ children }: LayoutProps) {
return ( return (
<> <>
<Header /> <Header />

View File

@ -1,5 +1,5 @@
// components/Navbar.tsx // components/Navbar.tsx
export default function Navbar() { export function Navbar() {
return ( return (
<nav className='navbar'> <nav className='navbar'>
<div className='left'> <div className='left'>

View File

@ -1,20 +1,16 @@
.navbar { /* .navbar {
position: fixed; position: fixed;
top: 1.5em; top: 1.5em;
left: 2em; left: 2em;
right: 2em; right: 2em;
@apply transition-all; background-color: white;
/* background-color: white;
border-radius: 0px; border-radius: 0px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 1em 2em; padding: 1em 2em;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
z-index: 1000; */ z-index: 1000;
} }
/* .navbar a { .navbar a {
color: black; color: black;
text-decoration: none; text-decoration: none;
margin: 0 0.5em; margin: 0 0.5em;

View File

@ -1,7 +1,11 @@
/* navbar.module.css */ /* navbar.module.css */
.navBar { .navBar {
@apply top-6 left-6 right-6 transition-all duration-300 z-50; @apply top-6 left-6 right-6 transition-all duration-300 z-50 h-16;
display: flex;
align-items: center;
justify-content: space-between;
padding: 1em 2em;
} }
.navBarInitial { .navBarInitial {

View File

@ -1,67 +1,65 @@
'use client' 'use client';
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import Link from 'next/link'; import Link from 'next/link';
import { FiSearch, FiUser } from 'react-icons/fi'; import { FiSearch, FiUser } from 'react-icons/fi';
import { HiShoppingBag } from "react-icons/hi2"; import { HiShoppingBag } from 'react-icons/hi2';
import styles from './navbar.module.css'; import styles from './navbar.module.css';
// components/Navbar.tsx // components/Navbar.tsx
export default function Navbar() { export function Navbar() {
const prevScrollY = useRef(0); const prevScrollY = useRef(0);
const [navBarStyle, setNavBarStyle] = useState('initial'); const [navBarStyle, setNavBarStyle] = useState('initial');
useEffect(() => { useEffect(() => {
const handleScroll = () => { const handleScroll = () => {
const currentScrollY = window.scrollY; const currentScrollY = window.scrollY;
if (currentScrollY > prevScrollY.current && currentScrollY > 100) { if (currentScrollY > prevScrollY.current && currentScrollY > 100) {
// Scrolling down and scrolled past 100px // Scrolling down and scrolled past 100px
setNavBarStyle('initial'); setNavBarStyle('initial');
} else if (currentScrollY < prevScrollY.current && currentScrollY > 100) { } else if (currentScrollY < prevScrollY.current && currentScrollY > 100) {
// Scrolling up and scrolled past 100px // Scrolling up and scrolled past 100px
setNavBarStyle('scrolledUp'); setNavBarStyle('scrolledUp');
} else if (currentScrollY <= 100) { } else if (currentScrollY <= 100) {
setNavBarStyle('initial'); setNavBarStyle('initial');
} }
prevScrollY.current = currentScrollY; prevScrollY.current = currentScrollY;
}; };
window.addEventListener('scroll', handleScroll); window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll);
}, []); // Empty dependency array }, []); // Empty dependency array
const navClasses = `${styles.navBar} ${ const navClasses = `${styles.navBar} ${
navBarStyle === 'scrolledUp' ? styles.navBarScrolledUp : styles.navBarInitial navBarStyle === 'scrolledUp'
}`; ? styles.navBarScrolledUp
: styles.navBarInitial
}`;
return ( return (
<nav className={navClasses}> <nav className={navClasses}>
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> {/* Left side */}
<div className="flex items-center justify-between h-16"> <div className='flex items-center'>
{/* Left side */} <Link href='/about' className='text-sm font-medium hover:underline'>
<div className="flex items-center"> About Us
<Link href="/about" className="text-sm font-medium hover:underline"> </Link>
About Us </div>
</Link> {/* Middle */}
</div> <div className='flex-shrink-0'>
{/* Middle */} <Link href='/' className='text-lg font-bold'>
<div className="flex-shrink-0"> <img src='/images/logo.png' alt='Logo' className='logo' />
<Link href="/" className="text-lg font-bold"> </Link>
<img src='/images/logo.png' alt='Logo' className='logo' /> </div>
</Link> {/* Right side */}
</div> <div className='flex items-center space-x-4'>
{/* Right side */} <button aria-label='Search'>
<div className="flex items-center space-x-4"> <FiSearch size={20} />
<button aria-label="Search"> </button>
<FiSearch size={20} /> <button aria-label='Profile'>
</button> <FiUser size={20} />
<button aria-label="Profile"> </button>
<FiUser size={20} /> <button aria-label='Shopping Cart'>
</button> <HiShoppingBag size={20} />
<button aria-label="Shopping Cart"> </button>
<HiShoppingBag size={20} />
</button>
</div>
</div>
</div> </div>
</nav> </nav>
); );

View File

@ -17,7 +17,7 @@ const collections = [
export function Collections() { export function Collections() {
return ( return (
<div className='max-w-7xl mx-auto grid gap-6 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3'> <div className='flex flex-row max-w-7xl mx-auto grid gap-6 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3'>
{collections.map((collection, index) => ( {collections.map((collection, index) => (
<div <div
key={index} key={index}

View File

@ -0,0 +1,48 @@
// components/Spotlight.tsx
import Image from 'next/image';
const logos = [
{ src: '/images/logo.png', alt: 'TOI' }, // Replace with actual logo path
{ src: '/images/logo.png', alt: 'The Tribune' }, // Replace with actual logo path
{ src: '/images/logo.png', alt: 'ET' }, // Replace with actual logo path
{ src: '/images/logo.png', alt: 'The Hindu' }, // Replace with actual logo path
];
// { src: '/images/logos/toi-logo.png', alt: 'TOI' }, // Replace with actual logo path
// { src: '/images/logos/tribune-logo.png', alt: 'The Tribune' }, // Replace with actual logo path
// { src: '/images/logos/et-logo.png', alt: 'ET' }, // Replace with actual logo path
// { src: '/images/logos/hindu-logo.png', alt: 'The Hindu' }, // Replace with actual logo path
export function Spotlight() {
return (
<div className='flex flex-row justify-center items-center space-x-8 py-16'>
{logos.map((logo, index) => (
<div key={index} className='flex flex-col items-center'>
<div className='w-32 h-32 bg-white rounded-full shadow-lg flex items-center justify-center'>
<Image
src={logo.src}
alt={logo.alt}
width={80}
height={80}
className='object-contain'
/>
</div>
</div>
))}
</div>
);
}
// return (
// <div className="flex flex-col items-center py-16">
// <h2 className="text-3xl font-semibold mb-8">In the Spotlight</h2>
// <div className="flex justify-center space-x-8">
// {logos.map((logo, index) => (
// <div key={index} className="flex flex-col items-center">
// <div className="w-32 h-32 bg-white rounded-full shadow-lg flex items-center justify-center">
// <Image src={logo.src} alt={logo.alt} width={80} height={80} className="object-contain" />
// </div>
// </div>
// ))}
// </div>
// </div>
// );

View File

@ -1,5 +1,5 @@
import { AppProps } from 'next/app'; // Import the AppProps type import { AppProps } from 'next/app'; // Import the AppProps type
import Layout from '../components/layout'; import { Layout } from '../components/layout';
import '../app/globals.css'; import '../app/globals.css';
function MyApp({ Component, pageProps }: AppProps) { function MyApp({ Component, pageProps }: AppProps) {

View File

@ -12,6 +12,11 @@ const config: Config = {
background: 'var(--background)', background: 'var(--background)',
foreground: 'var(--foreground)', foreground: 'var(--foreground)',
}, },
fontFamily: {
montera: ['Montera', 'sans-serif'],
renner: ['Renner', 'sans-serif'],
samantha: ['Samantha ', 'handwritten'],
},
}, },
}, },
plugins: [], plugins: [],