-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu
154 lines (140 loc) · 3.49 KB
/
Menu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Navigation Menu with About Section</title>
<style>
/* Global Reset */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background-color: #f0f3f5;
color: #333;
}
/* Navbar Container */
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
background-color: #007acc;
color: #fff;
}
/* Logo */
.logo {
font-size: 1.5em;
font-weight: bold;
}
/* Navigation Links */
.nav-links {
display: flex;
list-style: none;
}
.nav-links li {
margin-left: 20px;
}
.nav-links a {
color: #fff;
text-decoration: none;
font-size: 1em;
padding: 5px 10px;
transition: background-color 0.3s ease;
}
.nav-links a:hover {
background-color: #005b99;
border-radius: 4px;
}
/* Mobile Menu Toggle Button */
.menu-toggle {
display: none;
font-size: 1.5em;
cursor: pointer;
}
/* Responsive Styling */
@media (max-width: 768px) {
.nav-links {
display: none;
flex-direction: column;
width: 100%;
text-align: center;
background-color: #007acc;
}
.nav-links li {
margin: 10px 0;
}
.menu-toggle {
display: block;
}
}
/* Show Menu on Mobile when Active */
.nav-links.active {
display: flex;
}
/* Main Content and iframe Styles */
main {
padding: 20px;
max-width: 800px;
margin: 20px auto;
}
.about-content {
display: none; /* Hidden by default */
}
.about-content iframe {
width: 100%;
height: 600px;
border: none;
}
</style>
</head>
<body>
<!-- Navbar Section -->
<nav>
<div class="logo">@mhmmdrafaa._</div>
<ul class="nav-links">
<li><a href="menu.html">Home</a></li>
<li><a href="Projek Baru.html" onclick="showAbout()">Isi Cerita</a></li>
<li><a href="about.html">About</a></li>
<li><a href="test.html">Contact</a></li>
</ul>
<div class="menu-toggle" onclick="toggleMenu()">☰</div>
</nav>
<!-- Main Content -->
<main>
<section id="home">
<h1>Welcome to My Website</h1>
<p>This is a sample page with a responsive navigation menu.</p>
</section>
<!-- About Section with Embedded Projek Baru.html -->
<section id="about-section" class="about-content">
<h2>About Us</h2>
<iframe src="Projek Baru.html" title="About Content"></iframe>
</section>
</main>
<!-- Home Section with Embedded menu.html -->
<section id="about-section" class="about-content">
<h2>Home</h2>
<iframe src="menu.html" title="Home Content"></iframe>
</section>
</main>
<footer style="text-align: center; padding: 10px; color: #777;">
<p>© 2024 Rafa Website</p>
</footer>
<script>
// Toggle Mobile Menu
function toggleMenu() {
const navLinks = document.querySelector('.nav-links');
navLinks.classList.toggle('active');
}
// Show About Section with Projek Baru.html
function showAbout() {
document.getElementById('about-section').style.display = 'block';
window.scrollTo(0, document.getElementById('about-section').offsetTop);
}
</script>
</body>
</html>