Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cex/dex marquee animation #110

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@
#d9d9d900 100%
);
}
.small-horizontal-mask {
mask-image: linear-gradient(
90deg,
#d9d9d900 0%,
#d9d9d9 10%,
#d9d9d9 90%,
#d9d9d900 100%
);
}
.trusted-heading-bg {
background-image: linear-gradient(
106.31deg,
Expand Down Expand Up @@ -297,6 +306,30 @@
background-repeat: no-repeat;
}
}
.exchanges-marquee-vars {
--badge-width: 118px;
}
@media (min-width: 1024px) {
.exchanges-marquee-vars {
--badge-width: 124px;
}
}
@keyframes exchanges-marquee {
from {
transform: translateZ(0);
}
to {
transform: translate3d(
calc((var(--badge-width) * 8 + (calc(6px * 7))) * -1 - 6px),
0,
0
);
}
}
.animate-exchanges-marquee {
/* width: calc(var(--badge-width) * 8 + (6px * (var(--badge-width)) - 2)); */
animation: exchanges-marquee 25s linear infinite;
}
.is-checked .is-checked-arrow-rotation {
rotate: 180deg;
}
Expand All @@ -306,7 +339,6 @@
.is-checked .is-checked-show {
display: block;
}

.bg-stake-heading {
background: linear-gradient(180deg, #eeecea 22.39%, #acd9e7 100%);
background-clip: text;
Expand Down
5 changes: 3 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import EarnSection from "@/components/sections/earn-section";
import ExploreAssets from "@/components/sections/explore-assets";
import HelpSection from "@/components/sections/help-section";
import HeroSection from "@/components/sections/hero";
import OsmoCTASection from "@/components/sections/osmo-cta";
import StatsWithTweets from "@/components/sections/stats-with-tweets";
import TokenStatsSection from "@/components/sections/token-stats";
import TradeSection from "@/components/sections/trade-section";
Expand All @@ -15,8 +16,8 @@ export default function Home() {
<TokenStatsSection />
<ExploreAssets />
<StatsWithTweets />
{/* <OsmoCTASection />
<StakeSection /> */}
<OsmoCTASection />
{/* <StakeSection /> */}
<EarnSection />
<HelpSection />
<VoteSection />
Expand Down
98 changes: 70 additions & 28 deletions components/sections/osmo-cta/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,49 @@ import Image from "next/image";
import Link from "next/link";
import { Suspense } from "react";

const exchanges: ExchangeBadgeProps[] = [
{
name: "Binance",
link: "https://www.binance.com/en/price/osmosis",
logoUri: "/assets/binance-logo.svg",
},
{
name: "Coinbase",
link: "https://www.coinbase.com/price/osmosis",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "crypto.com",
link: "https://crypto.com/price/osmosis",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "Bithumb",
link: "https://www.bithumb.com/react/trade/status/OSMO-KRW",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "Kucoin",
link: "https://www.kucoin.com/trade/OSMO-USDT",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "Mexc",
link: "https://www.mexc.com/en-US/exchange/OSMO_USDT",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "Gate.io",
link: "https://www.gate.io/trade/OSMO_USDT",
logoUri: "/assets/coinbase-logo.svg",
},
{
name: "Bitget",
link: "https://www.bitget.com/spot/OSMOUSDT",
logoUri: "/assets/coinbase-logo.svg",
},
];

export default function OsmoCTASection() {
return (
<div className="relative">
Expand Down Expand Up @@ -69,34 +112,11 @@ export default function OsmoCTASection() {
<span className="text-sm leading-5.5 text-neutral-100 lg:text-base lg:leading-6.25">
Listed on 15+ exchanges, including:
</span>
<div className="flex items-center gap-1.5">
<div className="flex h-8 w-[118px] items-center justify-center rounded-md border border-solid border-osmoverse-650 bg-osmoverse-775 lg:w-[124px]">
<Link
href={"https://www.binance.com/en/price/osmosis"}
target="_blank"
>
<Image
src={"/assets/binance-logo.svg"}
alt="Binance logo"
width={87}
height={17}
className="2xl:h-5 2xl:w-25"
/>
</Link>
</div>
<div className="flex h-8 w-[118px] items-center justify-center rounded-md border border-solid border-osmoverse-650 bg-osmoverse-775">
<Link
href={"https://www.coinbase.com/price/osmosis"}
target="_blank"
>
<Image
src={"/assets/coinbase-logo.svg"}
alt="Coinbase logo"
width={91}
height={18}
className="2xl:h-5 2xl:w-25"
/>
</Link>
<div className="small-horizontal-mask relative h-8 overflow-hidden">
<div className="exchanges-marquee-vars animate-exchanges-marquee absolute flex items-center gap-1.5">
{exchanges.concat(exchanges).map((props) => (
<ExchangeBadge key={props.name} {...props} />
))}
</div>
</div>
</div>
Expand Down Expand Up @@ -250,3 +270,25 @@ async function CoinGeckoRank() {
</span>
);
}

interface ExchangeBadgeProps {
name: string;
link: string;
logoUri: string;
}

function ExchangeBadge({ link, logoUri, name }: ExchangeBadgeProps) {
return (
<div className="flex h-8 w-[118px] items-center justify-center rounded-md border border-solid border-osmoverse-650 bg-osmoverse-775 lg:w-[124px]">
<Link href={link} target="_blank">
<Image
src={logoUri}
alt={`${name} logo`}
width={87}
height={17}
className="2xl:h-5 2xl:w-25"
/>
</Link>
</div>
);
}