Skip to content

Commit 5f54077

Browse files
committed
feat(new-landing): implement new landing page
1 parent a21b1cb commit 5f54077

File tree

10 files changed

+725
-570
lines changed

10 files changed

+725
-570
lines changed

src/components/Icon/ArrowForward.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export const ArrowForward: React.FC<SVGProps<SVGSVGElement>> = ({
55
}) => {
66
return (
77
<svg
8-
{...props}
98
fill="none"
109
height="32"
1110
viewBox="0 0 32 32"
1211
width="32"
13-
xmlns="http://www.w3.org/2000/svg">
12+
xmlns="http://www.w3.org/2000/svg"
13+
{...props}>
1414
<path
1515
d="M16.75 7L25.75 16L16.75 25"
1616
stroke="currentColor"

src/components/Icon/CollectionsLeft.tsx

+143-86
Large diffs are not rendered by default.

src/components/Icon/CollectionsRight.tsx

+133-76
Large diffs are not rendered by default.

src/components/Icon/VectorHorizontal4.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ export const VectorHorizontal4: React.FC<SVGProps<SVGSVGElement>> = ({
66
return (
77
<svg
88
fill="none"
9-
height="385"
10-
viewBox="0 0 6 385"
11-
width="6"
9+
height="377"
10+
viewBox="0 0 672 377"
11+
width="672"
1212
xmlns="http://www.w3.org/2000/svg"
1313
{...props}>
1414
<path
15-
d="M0.333333 3C0.333333 4.47276 1.52724 5.66667 3 5.66667C4.47276 5.66667 5.66667 4.47276 5.66667 3C5.66667 1.52724 4.47276 0.333333 3 0.333333C1.52724 0.333333 0.333333 1.52724 0.333333 3ZM0.333333 382C0.333333 383.473 1.52724 384.667 3 384.667C4.47276 384.667 5.66667 383.473 5.66667 382C5.66667 380.527 4.47276 379.333 3 379.333C1.52724 379.333 0.333333 380.527 0.333333 382ZM2.5 3V382H3.5V3H2.5Z"
15+
d="M0.333333 3C0.333333 4.47276 1.52724 5.66667 3 5.66667C4.47276 5.66667 5.66667 4.47276 5.66667 3C5.66667 1.52724 4.47276 0.333333 3 0.333333C1.52724 0.333333 0.333333 1.52724 0.333333 3ZM666.333 373.5C666.333 374.973 667.527 376.167 669 376.167C670.473 376.167 671.667 374.973 671.667 373.5C671.667 372.027 670.473 370.833 669 370.833C667.527 370.833 666.333 372.027 666.333 373.5ZM2.5 3V190.5H3.5V3H2.5ZM35 223H637V222H35V223ZM668.5 254.5V373.5H669.5V254.5H668.5ZM637 223C654.397 223 668.5 237.103 668.5 254.5H669.5C669.5 236.551 654.949 222 637 222V223ZM2.5 190.5C2.5 208.449 17.0507 223 35 223V222C17.603 222 3.5 207.897 3.5 190.5H2.5Z"
1616
fill="white"
1717
/>
1818
</svg>

src/components/Icon/Votes.tsx

+346-375
Large diffs are not rendered by default.

src/components/layout/Header.tsx

+17-5
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,41 @@ import { ConnectWalletButton } from '@/components/ConnectWalletButton'
44
import { useSession } from '@/context/session'
55
import cn from 'classnames'
66
import { useState } from 'react'
7+
import { formatMilliseconds } from '@/utils/helpers'
8+
import useCountdown from '@/hooks/useCountDown'
9+
import { PAIRWISE_RELEASE_DATE } from '@/utils/contants'
710

811
export function Header() {
912
const { user } = useSession()
13+
const [count] = useCountdown(PAIRWISE_RELEASE_DATE.valueOf() - Date.now())
1014

1115
const [showButton, setShowButton] = useState(false)
1216

1317
return (
1418
<header
15-
className="z-10 flex h-[60px] items-center justify-between bg-gray-4 px-10"
19+
className="z-10 flex h-[90px] items-center justify-between bg-gray-4 px-10"
1620
onMouseLeave={() => setShowButton(false)}>
1721
<Link href="/">
1822
<div className="ml-20">
1923
<Logo />
2024
</div>
2125
</Link>
2226
<div className="relative">
23-
<div onMouseEnter={() => setShowButton(true)}>
24-
<ConnectWalletButton className="h-[36px] bg-red" />
25-
</div>
27+
{count > 0 ? (
28+
<button className="flex h-[45px] min-w-[200px] items-center justify-center rounded-full border border-red bg-transparent px-6 font-Inter text-red">
29+
{formatMilliseconds(count)}
30+
</button>
31+
) : (
32+
<div onMouseEnter={() => setShowButton(true)}>
33+
<ConnectWalletButton className="h-[36px] bg-red" />
34+
</div>
35+
)}
36+
2637
{user && showButton && (
2738
<div
2839
className={cn(
29-
'absolute right-0 top-12 whitespace-nowrap rounded-2xl bg-white px-10 py-6 text-black')}>
40+
'absolute right-0 top-12 whitespace-nowrap rounded-2xl bg-white px-10 py-6 text-black'
41+
)}>
3042
<Link href="/profile">
3143
<span className="cursor-pointer hover:underline">My account</span>
3244
</Link>

src/hooks/useCountDown.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { useState, useEffect } from 'react'
2+
3+
const useCountdown = (
4+
initialCount: number,
5+
interval: number = 1000
6+
): [number, () => void] => {
7+
const [count, setCount] = useState<number>(initialCount)
8+
9+
useEffect(() => {
10+
const countdownInterval = setInterval(() => {
11+
setCount((prevCount) => prevCount - 1)
12+
}, interval)
13+
14+
// Clear the interval when the component is unmounted or when the countdown reaches 0
15+
if (count <= 0) {
16+
clearInterval(countdownInterval)
17+
}
18+
19+
return () => clearInterval(countdownInterval)
20+
}, [count, interval])
21+
22+
// Reset the countdown to the initial value
23+
const reset = () => {
24+
setCount(initialCount)
25+
}
26+
27+
// Return the current count and the reset function
28+
return [count, reset]
29+
}
30+
31+
export default useCountdown

src/pages/index.tsx

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ConnectWalletButton } from '@/components/ConnectWalletButton'
22
import { ArrowDown } from '@/components/Icon/ArrowDown'
3+
import { ArrowForward } from '@/components/Icon/ArrowForward'
34
import { CollectionsLeft } from '@/components/Icon/CollectionsLeft'
45
import { CollectionsRight } from '@/components/Icon/CollectionsRight'
56
import { ColoredGrid } from '@/components/Icon/ColoredGrid'
@@ -15,9 +16,13 @@ import { VectorHorizontal2 } from '@/components/Icon/VectorHorizontal2'
1516
import { VectorHorizontal3 } from '@/components/Icon/VectorHorizontal3'
1617
import { VectorHorizontal4 } from '@/components/Icon/VectorHorizontal4'
1718
import { Votes } from '@/components/Icon/Votes'
19+
import useCountdown from '@/hooks/useCountDown'
20+
import { PAIRWISE_RELEASE_DATE } from '@/utils/contants'
21+
import { formatMilliseconds } from '@/utils/helpers'
1822
import Image from 'next/image'
1923

2024
export default function Home() {
25+
const [count] = useCountdown(PAIRWISE_RELEASE_DATE.valueOf() - Date.now())
2126
return (
2227
<div className="overflow-x-hidden">
2328
<div className="relative">
@@ -35,16 +40,15 @@ export default function Home() {
3540
src="/images/center-universe.svg"
3641
width="1289"
3742
/>
38-
<Star className="absolute right-80 top-40" />
43+
<Star className="absolute right-80 top-40" />
3944
<div className="absolute inset-0 m-auto mt-28 flex w-[739px] flex-col items-center justify-center gap-6 rounded-2xl text-center font-IBM leading-[63px] text-black ">
4045
<h2 className="text-[64px] font-bold text-red">
4146
Retroactive Public Goods Funding
4247
</h2>
43-
<p className="text-2xl ">Impact = Profit</p>
44-
<ConnectWalletButton
45-
alternativeText="Start"
46-
className="flex h-12 items-center bg-black"
47-
/>
48+
<p className="font-Inter text-2xl ">
49+
Impact <ArrowForward className="inline-flex" width={24} /> Profit
50+
</p>
51+
<p className="font-Inter text-2xl font-bold">Starting on Nov 6</p>
4852
</div>
4953
<Image
5054
alt="Galaxy"
@@ -129,14 +133,14 @@ export default function Home() {
129133
<CollectionsRight className="absolute -right-[320px] -mt-[40%]" />
130134
</div>
131135
<VectorHorizontal4 className="ml-28 mr-auto" />
132-
<div className="my-6 -ml-36 flex w-[494px] flex-col gap-6 rounded-[32px] border border-white px-11 pb-14 pt-24 text-center text-black">
136+
<div className="my-6 -mr-32 ml-auto flex w-[494px] flex-col gap-6 rounded-[32px] border border-white px-11 pb-14 pt-24 text-center text-black">
133137
<h3 className="text-[32px] font-bold">Check and Modify Your Votes</h3>
134138
<p className="text-lg font-medium">
135139
Review and refine your votes at any time. Your opinions matter, and
136140
we want to make sure your choices reflect your passion for the
137141
projects that resonate with you.
138142
</p>
139-
<Votes className="absolute -right-[350px] -mt-[60px]" />
143+
<Votes className="absolute -left-[310px] -mt-[98px]" />
140144
</div>
141145
</div>
142146

@@ -145,13 +149,17 @@ export default function Home() {
145149
<h2 className="text-5xl font-bold text-red">
146150
Ready to Shape the Galaxy?
147151
</h2>
148-
<p className="text-[32px] font-medium text-black">
149-
Kickstart Your Journey: Connect Your Wallet Now
150-
</p>
151-
<ConnectWalletButton
152-
alternativeText="Start"
153-
className="flex h-12 items-center bg-black"
154-
/>
152+
{count > 0 ? (
153+
<button className="flex h-12 min-w-[200px] items-center justify-center rounded-full border border-black bg-transparent px-6 font-Inter text-black">
154+
{formatMilliseconds(count)}
155+
</button>
156+
) : (
157+
<ConnectWalletButton
158+
alternativeText="Start"
159+
className="flex h-12 items-center bg-black"
160+
/>
161+
)}
162+
155163
<Star
156164
className="absolute -bottom-20 -left-20"
157165
height={35}

src/utils/contants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export const SHOW_HELP_STORAGE_KEY = 'pairwise-help-is-shown'
2+
export const PAIRWISE_RELEASE_DATE = new Date(2023, 10, 6) // November 6 2023

src/utils/helpers.ts

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import {
2-
CollectionRanking,
3-
} from '@/components/Poll/Rankings/edit-logic/edit'
1+
import { CollectionRanking } from '@/components/Poll/Rankings/edit-logic/edit'
42

53
export function generateNonOverlappingOrbitCoordinates(
64
totalPoints: number,
@@ -96,17 +94,37 @@ export const convertRankingToAttestationFormat = (
9694
impactEvaluationLink: 'https://example.com/impact1',
9795
impactEvaluationDescription:
9896
'Donec vel maximus mi. Etiam vulputate at libero a euismod. Fusce id pulvinar dui. Etiam sit amet suscipit mauris. Donec viverra mauris elit. Cras at luctus libero, ac euismod sem. Etiam quis leo vestibulum tellus tincidunt bibendum vitae ac libero.',
99-
listContent: flattenRanking(ranking).map((item) => ({RPGF3_Application_UID: item.id, OPAmount: totalOp * item.share})).filter((el) => el.OPAmount > 0)
97+
listContent: flattenRanking(ranking)
98+
.map((item) => ({
99+
RPGF3_Application_UID: item.id,
100+
OPAmount: totalOp * item.share,
101+
}))
102+
.filter((el) => el.OPAmount > 0),
100103
}
101104

102-
const listName = "List created by Pairwise"
105+
const listName = 'List created by Pairwise'
103106
const listMetadataPtrType = 1
104107

105-
console.log("list:", obj.listContent)
108+
console.log('list:', obj.listContent)
106109

107110
return {
108111
listName,
109112
listMetadataPtrType,
110-
listMetadataPtr: "https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/"
113+
listMetadataPtr:
114+
'https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/',
111115
}
112116
}
117+
118+
export function formatMilliseconds(milliseconds: number): string {
119+
const seconds: number = Math.floor(milliseconds / 1000)
120+
const minutes: number = Math.floor(seconds / 60)
121+
const hours: number = Math.floor(minutes / 60)
122+
const days: number = Math.floor(hours / 24)
123+
124+
const remainingHours: number = hours % 24
125+
const remainingMinutes: number = minutes % 60
126+
127+
return `${
128+
days ? `${days} days, ` : ''
129+
}${remainingHours} hours and ${remainingMinutes} minutes`
130+
}

0 commit comments

Comments
 (0)