Skip to content

Commit 87c8867

Browse files
committed
fix: enhance project view with responsive design and link updates
1 parent 668c8d8 commit 87c8867

2 files changed

Lines changed: 137 additions & 18 deletions

File tree

src/assets/base.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ body {
2121
color: var(--color-text);
2222
background: var(--color-background);
2323
font-family: 'Open Sans', sans-serif;
24+
font-size: 16px;
2425
}
2526

2627
#app {
@@ -32,3 +33,55 @@ body {
3233
main {
3334
flex-grow: 1;
3435
}
36+
37+
@media (max-width: 768px) {
38+
body {
39+
font-size: 14px;
40+
}
41+
42+
h1 {
43+
font-size: 1.8rem;
44+
}
45+
46+
h2 {
47+
font-size: 1.4rem;
48+
}
49+
50+
h3 {
51+
font-size: 1.2rem;
52+
}
53+
54+
h4 {
55+
font-size: 1rem;
56+
}
57+
58+
p {
59+
font-size: 0.95rem;
60+
}
61+
}
62+
63+
@media (max-width: 480px) {
64+
body {
65+
font-size: 13px;
66+
}
67+
68+
h1 {
69+
font-size: 1.5rem;
70+
}
71+
72+
h2 {
73+
font-size: 1.2rem;
74+
}
75+
76+
h3 {
77+
font-size: 1.1rem;
78+
}
79+
80+
h4 {
81+
font-size: 0.95rem;
82+
}
83+
84+
p {
85+
font-size: 0.9rem;
86+
}
87+
}

src/views/ProjectView.vue

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,44 @@ const projets = [
1313
{
1414
src: "https://github.com/raphbag/IoT-Home-Weather-Station/raw/main/.github/dashboard.jpg",
1515
alt: "Dashboard du projet IoT"
16-
}
16+
}
1717
],
1818
description: "Projet IoT de surveillance de la température et de l'humidité dans maison, utilisant un ESP32, un capteur DHT22 et la communication MQTT.",
19-
github: "https://github.com/raphbag/IoT-Home-Weather-Station"
19+
liens: [
20+
{
21+
url: "https://github.com/raphbag/IoT-Home-Weather-Station",
22+
label: "Github",
23+
icon: "/src/assets/github.svg",
24+
newTab: true
25+
}
26+
],
27+
type: "ESME"
28+
},
29+
{
30+
id: 2,
31+
titre: "WEB - Maquette Omnifood",
32+
images: [
33+
{
34+
src: "https://github.com/raphbag/maquette-omnifood/raw/master/.github/preview-omnifood-raphbag.png",
35+
alt: "Aperçu de ma version de Omnifood"
36+
}
37+
],
38+
description: "Refonte de la maquette Omnifood (omnifood.dev) en utilisant HTML et CSS pour créer un site web responsive et attrayant.",
39+
liens: [
40+
{
41+
url: "https://github.com/raphbag/maquette-omnifood",
42+
label: "Github",
43+
icon: "/src/assets/github.svg",
44+
newTab: true
45+
},
46+
{
47+
url: "./maquette-omnifood",
48+
label: "Site",
49+
icon: "https://github.com/raphbag/maquette-omnifood/raw/master/assets/images/icon.png",
50+
newTab: false
51+
}
52+
],
53+
type: "ESME"
2054
}
2155
]
2256
@@ -46,11 +80,21 @@ onMounted(() => {
4680
</div>
4781
<p>{{ projet.description }}</p>
4882
<div class="bottom">
49-
<a :href="projet.github" target="_blank">
50-
<img src="/src/assets/github.svg" width="26px" alt="Icon Github" />Github
51-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d6d6d6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><g fill="none" fill-rule="evenodd"><path d="M18 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2h5M15 3h6v6M10 14L20.2 3.8"/></g></svg>
52-
</a>
53-
<span><img src="@/assets/Esme-sudria-logo.png" alt="Logo ESME Sudria"/> ESME</span>
83+
<div class="liens">
84+
<a v-for="lien in projet.liens" :key="lien.url" :href="lien.url" :target="lien.newTab ? '_blank' : '_self'">
85+
<img :src="lien.icon" width="26px" :alt="`Icon ${lien.label}`" />
86+
{{ lien.label }}
87+
<svg v-if="lien.newTab" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d6d6d6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><g fill="none" fill-rule="evenodd"><path d="M18 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2h5M15 3h6v6M10 14L20.2 3.8"/></g></svg>
88+
</a>
89+
</div>
90+
<span v-if="projet.type === 'ESME'">
91+
<img src="@/assets/Esme-sudria-logo.png" alt="Logo ESME Sudria"/> ESME
92+
</span>
93+
<span v-else-if="projet.type === 'Perso'" class="perso">
94+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
95+
Perso
96+
</span>
97+
<span v-else class="autre">{{ projet.type }}</span>
5498
</div>
5599
</div>
56100
</TransitionGroup>
@@ -70,7 +114,6 @@ main {
70114
align-items: center;
71115
justify-content: center;
72116
padding: 15px;
73-
gap: 10px;
74117
}
75118
76119
.projet {
@@ -86,6 +129,7 @@ main {
86129
border-radius: 15px;
87130
transition: all 0.3s ease;
88131
max-width: 1000px;
132+
margin-bottom: 10px;
89133
/* background: linear-gradient(145deg, var(--vt-c-black), #161616); */
90134
}
91135
@@ -116,18 +160,31 @@ h2:hover {
116160
117161
.projet .images {
118162
display: grid;
119-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
163+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
120164
align-items: center;
121-
justify-content: center;
122-
gap: 10px;
123-
padding: 20px 0;
165+
justify-items: center;
166+
width: calc(100% + 40px);
167+
margin-left: -20px;
168+
margin-right: -20px;
169+
gap: 15px;
170+
padding: 20px;
124171
}
125172
126-
.projet img {
127-
border-radius: 5px;
128-
max-width: 100%;
129-
height: 100%;
173+
@media (max-width: 768px) {
174+
.projet .images {
175+
grid-template-columns: 1fr;
176+
gap: 10px;
130177
}
178+
}
179+
180+
.projet .images img {
181+
border-radius: 5px;
182+
width: auto;
183+
max-width: 100%;
184+
max-height: 300px;
185+
object-fit: contain;
186+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
187+
}
131188
132189
.projet a {
133190
display: flex;
@@ -143,16 +200,25 @@ h2:hover {
143200
}
144201
145202
.projet a:hover {
203+
flex-wrap: wrap;
204+
gap: 10px;
146205
background-color: #797979;
147-
color: #242424;
148-
transition: all 0.3s ease;
206+
transition: all 0.3s ease;
149207
}
150208
151209
.bottom {
152210
display: flex;
153211
align-items: center;
154212
justify-content: space-between;
155213
width: 100%;
214+
margin-top: 10px;
215+
}
216+
217+
.liens {
218+
display: flex;
219+
align-items: center;
220+
gap: 10px;
221+
flex-wrap: wrap;
156222
}
157223
158224
span {

0 commit comments

Comments
 (0)