-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
185 lines (164 loc) · 5.45 KB
/
index.html
File metadata and controls
185 lines (164 loc) · 5.45 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic SPA with jQuery and HTMX</title>
<!-- jQuery CDN -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!-- HTMX CDN -->
<script src="https://unpkg.com/htmx.org@2.0.2"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<!-- GSAP CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
/* body {
font-family: Arial, sans-serif;
margin: 0;
background-color: #f0f0f0;
}
nav {
background-color: #333;
padding: 1rem;
margin: 0;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
}
nav li {
margin: 0 1rem;
}
nav a {
color: white;
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 4px;
}
nav a:hover {
background-color: #555;
}
.active {
background-color: #007bff;
color: white;
}
#content {
max-width: 800px;
margin: 2rem auto;
padding: 1.5rem;
background-color: white;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
min-height: 400px;
} */
/* Cool full-body background image */
body {
min-height: 100vh;
background:
linear-gradient(120deg, rgba(0,198,251,0.25) 0%, rgba(0,91,234,0.18) 100%),
url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1200&q=80') no-repeat center center fixed;
background-size: cover;
background-attachment: fixed;
background-blend-mode: overlay;
}
/* Hide the top nav on mobile, show bottom nav */
@media (max-width: 767.98px) {
nav:not(.mobile-bottom-nav) {
display: none !important;
}
.mobile-bottom-nav {
display: flex !important;
}
}
/* Bottom nav styles */
.mobile-bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 64px;
background: #fff;
border-top: 1px solid #e0e0e0;
display: none;
z-index: 1000;
box-shadow: 0 -2px 12px 0 rgba(0,0,0,0.04);
justify-content: space-around;
align-items: center;
}
.mobile-bottom-nav .nav-link {
flex: 1 1 0;
text-align: center;
color: #555;
text-decoration: none;
font-size: 0.85rem;
padding: 0.5rem 0 0.2rem 0;
transition: color 0.2s;
display: flex;
flex-direction: column;
align-items: center;
}
.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:active,
.mobile-bottom-nav .nav-link:focus {
color: #007bff;
}
.mobile-bottom-nav .nav-icon {
font-size: 1.5rem;
line-height: 1;
margin-bottom: 0.1rem;
}
</style>
</head>
<body>
<!-- Navigation Bar -->
<nav>
<ul>
<li><a href="#home" class="nav-link" hx-get="pages/page_home.html" hx-target="#content"
hx-push-url="#home">Home</a></li>
<li><a href="#myprofile" class="nav-link" hx-get="pages/page_myprofile.html" hx-target="#content"
hx-push-url="#myprofile">myprofile</a></li>
<li><a href="#contact" class="nav-link" hx-get="pages/page_contact.html" hx-target="#content"
hx-push-url="#contact">Contact</a></li>
</ul>
</nav>
<!-- Main Content Area -->
<div id="content">
<!-- Initial content will be loaded here -->
</div>
<script>
$(document).ready(function () {
// Handle navigation link clicks
$('.nav-link').on('click', function (e) {
e.preventDefault();
// Remove active class from all links
$('.nav-link').removeClass('active');
// Add active class to clicked link
$(this).addClass('active');
});
// Load initial content based on hash or default to home
function loadInitialContent() {
const hash = window.location.hash || '#home';
const pageMap = {
'#home': 'pages/page_home.html',
'#myprofile': 'pages/page_myprofile.html',
'#contact': 'pages/page_contact.html'
};
const url = pageMap[hash] || 'pages/page_home.html';
$('.nav-link[href="' + hash + '"]').addClass('active');
htmx.ajax('GET', url, { target: '#content', pushUrl: hash });
}
// Load content on page load
loadInitialContent();
// Handle hash changes
$(window).on('hashchange', loadInitialContent);
});
</script>
<div>asfsdf</div>
</body>
</html>