Webdev-Bench / tasks /c22 /repo /src /App.jsx
Roy-DOU's picture
Add files using upload-large-folder tool
148f3c7 verified
Raw History Blame Contribute Delete
14.4 kB
import { useEffect, useRef, useState } from 'react'
import {
SedaMark,
ArrowRight,
ArrowUp,
Caret,
CHAINS,
DistributedGlobal,
Coinbase,
Reciprocal,
Uncorrelated,
} from './logos.jsx'
import heroTopLeft from './assets/hero-topleft.jpg'
import heroLeft from './assets/hero-left.jpg'
import heroTopCenter from './assets/hero-topcenter.jpg'
import heroMid from './assets/hero-mid.jpg'
import heroRight from './assets/hero-right.jpg'
import feat1 from './assets/feat-1.jpg'
import feat2 from './assets/feat-2.jpg'
import feat3 from './assets/feat-3.jpg'
import feat4 from './assets/feat-4.jpg'
import feat5 from './assets/feat-5.jpg'
import cardImg1 from './assets/card-img-1.jpg'
import cardImg2 from './assets/card-img-2.jpg'
import cardImg3 from './assets/card-img-3.jpg'
import footerWave from './assets/footer-wave.jpg'
const scrollToId = (id) => {
const el = document.getElementById(id)
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
/* ---------------------------------- nav ---------------------------------- */
function Nav() {
const [learnOpen, setLearnOpen] = useState(false)
const learnRef = useRef(null)
useEffect(() => {
const close = (e) => {
if (learnRef.current && !learnRef.current.contains(e.target)) setLearnOpen(false)
}
document.addEventListener('click', close)
return () => document.removeEventListener('click', close)
}, [])
const go = (id) => (e) => {
e.preventDefault()
setLearnOpen(false)
scrollToId(id)
}
return (
<header className="nav">
<a
className="nav-logo"
href="#top"
onClick={(e) => {
e.preventDefault()
window.scrollTo({ top: 0, behavior: 'smooth' })
}}
>
<SedaMark />
<span className="nav-wordmark">seda</span>
</a>
<nav className="nav-links nav-links-left">
<a href="#network" onClick={go('network')}>Developers</a>
<a href="#audiences" onClick={go('audiences')}>Validators</a>
</nav>
<div className="nav-spacer" />
<nav className="nav-links nav-links-right">
<a href="#pillars" onClick={go('pillars')}>Primer</a>
<a href="#ecosystems" onClick={go('ecosystems')}>Community</a>
<span className={`nav-learn ${learnOpen ? 'open' : ''}`} ref={learnRef}>
<button
type="button"
onClick={(e) => {
e.stopPropagation()
setLearnOpen((v) => !v)
}}
>
Learn <Caret />
</button>
{learnOpen && (
<div className="nav-menu">
<a href="#network" onClick={go('network')}>About the network</a>
<a href="#pillars" onClick={go('pillars')}>Why SEDA</a>
<a href="#footer" onClick={go('footer')}>FAQs</a>
</div>
)}
</span>
<a className="btn btn-violet btn-nav" href="#footer" onClick={go('footer')}>
Litepaper
</a>
</nav>
</header>
)
}
/* ---------------------------------- hero --------------------------------- */
function Hero() {
return (
<section className="hero" id="top">
<img className="hx hx-topleft" src={heroTopLeft} alt="" />
<img className="hx hx-left" src={heroLeft} alt="" />
<img className="hx hx-topcenter" src={heroTopCenter} alt="" />
<img className="hx hx-mid" src={heroMid} alt="" />
<img className="hx hx-right" src={heroRight} alt="" />
<Nav />
<h1 className="hero-title">
A Foundation
<br />
for Data in
<br />
web3
</h1>
<div className="hero-cta">
<a className="btn btn-violet" href="#footer" onClick={(e) => { e.preventDefault(); scrollToId('footer') }}>
Litepaper <ArrowRight size={13} />
</a>
<a className="btn btn-ghost" href="#pillars" onClick={(e) => { e.preventDefault(); scrollToId('pillars') }}>
Primer <ArrowRight size={13} />
</a>
</div>
<p className="hero-para">
SEDA creates a standard for
<br />
data interoperability enabling
<br />
the future of connectivity.
</p>
<div className="hero-backed">Backed by:</div>
<div className="hero-backers">
<Uncorrelated />
<DistributedGlobal />
<Coinbase />
<Reciprocal />
</div>
</section>
)
}
/* --------------------------------- stats --------------------------------- */
const STATS = [
['+$152B', 'Total value enabled'],
['+12M', 'Data-feed updates'],
['+24', 'Networks we support'],
['+$22M', 'Raised'],
]
function Stats() {
return (
<section className="stats">
<div className="container">
<div className="hr hr-fade-both" />
<div className="stats-grid">
{STATS.map(([n, label]) => (
<div className="stat" key={label}>
<div className="stat-n">{n}</div>
<div className="stat-label">{label}</div>
</div>
))}
</div>
<div className="hr hr-fade-right" />
</div>
</section>
)
}
/* -------------------------------- features ------------------------------- */
const FEATURES = [
{
img: feat1,
lines: ['SEDA is a base network that forms a', 'foundational layer below blockchain', 'ecosystems as the HTTP of web3.'],
},
{
img: feat2,
lines: [
'SEDA seamlessly integrates with any',
'Blockchain Network using an open-',
'source relay smart contract, making',
'deployment fast and secure.',
],
},
{
img: feat3,
lines: [
'The SEDA Network is permissionless',
'by design. Information and value can',
'be validated, exchanged, relayed, and',
'requested by any entity across any',
'network with shared security.',
],
},
{
img: feat4,
lines: ['The SEDA Network is built with the', 'Cosmos SDK, creating a robust and', 'decentralized validator set.'],
},
{
img: feat5,
lines: ['SEDA can support any EVM Network,', 'including non-EVM Networks, within a', 'swift timeframe of just 24 hours.'],
},
]
// desktop-measured offsets (px from section top) — collapse to flow on mobile
const FEAT_POS = [
{ img: [342, -560, 520, 470], txt: 604, num: [572, 66] },
{ img: [892, -560, 520, 480], txt: 1102, num: [1043, 338] },
{ img: [1402, -540, 500, 470], txt: 1630, num: [1542, 84] },
{ img: [1982, -540, 500, 420], txt: 2190, num: [2091, 338] },
{ img: [2562, -560, 520, 510], txt: 2688, num: [2599, 74] },
]
function Features() {
return (
<section className="features" id="network">
{FEATURES.map((f, i) => {
const p = FEAT_POS[i]
return (
<div className="feature" key={i}>
<img
className="feature-img"
src={f.img}
alt=""
style={{
top: p.img[0],
left: `calc(50% + ${p.img[1]}px)`,
width: p.img[2],
height: p.img[3],
}}
/>
<div className="feature-num" style={{ top: p.num[0], left: `calc(50% + ${p.num[1]}px)` }}>
{i + 1}
</div>
<p className="feature-text" style={{ top: p.txt }}>
{f.lines.map((line, j) => (
<span key={j}>
{line}
{j < f.lines.length - 1 && <br />}
</span>
))}
</p>
</div>
)
})}
</section>
)
}
/* -------------------------------- pillars -------------------------------- */
const PILLARS = [
{
title: 'Secure',
hue: 0,
lines: ['Every step in the SEDA', 'network is strongly secured', 'by cryptographic primitives', 'and economic guarantees.'],
},
{
title: 'Fast',
hue: 160,
lines: ['Provides low latency for', 'queried data based on a', 'Proof-of-Stake (PoS)', 'consensus mechanism.'],
},
{
title: 'Permissionless',
hue: 300,
lines: ['No central authority controls', 'the data being transported', 'from the source to the', 'destination.'],
},
]
function Pillars() {
return (
<section className="pillars-wrap" id="pillars-cards">
<div className="container">
<div className="pillars">
{PILLARS.map((p) => (
<div className="pillar" key={p.title}>
<span className="pillar-icon" style={{ filter: `hue-rotate(${p.hue}deg) saturate(1.15)` }} />
<h3>{p.title}</h3>
<p>
{p.lines.map((line, j) => (
<span key={j}>
{line}
{j < p.lines.length - 1 && <br />}
</span>
))}
</p>
</div>
))}
</div>
</div>
</section>
)
}
/* ------------------------------- ecosystems ------------------------------ */
const ROW1 = ['Algorand', 'Arbitrum', 'Aurora', 'avalanche', 'Binance', 'Cardano', 'Sui', 'Aptos']
const ROW2 = ['Sui', 'Aptos', 'Algorand', 'Arbitrum', 'Aurora', 'avalanche', 'Binance', 'Cardano']
function Ecosystems() {
return (
<section className="eco" id="ecosystems">
<div className="container">
<h2 className="eco-title">
Our expanding network
<br />
of ecosystems
</h2>
</div>
<div className="eco-grid">
<div className="eco-row eco-row-1">
{ROW1.map((name, i) => (
<div className="eco-card" key={name + i}>
<span className="eco-icon">{CHAINS[name]}</span>
<span className="eco-name">{name}</span>
</div>
))}
</div>
<div className="eco-row eco-row-2">
{ROW2.map((name, i) => (
<div className="eco-card" key={name + i}>
<span className="eco-icon">{CHAINS[name]}</span>
<span className="eco-name">{name}</span>
</div>
))}
</div>
</div>
</section>
)
}
/* ---------------------------- audience cards ----------------------------- */
const AUDIENCES = [
{ title: ['For', 'Developers'], img: cardImg1, target: 'network' },
{ title: ['For', 'Validators'], img: cardImg2, target: 'ecosystems' },
{ title: ['For', 'Community'], img: cardImg3, target: 'footer' },
]
function Audiences() {
return (
<section className="audiences" id="audiences">
<div className="container">
<div className="aud-grid">
{AUDIENCES.map((a) => (
<div className="aud-card" key={a.title[1]}>
<h3>
{a.title[0]}
<br />
{a.title[1]}
</h3>
<img src={a.img} alt="" />
<button
type="button"
className="aud-btn"
aria-label={`${a.title[0]} ${a.title[1]}`}
onClick={() => scrollToId(a.target)}
>
<ArrowRight size={16} color="#111" />
</button>
</div>
))}
</div>
</div>
</section>
)
}
/* --------------------------------- footer -------------------------------- */
const FOOTER_COLS = [
{ head: 'Build', links: [['Developers', 'network'], ['Validators', 'audiences'], ['Primer', 'pillars']] },
{
head: 'Learn',
links: [
['About', 'top'],
['FAQs', 'pillars'],
['Ecosystem', 'ecosystems'],
['Careers', 'footer', 'hiring'],
['Contact us', 'footer'],
['Press & brand', 'footer'],
],
},
{
head: 'Community',
links: [['Podcast', 'top'], ['Blog', 'network'], ['Twitter', 'top'], ['Telegram', 'top'], ['Discord', 'top']],
},
{
head: 'Token',
links: [
['Explorer', 'top', 'soon'],
['FLX staking', 'top'],
['Etherscan', 'top'],
['Coingecko', 'top'],
['Coinmarketcap', 'top'],
],
},
]
const MARQUEE = Array.from({ length: 4 })
function Footer() {
return (
<footer className="footer-panel" id="footer">
<div className="marquee">
<div className="marquee-line">
{MARQUEE.map((_, i) => (
<span key={i}>
{i === 0 ? 'TRUSTLESS ' : 'THE TRUSTLESS '}
<em>DATA&nbsp;LAYER.</em>{' '}
</span>
))}
</div>
</div>
<img className="footer-wave" src={footerWave} alt="" />
<div className="footer-links">
{FOOTER_COLS.map((col) => (
<div className="fcol" key={col.head}>
<div className="fhead">{col.head}</div>
<ul>
{col.links.map(([label, target, pill]) => (
<li key={label}>
<a
href={`#${target}`}
onClick={(e) => {
e.preventDefault()
if (target === 'top') window.scrollTo({ top: 0, behavior: 'smooth' })
else scrollToId(target)
}}
>
{label}
</a>
{pill === 'hiring' && <span className="pill pill-hiring">We’re hiring!</span>}
{pill === 'soon' && <span className="pill pill-soon">Coming soon</span>}
</li>
))}
</ul>
</div>
))}
</div>
<div className="footer-bar">
<div className="fbar-left">
<a href="#top" onClick={(e) => e.preventDefault()}>Privacy</a>
<a href="#top" onClick={(e) => e.preventDefault()}>Terms</a>
</div>
<div className="fbar-center">©2023 SEDA. All rights reserved.</div>
<div className="fbar-right">
<span className="fbar-logo">
<SedaMark size={30} />
<span>seda</span>
</span>
<button
type="button"
className="fbar-up"
aria-label="Back to top"
onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
>
<ArrowUp />
</button>
</div>
</div>
</footer>
)
}
export default function App() {
return (
<div className="page">
<Hero />
<Stats />
<Features />
<Pillars />
<Ecosystems />
<Audiences />
<Footer />
</div>
)
}