Skip to content

Commit e28db75

Browse files
committed
Added script file and favicon
1 parent e142a06 commit e28db75

7 files changed

+31
-55
lines changed

favicon.png

3.32 KB
Loading

future.html

+3-14
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,13 @@
1313

1414
<!-- Link to Font or Icon libraries (optional) -->
1515
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
16-
16+
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1717
<!-- Include any external JavaScript or CSS libraries (optional) -->
1818
</head>
1919
<body>
2020

2121
<!-- Header Section -->
22-
<header>
23-
<h1>Quantum4HEP</h1>
24-
<nav>
25-
<ul>
26-
<li><a href="index.html">Home</a></li>
27-
<li><a href="projects.html">Projects</a></li>
28-
<li><a href="peoples.html">Peoples</a></li>
29-
<li><a href="future.html">Future Ideas</a></li>
30-
<li><a href="https://github.com/Quantum4HEP">Github Repository</a></li>
31-
</ul>
32-
</nav>
33-
</header>
22+
<div id="header"></div>
3423

3524
<!-- Main Content Section
3625
<main>
@@ -61,6 +50,6 @@ <h2>Our Services</h2>
6150
</footer>
6251

6352
<!-- Link to JavaScript file (optional) -->
64-
<!--<script src="script.js"></script> -->
53+
<script src="script.js"></script>
6554
</body>
6655
</html>

header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- header.html -->
1+
<!-- -->
22
<header>
33
<h1><img src="Quantum4hep_logo.png" alt="Quantum4HEP Logo" width="200" height="200"> Quantum4HEP</h1>
44

index.html

+3-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<!-- Link to Font or Icon libraries (optional) -->
1515
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
16-
16+
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1717
<!-- Include any external JavaScript or CSS libraries (optional) -->
1818
</head>
1919
<body>
@@ -50,15 +50,7 @@ <h2>Our Services</h2>
5050
</footer>
5151

5252
<!-- Link to JavaScript file (optional) -->
53-
<!--<script src="script.js"></script> -->
54-
<script>
55-
// Load the header.html content into the #header div
56-
fetch("header.html")
57-
.then(response => response.text())
58-
.then(data => {
59-
document.getElementById("header").innerHTML = data;
60-
})
61-
.catch(error => console.error('Error loading header:', error));
62-
</script>
53+
<script src="script.js"></script>
54+
6355
</body>
6456
</html>

peoples.html

+3-14
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,13 @@
1313

1414
<!-- Link to Font or Icon libraries (optional) -->
1515
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
16-
16+
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1717
<!-- Include any external JavaScript or CSS libraries (optional) -->
1818
</head>
1919
<body>
2020

2121
<!-- Header Section -->
22-
<header>
23-
<h1>Quantum4HEP</h1>
24-
<nav>
25-
<ul>
26-
<li><a href="index.html">Home</a></li>
27-
<li><a href="projects.html">Projects</a></li>
28-
<li><a href="peoples.html">Peoples</a></li>
29-
<li><a href="future.html">Future Ideas</a></li>
30-
<li><a href="https://github.com/Quantum4HEP">Github Repository</a></li>
31-
</ul>
32-
</nav>
33-
</header>
22+
<div id="header"></div>
3423

3524
<!-- Main Content Section
3625
<main>
@@ -61,6 +50,6 @@ <h2>Our Services</h2>
6150
</footer>
6251

6352
<!-- Link to JavaScript file (optional) -->
64-
<!--<script src="script.js"></script> -->
53+
<script src="script.js"></script>
6554
</body>
6655
</html>

projects.html

+3-15
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,13 @@
1313

1414
<!-- Link to Font or Icon libraries (optional) -->
1515
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
16-
16+
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
1717
<!-- Include any external JavaScript or CSS libraries (optional) -->
1818
</head>
1919
<body>
2020

2121
<!-- Header Section -->
22-
<header>
23-
<h1>Quantum4HEP</h1>
24-
<img src="Quantum4hep_logo.png" alt="Quantum4HEP Logo" width="200" height="100">
25-
<nav>
26-
<ul>
27-
<li><a href="index.html">Home</a></li>
28-
<li><a href="projects.html">Projects</a></li>
29-
<li><a href="peoples.html">Peoples</a></li>
30-
<li><a href="future.html">Future Ideas</a></li>
31-
<li><a href="https://github.com/Quantum4HEP">Github Repository</a></li>
32-
</ul>
33-
</nav>
34-
</header>
22+
<div id="header"></div>
3523

3624
<!-- Main Content Section
3725
<main>
@@ -62,6 +50,6 @@ <h2>Our Services</h2>
6250
</footer>
6351

6452
<!-- Link to JavaScript file (optional) -->
65-
<!--<script src="script.js"></script> -->
53+
<script src="script.js"></script>
6654
</body>
6755
</html>

script.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
async function loadHeader() {
2+
try {
3+
const response = await fetch("header.html");
4+
5+
// Check if the file was found
6+
if (!response.ok) {
7+
throw new Error(`HTTP error! status: ${response.status}`);
8+
}
9+
10+
const data = await response.text();
11+
document.getElementById("header").innerHTML = data;
12+
} catch (error) {
13+
console.error("Error loading header:", error);
14+
}
15+
}
16+
17+
// Call the function to load the header
18+
loadHeader();

0 commit comments

Comments
 (0)