-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
245 lines (217 loc) · 8.12 KB
/
Copy pathindex.html
File metadata and controls
245 lines (217 loc) · 8.12 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fixed Nav Menu By JavaScript | منوی فیکس چسبان با جاوا اسکریپت</title>
<meta name="description" content="Fix Your Nav Menu Position By JavaScript | منوی فیکس برای سایت با جاوا اسکریپت فیکس کردن منو در بالای سایت"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/vazirmatn-font-face.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap">
<style>
/* Developed by Amin Arjmand
Site: aminarjmand.com | GitHub: @sibche2013
*/
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Inter', 'Vazirmatn', sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
min-height: 2000px; /* high height to allow long scrolling demo */
color: #333333;
}
.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 20px 0;
}
header {
width: 100%;
margin-bottom: 20px;
}
.headerImg {
height: 180px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
color: #1e5f38;
font-size: 1.5rem;
font-weight: 600;
border-radius: 12px 12px 0 0;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
nav {
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.4);
border-top: none;
padding: 5px 15px;
display: flex;
gap: 10px;
border-radius: 0 0 12px 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
nav a {
text-decoration: none;
color: #2c3e50;
font-size: 1rem;
font-weight: 500;
padding: 12px 20px;
border-radius: 8px;
transition: all 0.2s;
}
nav a:hover {
background: rgba(46, 204, 113, 0.15);
color: #27ae60;
}
/* Fixed Class triggered by JS */
.topMenu {
position: fixed;
top: 0;
left: 0;
width: 100%;
border-radius: 0;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
z-index: 9999;
padding: 5px 5%;
}
.content-dummy {
background: rgba(255, 255, 255, 0.5);
border: 1px dashed rgba(0,0,0,0.1);
padding: 60px 20px;
text-align: center;
border-radius: 12px;
margin-top: 30px;
color: #7f8c8d;
}
.button {
font-family: inherit;
display: block;
margin: 40px auto;
padding: 12px 30px;
border: 1px solid rgba(0,0,0,0.08);
cursor: pointer;
font-size: 0.95rem;
background-color: #ffffff;
color: #333333;
border-radius: 30px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
transition: all 0.2s ease;
}
.button:hover {
background-color: #27ae60;
color: white;
border-color: #27ae60;
transform: translateY(-2px);
}
</style>
</head>
<body>
<div class="container">
<header id="header-wrapper">
<div class="headerImg">
Your Premium Website Header Banner
</div>
<nav id="menu">
<a href="#">Home Page</a>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<a href="#">Link 4</a>
</nav>
</header>
<div class="content-dummy">
<h3>👇 Scroll down to see the magic sticky navbar effect! 👇</h3>
<p style="margin-top: 15px;">اسکرول کنید تا چسبیدن منو به بالای صفحه را مشاهده کنید</p>
</div>
<button class="button" onclick="history.back();">← Back To Previous Page</button>
</div>
<script src="fixedNavMenu.js"></script>
<div class="floating-nav-container">
<a href="https://demo.aminarjmand.com" class="floating-btn btn-back-home" title="برگشت به داشبورد / Back to Dashboard">
🏠 <span class="nav-text">صفحه مخازن</span>
</a>
<a href="#" id="dynamic-github-btn" target="_blank" class="floating-btn btn-github-repo" title="مشاهده مخزن گیتهاب / View GitHub Repo">
🐙 <span class="nav-text">گیتهاب مخزن</span>
</a>
</div>
<style>
/* استایل دکمههای شناور */
.floating-nav-container {
position: fixed;
bottom: 25px;
left: 25px;
display: flex;
flex-direction: column;
gap: 12px;
z-index: 99999;
direction: rtl; /* برای هماهنگی متن فارسی */
}
.floating-btn {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 18px;
border-radius: 50px;
color: #ffffff !important;
text-decoration: none !important;
font-family: 'Vazirmatn', sans-serif;
font-size: 0.85rem;
font-weight: bold;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-back-home {
background: linear-gradient(135deg, #2c3e50, #34495e);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-github-repo {
background: linear-gradient(135deg, #24292e, #4c5157);
border: 1px solid rgba(255, 255, 255, 0.1);
}
/* افکت هوور */
.floating-btn:hover {
transform: translateY(-4px) scale(1.03);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
/* واکنشگرایی برای موبایل (مخفی کردن متن برای شلوغ نشدن صفحه) */
@media (max-width: 480px) {
.floating-nav-container {
bottom: 15px;
left: 15px;
gap: 8px;
}
.floating-btn {
padding: 12px;
border-radius: 50%;
}
.floating-btn .nav-text {
display: none; /* در موبایل فقط آیکونها نمایش داده میشوند */
}
}
</style>
<script>
// اسکریپت هوشمند برای تشخیص خودکار نام مخزن و ساخت لینک گیتهاب
(function() {
const pathSegments = window.location.pathname.split('/').filter(segment => segment !== "");
// اگر پروژه در سابفولدر بود نام آن را میگیرد، در غیر این صورت نام پیشفرض را خالی میگذارد
const repoName = pathSegments.length > 0 ? pathSegments[0] : "";
const githubBtn = document.getElementById('dynamic-github-btn');
if (repoName) {
// ساخت اتوماتیک لینک گیتهاب با هماهنگی دامین دمو
githubBtn.href = "https://github.com/sibche2013/" + repoName;
} else {
// اگر به هر دلیلی در روت اصلی دمو بود، به پروفایل گیتهاب لینک میشود
githubBtn.href = "https://github.com/sibche2013";
}
})();
</script>
</body>
</html>