Skip to content

Commit b31fc1c

Browse files
committed
Add anchors
1 parent 3ad4a83 commit b31fc1c

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

src/app.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,14 @@
5555
body {
5656
background-color: #f9f9f9;
5757
}
58+
59+
html {
60+
scroll-behavior: smooth;
61+
}
62+
63+
a.anchor {
64+
display: block;
65+
position: relative;
66+
top: -150px;
67+
visibility: hidden;
68+
}

src/routes/index.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export default function Home() {
5454
<span class="font-semibold text-[#141416]">$20&nbsp;bonus</span>.
5555
</p>
5656
<div class="flex flex-row gap-[23px] mt-[40px] lg:mt-[30px] xl:mt-[45px] reveal-buttons invisible">
57-
<Button size="md" fill>
57+
<Button href="/#weekly" size="md" fill>
5858
Explore More
5959
</Button>
60-
<Button size="md" white>
60+
<Button href="/#weekly" size="md" white>
6161
Create NFT
6262
</Button>
6363
</div>
@@ -67,6 +67,7 @@ export default function Home() {
6767
alt="Trustpilot 5-star"
6868
/>
6969
<div class="hidden lg:flex flex-row gap-[46px] mt-[60px] lg:mt-[82px]">
70+
<a class="anchor" id="stats" />
7071
<Stat count={430} caption="Art Works" class="reveal-stat-1 invisible" />
7172
<Stat count={159} caption="Creators" class="reveal-stat-2 invisible" />
7273
<Stat count={87} caption="Collections" class="reveal-stat-3 invisible" />
@@ -118,6 +119,7 @@ export default function Home() {
118119
</div>
119120
</div>
120121
<div class="text-center lg:text-start mt-[80px] lg:mt-[100px] xl:mt-[164px] bg-[#f1f1f1] flex flex-col items-center pt-[70px] pb-[55px] lg:pb-[90px] max-w-screen relative">
122+
<a class="anchor" id="weekly" />
121123
<h2 class="font-[Poppins] text-[30px] lg:text-[32px] xl:text-[45px] text-[#c5c5c5] font-semibold">
122124
Weekly - Top NFT
123125
</h2>
@@ -160,6 +162,7 @@ export default function Home() {
160162
<Recent onlyLarge position="right" />
161163
</div>
162164
<div class="mt-[78px] lg:mt-[240px] flex flex-col items-center px-[30px] lg:px-[60px] xl:px-[100px] max-w-[1440px] mx-auto">
165+
<a class="anchor" id="collection" />
163166
<h2 class="capitalize font-[Poppins] font-semibold text-[30px] xl:text-[44px] text-[#141416]">
164167
Top Collection
165168
</h2>
@@ -246,6 +249,7 @@ export default function Home() {
246249
</div>
247250
</div>
248251
<div class="px-[27px] lg:px-[70px] xl:px-[100px] mt-[140px] lg:mt-[200px] w-full">
252+
<a class="anchor" id="sell" />
249253
<div class="w-full max-w-[1245px] rounded-2xl bg-[#141416] flex flex-col lg:flex-row gap-[36px] lg:gap-0 justify-between px-[40px] py-[22px] lg:px-[31px] lg:py-[31px] mx-auto">
250254
<div class="flex flex-col lg:mt-[13.22px] lg:ml-[35px] items-center text-center lg:items-start lg:text-start">
251255
<h2 class="font-[Poppins] font-semibold text-[22px] lg:text-[32px] xl:text-[45px] text-white">
@@ -255,10 +259,12 @@ export default function Home() {
255259
World’s Largest NFT Place
256260
</p>
257261
<div class="flex flex-row justify-center lg:justify-start gap-[15px] lg:gap-[22px] xl:gap-[30px] mt-[25px] lg:mt-[35px] xl:mt-[auto]">
258-
<Button size="xl" white fill>
262+
<Button size="xl" href="/#weekly" white fill>
259263
Explore More
260264
</Button>
261-
<Button size="xl2">Sell Artwork</Button>
265+
<Button size="xl2" href="/#sell">
266+
Sell Artwork
267+
</Button>
262268
</div>
263269
</div>
264270
<div class="relative w-full lg:w-[260px] xl:w-[369px] aspect-369/249">

src/shared/ui/Button/Button.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import { ParentProps } from "solid-js"
22
import { button } from "./styles"
3+
import { A } from "@solidjs/router"
34

45
type ButtonProps = ParentProps & {
56
size: "sm" | "md" | "lg" | "xl" | "xl2"
67
fill?: boolean
78
white?: boolean
9+
href?: string
810
}
911

1012
const Button = (props: ButtonProps) => (
11-
<button class={button({ size: props.size, fill: props.fill, white: props.white })}>{props.children}</button>
13+
<A href={props.href || "/#"} class={button({ size: props.size, fill: props.fill, white: props.white })}>
14+
{props.children}
15+
</A>
1216
)
1317

1418
export default Button

src/shared/ui/Nav/Nav.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ const Nav = () => {
1414
<div class="flex flex-row gap-[57px] items-center">
1515
<img src="/divesea/icons/logo.svg" class="w-[53px] h-[53px]" alt="Logo" />
1616
<div class="flex flex-row gap-[24px]">
17-
<a class="nav-link" href="#">
18-
Discover
17+
<a class="nav-link" href="#weekly">
18+
Weekly
1919
</a>
20-
<a class="nav-link" href="#">
21-
Creators
20+
<a class="nav-link" href="#collection">
21+
Collection
2222
</a>
23-
<a class="nav-link" href="#">
23+
<a class="nav-link" href="#sell">
2424
Sell
2525
</a>
26-
<a class="nav-link" href="#">
26+
<a class="nav-link" href="#stats">
2727
Stats
2828
</a>
2929
</div>
@@ -52,18 +52,15 @@ const Nav = () => {
5252
}}
5353
onClick={toggle}
5454
>
55-
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#">
56-
Discover
55+
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#weekly">
56+
Weekly
5757
</a>
58-
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#">
59-
Creators
58+
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#collection">
59+
Collection
6060
</a>
61-
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#">
61+
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#sell">
6262
Sell
6363
</a>
64-
<a class="uppercase font-[Inter] font-medium text-[#606060] text-[24px]" href="#">
65-
Stats
66-
</a>
6764
</div>
6865
</>
6966
)

0 commit comments

Comments
 (0)