Skip to content

Commit 2e0e584

Browse files
committed
Fix BASE_URL paths for images, CSS, and navigation, also update CSS file
1 parent edfa690 commit 2e0e584

File tree

11 files changed

+85
-87
lines changed

11 files changed

+85
-87
lines changed
-18.6 KB
Binary file not shown.

project/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ import { defineConfig } from 'astro/config';
55
export default defineConfig({
66

77
site: 'https://Silv3rP.github.io',
8-
base: '/project/',
8+
base: '/project',
99
});

project/public/css/styles.css

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
2-
/* Code I did not know about was found on W3Schools and other tutorial sites */
3-
4-
5-
/* reset box sizing */
61
*{
2+
margin: 0;
3+
padding: 0;
74
box-sizing: border-box;
85
}
96

10-
/* main layout - black background with flexbox */
117
body, html{
128
background-color: black;
139
min-height: 100vh;
14-
margin: 0;
15-
padding: 0;
1610
display: flex;
1711
flex-direction: column;
1812
color: white;
1913
}
2014

21-
/* header with yellow background */
2215
header {
2316
background-color: yellow;
2417
padding: 10px;
@@ -29,18 +22,15 @@ header {
2922
justify-content: center;
3023
align-items: center;
3124
position: relative;
32-
3325
}
3426

35-
/* logo positioned on the left */
3627
.logo{
3728
height: 50px;
3829
margin-right: 15px;
3930
position: absolute;
4031
left: 10px;
4132
}
4233

43-
/* sticky nav bar */
4434
nav{
4535
margin-top: 20px;
4636
text-align: center;
@@ -52,7 +42,6 @@ nav{
5242
border: solid black 2px;
5343
}
5444

55-
/* nav links styling */
5645
nav a{
5746
display: inline-block;
5847
text-decoration: none;
@@ -61,27 +50,23 @@ nav a{
6150
background-color: yellow;
6251
font-weight: bold;
6352
font-size: 1.5em;
64-
padding: 15px;
53+
padding: 15px;
6554
border-radius: 5px;
6655
transition: background-color 0.5s, color 0.5s;
67-
6856
}
6957

70-
/* hover effect for nav links */
7158
nav a:hover{
7259
background-color: black;
7360
color: yellow;
7461
text-decoration: underline;
7562
}
7663

77-
/* main content area */
7864
main{
7965
flex: 1;
8066
padding: 2rem;
8167
}
8268

83-
/* images centered and responsive */
84-
.img{
69+
img{
8570
width: 50%;
8671
height: auto;
8772
display: block;
@@ -91,33 +76,41 @@ main{
9176

9277
.gallery-images{
9378
display: flex;
94-
flex-wrap: nowrap;
95-
gap: 5em;
96-
width: 25%;
79+
flex-wrap: wrap;
80+
gap: 2em;
81+
width: 100%;
82+
justify-content: center;
83+
}
9784

85+
.gallery-images img {
86+
max-width: 100%;
87+
height: auto;
88+
}
9889

90+
iframe{
91+
display: block;
92+
margin: 20px auto;
93+
width: 560px;
94+
max-width: 100%;
95+
height: 315px;
9996
}
10097

101-
/* main heading */
10298
h1 {
10399
font-size: 3em;
104-
margin: 0;
105100
padding: 20px;
106101
color: black;
107102
background-color: yellow;
108103
font-style: italic;
109104
text-align: center;
110105
}
111106

112-
/* paragraph text */
113107
p{
114108
font-size: 1.2em;
115109
line-height: 1.6;
116110
margin-top: 20px;
117111
text-align: center;
118112
}
119113

120-
/* h2 subheading */
121114
h2 {
122115
font-size: 2em;
123116
color: white;
@@ -126,8 +119,7 @@ h2 {
126119
margin-bottom: 20px;
127120
}
128121

129-
/* ordered list styling */
130-
.ol {
122+
ol {
131123
background-color: yellow;
132124
color: black;
133125
padding: 20px 40px;
@@ -137,22 +129,20 @@ h2 {
137129
line-height: 1.8;
138130
}
139131

140-
/* table styling */
141-
.table {
132+
table {
142133
width: 50%;
143134
border-collapse: separate;
144-
border-spacing: 10px 10px;
135+
border-spacing: 10px;
145136
background-color: yellow;
146137
color: black;
147138
margin: auto;
148139
}
149140

150-
.table th,
151-
.table td {
141+
table th,
142+
table td {
152143
text-align: left;
153144
}
154145

155-
/*form submission css*/
156146
form {
157147
background-color: yellow;
158148
color: black;
@@ -170,28 +160,29 @@ form {
170160
padding: 10px 20px;
171161
font-size: 1em;
172162
border-radius: 5px;
163+
cursor: pointer;
173164
}
174165

175166
.submit-button:hover {
176167
background-color: red;
177168
color: black;
178169
}
179170

180-
/* footer at bottom */
181171
footer{
182-
bottom: 0;
183172
width: 100%;
184173
padding: 10px;
185174
background-color: yellow;
186175
font-style: italic;
187176
font-size: 1.5em;
188177
text-align: center;
189178
color: black;
190-
display: block;
191-
192179
}
193180

194-
/* hover effect for footer links */
181+
footer a{
182+
color: black;
183+
text-decoration: none;
184+
}
185+
195186
footer a:hover {
196187
background-color: black;
197188
color: yellow;
@@ -200,7 +191,6 @@ footer a:hover {
200191
border-radius: 5px;
201192
}
202193

203-
/* laptop and smaller screens */
204194
@media (max-width: 1024px) {
205195
.logo {
206196
height: 45px;
@@ -215,12 +205,11 @@ footer a:hover {
215205
font-size: 2.5em;
216206
}
217207

218-
.img {
208+
img {
219209
width: 70%;
220210
}
221211
}
222212

223-
/* tablets */
224213
@media (max-width: 768px) {
225214
.logo {
226215
height: 35px;
@@ -248,29 +237,44 @@ footer a:hover {
248237
font-size: 1em;
249238
}
250239

251-
.img {
240+
img {
252241
width: 90%;
253242
}
254243

255244
main {
256245
padding: 1rem;
257246
}
247+
248+
.gallery-images {
249+
flex-direction: column;
250+
align-items: center;
251+
gap: 1em;
252+
}
253+
254+
iframe {
255+
width: 100%;
256+
}
257+
258+
table {
259+
width: 100%;
260+
font-size: 0.9em;
261+
}
258262
}
259263

260-
/* mobile phones */
261264
@media (max-width: 480px) {
262265
nav a {
263266
font-size: 1em;
264267
padding: 8px;
265268
display: block;
266-
margin: 5px 0;
269+
margin: 5px auto;
270+
width: 90%;
267271
}
268272

269273
h1 {
270274
font-size: 1.5em;
271275
}
272276

273-
.img {
277+
img {
274278
width: 100%;
275279
}
276280
}

project/src/components/banner.astro

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@
33
44
---
55

6-
<picture class="img">
7-
<source srcset="images/logo.png" media="(max-width: 400px)" />
8-
<img src="images/logo.png" alt="Banner Image" style="width: 100%; height: auto;" />
9-
</picture>
10-
<br>
6+
<img src={`${import.meta.env.BASE_URL}/images/logo.png`} alt="Banner Image"/>

project/src/components/footer.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
33
---
44
<footer>
5-
<a href="./">Home</a>
5+
<a href={`${import.meta.env.BASE_URL}/`}>Home</a>
66

7-
<a href="./about">About</a>
7+
<a href={`${import.meta.env.BASE_URL}/about`}>About</a>
88

9-
<a href="./gallery">Gallery</a>
9+
<a href={`${import.meta.env.BASE_URL}/gallery`}>Gallery</a>
1010

11-
<a href="./contact">Contact</a>
11+
<a href={`${import.meta.env.BASE_URL}/contact`}>Contact</a>
1212
<p>&copy; 2025 Saykan Combat. All rights reserved.</p>
1313
<p>Designed by C</p>
1414
<strong><a href="mailto:example@example.com">Contact Designer</a></strong>

project/src/components/header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
<header>
88
<picture class="logo">
9-
<source srcset="images/logo.png" media="(max-width: 400px)" />
10-
<img src="images/logo.png" alt="Banner Image" style="width: 25%; height: auto;" />
9+
<source srcset={`${import.meta.env.BASE_URL}/images/logo.png`} media="(max-width: 400px)" />
10+
<img src={`${import.meta.env.BASE_URL}/images/logo.png`} alt="Banner Image" style="width: 25%; height: auto;" />
1111
</picture>
1212
<h1>SAYKAN COMBAT</h1>
1313
<br>

project/src/components/nav.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
---
55

66
<nav>
7-
<a href="./">Home</a>
8-
<a href="./about">About</a>
9-
<a href="./gallery">Gallery</a>
10-
<a href="./contact">Contact</a>
7+
<a href={`${import.meta.env.BASE_URL}/`}>Home</a>
8+
<a href={`${import.meta.env.BASE_URL}/about`}>About</a>
9+
<a href={`${import.meta.env.BASE_URL}/gallery`}>Gallery</a>
10+
<a href={`${import.meta.env.BASE_URL}/contact`}>Contact</a>
1111
</nav>

project/src/layouts/Layout.astro

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import Footer from '../components/footer.astro';
44
import Banner from '../components/banner.astro';
55
import Nav from '../components/nav.astro';
66
7-
let baseURL = "";
8-
const isProd = import.meta.env.PROD;
9-
if (isProd) {
10-
baseURL = import.meta.env.SITE + import.meta.env.BASE_URL;
11-
} else {
12-
baseURL = import.meta.env.BASE_URL;
13-
}
7+
const baseURL = import.meta.env.BASE_URL;
148
---
159

1610
<!DOCTYPE html>
@@ -20,7 +14,7 @@ if (isProd) {
2014
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2115
<title>Saykan Combat</title>
2216
<base href={baseURL} />
23-
<link rel="stylesheet" href="./css/styles.css" />
17+
<link rel="stylesheet" href={`${import.meta.env.BASE_URL}/css/styles.css`} />
2418
</head>
2519
<body>
2620
<Header />

0 commit comments

Comments
 (0)