Skip to content

Commit

Permalink
Add section 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluesmile82 committed Oct 9, 2024
1 parent d68daa2 commit 8275c69
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 77 deletions.
2 changes: 1 addition & 1 deletion public/icons/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-understanding-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-understanding-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home-understanding-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/wind_speed_global_10km.mp4
Binary file not shown.
11 changes: 0 additions & 11 deletions src/app/globe/page.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Link from "next/link";
import Intro from "@/components/intro";
import Section1 from "@/components/section-1";
import Section2 from "@/components/section-2";

export default function Home() {
return (
<main>
<Intro />
<div className="text-black text-lg hover:gray-500 space-x-5">
<Link href="/globe">Globe</Link>
</div>
<Section1 />
<Section2 />
</main >
);
}
1 change: 1 addition & 0 deletions src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const buttonVariants = cva(
white: "border-2 border-white transition-color duration-200 text-white gap-2.5 uppercase font-medium px-4 py-3 hover:bg-white hover:text-blue-900",
secondary: "bg-light-green text-green-900 gap-2.5 uppercase font-medium px-4 py-3",
icon: "gap-2.5",
vanilla: '',
},
size: {
default: "h-10 px-4 py-3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Footer = ({ backgroundClass = "bg-green-700" }) => {
return (
<footer className={cn("w-full flex-col flex text-white", backgroundClass)}>
<div className="justify-center flex">
<div className="w-1/2 px-[100px] py-20 border-r border-white/20 flex flex-col gap-20">
<div className="w-1/2 px-[100px] py-20 flex flex-col gap-20">
<div className="text-sm font-medium uppercase max-w-[258px] tracking-widest">Digital Twins: <div>Innovative Research for a Sustainable Future</div></div>
<div className="text-lg font-bold leading-8">Lorem ipsum dolor sit amet consectetur. Sagittis praesent tempus euismod tincidunt duis phasellus aliquam facilisis consectetur.</div>
<Logo className="text-white" />
Expand Down
81 changes: 41 additions & 40 deletions src/components/intro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,47 @@ import HeroVideo from './hero-video';
import Lines from '@/components/lines';

export default function Intro() {
return (<section className="relative h-screen bg-blue-900">
<HeroVideo />
<Lines sectionName='intro' columns={[0, 190, 206, 366, 1010]} rows={[204, 444, 516, 559, 598]} />
<div className='container relative pt-[198px] space-y-[30px]'>
<h1 className='max-w-[1012px]'>
<div className="text-light-green text-5xl font-semibold">Digital Twins: </div>
<div className="text-white text-5xl font-semibold">Innovative Research for a Sustainable Future</div>
</h1>
<VerticalCarousel className="text-white text-3xl">
<div>
Bridging data and discovery with state-of-the-art digital twin technology
return (
<section className="relative h-[110vh] bg-blue-900">
<HeroVideo />
<Lines verticalClassName="left-8" sectionName='intro' columns={[64, 254, 270, 430, 1074]} rows={[204, 444, 516, 559, 598]} />
<div className='container relative pt-[198px] space-y-[30px] px-24'>
<h1 className='max-w-[1012px]'>
<div className="text-light-green text-5xl font-semibold">Digital Twins: </div>
<div className="text-white text-5xl font-semibold">Innovative Research for a Sustainable Future</div>
</h1>
<VerticalCarousel className="text-white text-3xl">
<div>
Bridging data and discovery with state-of-the-art digital twin technology
</div>
<div>
Advancing climate knowledge through digital twins
</div>
<div>
Harnessing advanced simulations to adapt to and mitigate climate impacts
</div>
</VerticalCarousel>
<div className='flex gap-4'>
<Button variant="white" className='z-10 group'>
<Link href="#">View use cases</Link>
<ArrowRightIcon className="w-5 h-5 group-hover:text-blue-900 text-white transform group-hover:translate-x-0.5 transition-transform" />
</Button>
<MotionButton variant="secondary"
initial="rest"
whileHover="hover"
animate="rest"
className='z-10'
>
<HoverRepeatAnimation isChild>
<Link href="#">Keep exploring</Link>
</HoverRepeatAnimation>
</MotionButton>
</div>
<div>
Advancing climate knowledge through digital twins
</div>
<div>
Harnessing advanced simulations to adapt to and mitigate climate impacts
</div>
</VerticalCarousel>
<div className='flex gap-4'>
<Button variant="white" className='z-10 group'>
<Link href="#">View use cases</Link>
<ArrowRightIcon className="w-5 h-5 group-hover:text-blue-900 text-white transform group-hover:translate-x-0.5 transition-transform" />
</Button>
<MotionButton variant="secondary"
initial="rest"
whileHover="hover"
animate="rest"
className='z-10'
>
<HoverRepeatAnimation isChild>
<Link href="#">Keep exploring</Link>
</HoverRepeatAnimation>
</MotionButton>
</div>
</div>
<BouncingMarquee className="w-full text-light-green text-xl gap-12 border-t border-light-green py-4 absolute bottom-0">
<div>Bridging data and discovery with state-of-the-art digital twin technology</div>
<div>Advancing climate knowledge through digital twins</div>
<div>Harnessing advanced simulations to adapt to and mitigate climate impacts</div>
</BouncingMarquee>
</section>);
<BouncingMarquee className="w-full text-light-green text-xl gap-12 border-t border-light-green py-4 absolute bottom-0">
<div>Bridging data and discovery with state-of-the-art digital twin technology</div>
<div>Advancing climate knowledge through digital twins</div>
<div>Harnessing advanced simulations to adapt to and mitigate climate impacts</div>
</BouncingMarquee>
</section>);
};
18 changes: 18 additions & 0 deletions src/components/know-more-button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ArrowDown from "@/svgs/arrow-down.svg";
import { Button } from "@/components/button";
import { cn } from "@/lib/utils";

const KnowMoreButton = ({ onClick, opened }: {
onClick: () => void;
opened?: boolean;
}) => (
<Button variant="vanilla" size="auto" className="justify-center items-center gap-4 group" onClick={onClick}>
<div className="justify-center items-center gap-4 flex">
<div className="text-xl underline tracking-tight">{opened ? 'Show less' : 'Know more'}</div>
<ArrowDown className={cn("w-6 h-6 group-hover:translate-y-1 transition-transform duration-300",
{ "rotate-180": opened })}
/>
</div>
</Button>
);
export default KnowMoreButton;
68 changes: 48 additions & 20 deletions src/components/lines/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,68 @@
import { cn } from '@/lib/utils';
import { AnimatePresence, motion, stagger } from 'framer-motion';

const Lines = ({
sectionName,
columns = [],
rows = [],
colorClass = 'bg-white/20'
}: {
type LinesProps = {
sectionName: string;
columns?: number[];
rows?: number[];
colorClass?: string;
}) => {
verticalClassName?: string;
} & (
| { hoveringColumnsNumber: number; columns?: never; hoveredIndex: number | null }
| { columns: number[]; hoveringColumnsNumber?: never; hoveredIndex?: never }
);

const Lines = ({
sectionName,
columns = [],
rows = [],
colorClass = 'bg-white/20',
verticalClassName,
hoveringColumnsNumber = 0,
hoveredIndex,
}: LinesProps) => {
console.log(hoveringColumnsNumber, Array(hoveringColumnsNumber).fill(null))
const gridColumns = {
'grid transition-all duration-500': true,
'grid-cols-[1.2fr_0.9fr_0.9fr]': hoveredIndex === 0,
'grid-cols-[0.9fr_1.2fr_0.9fr]': hoveredIndex === 1,
'grid-cols-[0.9fr_0.9fr_1.2fr]': hoveredIndex === 2,
'grid-cols-[1fr_1fr_1fr]': hoveredIndex === null,
};
return <>
<AnimatePresence>
<div className='container absolute inset-0 w-full h-full'>
<motion.div className='w-full h-full absolute inset-0 left-8 z-10'>
{/* Vertical lines */}
<div className='vertical-lines container absolute inset-0 w-full h-full'>
<motion.div className={cn('w-full h-full absolute inset-0 z-10',
verticalClassName,
hoveringColumnsNumber && gridColumns)}
>
{
columns.map((x, index) => (
<motion.div
initial={{ x: -1000, opacity: 0 }}
animate={{ x, opacity: 1 }}
transition={{ delay: 0.1 + index * 0.1, duration: 0.1 }}
key={`line-y-${sectionName}-${index}`}
className={cn("h-full w-px absolute", colorClass)} />
))
!!columns?.length ?
columns.map((x, index) => (
<motion.div
initial={{ x: -1000, opacity: 0 }}
animate={{ x, opacity: 1 }}
transition={{ delay: 0.1 + index * 0.1, duration: 0.1 }}
key={`line-y-${sectionName}-${index}`}
className={cn("h-full w-px absolute", colorClass)} />
)) :
(
Array(hoveringColumnsNumber).fill(null).map((_, index) => (
<motion.div
key={`line-y-${sectionName}-${index}`}
className={cn("h-full w-px", colorClass)} />
))
)
}
</motion.div>
</div>
<div className='w-full h-full absolute inset-0 z-10'>
{/* Horizontal lines */}
<div className='horizontal-lines w-full h-full absolute inset-0 z-10'>
{rows.map((y, index) => (
<motion.div
initial={{ y: -1000, opacity: 0 }}
animate={{ y, opacity: 1 }}
transition={{ delay: 0.5 + index * 0.1, ease: 'linear', duration: 0.1 }}
transition={{ delay: 0.1 + index * 0.1, ease: 'linear', duration: 0.1 }}
key={`line-x-${sectionName}-${index}`}
className={cn("w-full h-px", colorClass)} />
))}
Expand Down
103 changes: 103 additions & 0 deletions src/components/section-1/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
'use client';
import Lines from "@/components/lines";
import Image from "next/image";
import { useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
import KnowMoreButton from "@/components/know-more-button";
import { cn } from "@/lib/utils";

export default function Section1() {
const [openedKnowMore, setOpenedKnowMore] = useState(false);
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
const gridColumns = {
'grid transition-all duration-500': true,
'grid-cols-[1.2fr_0.9fr_0.9fr]': hoveredIndex === 0,
'grid-cols-[0.9fr_1.2fr_0.9fr]': hoveredIndex === 1,
'grid-cols-[0.9fr_0.9fr_1.2fr]': hoveredIndex === 2,
'grid-cols-[1fr_1fr_1fr]': hoveredIndex === null,
};
return (
<section className="relative bg-white py-20 ">
<Lines verticalClassName="pl-[152px] pr-[152px]" sectionName="section-1" rows={[474, (!hoveredIndex || hoveredIndex === 0) ? 1134 : 1154]} colorClass="bg-blue-900/20" hoveringColumnsNumber={3} hoveredIndex={hoveredIndex} />
<div className="container px-[150px]">
<div className="max-w-[594px] text-green-700 space-y-5 pb-20">
<div className=" text-lg font-medium uppercase">Understanding digital twins</div>
<h3 className="text-2xl">A digital twin is a highly sophisticated virtual replica of a physical system, process, or object. It includes a tight integration between models, data and decisions with applications across multiple areas of science, technology, and society.</h3>
<KnowMoreButton onClick={() => setOpenedKnowMore(!openedKnowMore)} opened={openedKnowMore} />
<AnimatePresence>
{openedKnowMore && <motion.div
initial={{ opacity: 0, height: 0 }}
exit={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
>
In the context of climate science, a digital twin of the Earth system integrates extensive data sets from real-world observations and simulations to create a dynamic, interactive model. This virtual environment allows the climate adaptation and mitigation community to experiment, predict, and analyse different scenarios with unprecedented detail, quality and consistency, while allowing users to address relevant ‘what-if’ questions.
</motion.div>}
</AnimatePresence>
</div>
<div className={cn("flex w-full h-[480px] overflow-hidden mb-10", gridColumns)}>
{Array(3).fill(null).map((_, index) => (
<div key={index}
className={cn("relative z-10 flex items-center h-full")}
onMouseEnter={() => setHoveredIndex(index)}
onMouseLeave={() => setHoveredIndex(null)}
>
<Image
alt=""
src={`/images/home-understanding-${index + 1}.png`}
layout="fill"
objectFit="cover"
/>
</div>
))}
</div>
<div className={cn("text-green-700 grid")}
>
<div className={cn(gridColumns)}>
<h4 className="text-xl pr-10 mb-4 col-span-1 max-w-[350px]">
How the digital twin for climate change adaptation helps research and society?
</h4>
</div>
<div className={cn(gridColumns, 'mb-[30px]')}>
<div className="col-start-2">
<div className="flex-col gap-4 flex pr-10">
<div className="flex-col flex ">
<div className="text-lg leading-relaxed">01</div>
<div className="text-lg leading-relaxed">Understanding processes:</div>
</div>
<div className="text-sm leading-tight max-w-[350px]">The digital twin produces simulations that allow researchers to understand the complex interactions of phenomena in the Earth-system that determine how our planet evolves.</div>
</div>
</div>
<div className="col-start-3">
<div className="flex-col gap-4 flex pr-10">
<div className="flex-col flex">
<div className="text-lg leading-relaxed">02</div>
<div className="text-lg leading-relaxed">Simulating scenarios:</div>
</div>
<div className="text-sm leading-tight max-w-[350px]">The digital twin allows researchers, policy makers and practitioners to develop and test different climate and impact scenarios that help understand what might happen under various conditions.</div>
</div>
</div>
</div>
<div className={cn(gridColumns)}>
<div className="col-start-2">
<div className="flex-col gap-4 flex pr-10">
<div className="flex-col flex ">
<div className="text-lg leading-relaxed">03</div>
<div className="text-lg leading-relaxed">Improving decision-making:</div>
</div>
<div className="text-sm leading-tight max-w-[350px]">By providing clear and accurate insights on the past, present and future, the digital twin can support decision-makers, policy-makers and world leaders make better informed decisions to address climate-related risks effectively and sustainably</div>
</div>
</div>
<div className="col-start-3">
<div className="flex-col gap-4 flex pr-10">
<div className="flex-col flex">
<div className="text-lg leading-relaxed">04</div>
<div className="text-lg leading-relaxed">Enhancing interdisciplinary and transdisciplinarity::</div>
</div>
<div className="text-sm leading-tight max-w-[350px]">Virtual models support collaboration among users from different disciplines, impact sectors, and geographical locations, ensuring a holistic approach to studying and solving real climate challenges.</div>
</div>
</div>
</div>
</div>
</div>
</section >);
};
12 changes: 12 additions & 0 deletions src/components/section-2/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';
import Lines from "@/components/lines";
import Globe from "@/components/globe";

export default function Section1() {

return (
<section className="relative bg-green-700 py-20 px-[150px]">
<Lines verticalClassName="left-8" sectionName="section-1" columns={[100]} rows={[100]} colorClass="bg-blue-900/20" />
<Globe />
</section >);
};

0 comments on commit 8275c69

Please sign in to comment.