Skip to content

Commit 2d8a232

Browse files
committed
Update(main page) structure html and create button component
1 parent 9e896b2 commit 2d8a232

File tree

3 files changed

+46
-58
lines changed

3 files changed

+46
-58
lines changed

src/components/Button.astro

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
interface Props {
3+
title: string;
4+
href: string;
5+
}
6+
7+
const { href, title } = Astro.props;
8+
---
9+
10+
<a href={href} class=" bg-orange-700 px-4 py-2 rounded-lg " >{title}</a>

src/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/// <reference path="../.astro/types.d.ts" />
12
/// <reference types="astro/client" />

src/pages/index.astro

+35-58
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,49 @@
11
---
22
import LayoutPage from '../layouts/page.astro';
33
import Header from '../components/header.astro';
4+
import Button from '../components/Button.astro';
5+
import Card from '../components/Card.astro';
6+
7+
const cards = [
8+
{ title: "3D Printer", body: "yay" ,href: "" },
9+
{ title: "2D Printer", body: "yey" ,href: "" },
10+
{ title: "1D Printer", body: "null" ,href: "" }
11+
]
12+
413
---
514

615
<LayoutPage title="Mathieu Chavanel.B - Potfolio">
716
<Header title={["Accueil", "Projets", "Labs", "Contact"]} href={["/", "/projets", "/#labs", "/#contact"]}></Header>
8-
<h1>Welcome to Home</h1>
17+
18+
<div id="home" class=" ">
19+
20+
<h1>Mathieu Chavanel</h1>
21+
<h2>Creatif Developpeur</h2>
22+
<img src="" alt="">
23+
<Button title='Projets' href='/projets'></Button>
24+
<Button title='Contact' href='/#contact'></Button>
25+
<a href="">Découvrir</a>
26+
27+
</div>
28+
29+
<div id="projectHighlight">
30+
{cards.map((currentCard) => (
31+
<Card title={currentCard.title} body={currentCard.body} href={currentCard.href}></Card>
32+
))}
33+
</div>
34+
35+
<div id="labs">
36+
37+
</div>
38+
39+
<div id="contact">
40+
41+
</div>
42+
943
</LayoutPage>
1044

1145
<style>
1246
@view-transition {
1347
navigation: auto; /* enabled! */
1448
}
15-
16-
main {
17-
margin: auto;
18-
padding: 1rem;
19-
width: 800px;
20-
max-width: calc(100% - 2rem);
21-
color: white;
22-
font-size: 20px;
23-
line-height: 1.6;
24-
}
25-
.astro-a {
26-
position: absolute;
27-
top: -32px;
28-
left: 50%;
29-
transform: translatex(-50%);
30-
width: 220px;
31-
height: auto;
32-
z-index: -1;
33-
}
34-
h1 {
35-
font-size: 4rem;
36-
font-weight: 700;
37-
line-height: 1;
38-
text-align: center;
39-
margin-bottom: 1em;
40-
}
41-
.text-gradient {
42-
background-image: var(--accent-gradient);
43-
-webkit-background-clip: text;
44-
-webkit-text-fill-color: transparent;
45-
background-size: 400%;
46-
background-position: 0%;
47-
}
48-
.instructions {
49-
margin-bottom: 2rem;
50-
border: 1px solid rgba(var(--accent-light), 25%);
51-
background: linear-gradient(rgba(var(--accent-dark), 66%), rgba(var(--accent-dark), 33%));
52-
padding: 1.5rem;
53-
border-radius: 8px;
54-
}
55-
.instructions code {
56-
font-size: 0.8em;
57-
font-weight: bold;
58-
background: rgba(var(--accent-light), 12%);
59-
color: rgb(var(--accent-light));
60-
border-radius: 4px;
61-
padding: 0.3em 0.4em;
62-
}
63-
.instructions strong {
64-
color: rgb(var(--accent-light));
65-
}
66-
.link-card-grid {
67-
display: grid;
68-
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
69-
gap: 2rem;
70-
padding: 0;
71-
}
7249
</style>

0 commit comments

Comments
 (0)