-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmigration-banner.html
More file actions
360 lines (317 loc) · 13.7 KB
/
migration-banner.html
File metadata and controls
360 lines (317 loc) · 13.7 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<!DOCTYPE html>
<html>
<head>
<style>
.migration-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 9999;
background: linear-gradient(135deg, #ff6b35, #f7931e);
color: white;
padding: 15px 20px;
box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
border-bottom: 3px solid #e55a2b;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
animation: slideDown 0.5s ease-out;
}
@keyframes slideDown {
from {
transform: translateY(-100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.migration-banner-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 15px;
}
.migration-banner-text {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
min-width: 300px;
}
.migration-banner-icon {
font-size: 24px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.migration-banner-message {
font-size: 16px;
font-weight: 600;
line-height: 1.4;
}
.migration-banner-submessage {
font-size: 13px;
opacity: 0.95;
margin-top: 2px;
}
.migration-banner-actions {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.migration-banner-button {
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 10px 20px;
border-radius: 25px;
text-decoration: none;
font-weight: 600;
font-size: 14px;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
backdrop-filter: blur(10px);
}
.migration-banner-button:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
color: white;
text-decoration: none;
}
.migration-banner-button.primary {
background: rgba(255, 255, 255, 0.95);
color: #ff6b35;
border-color: white;
}
.migration-banner-button.primary:hover {
background: white;
color: #e55a2b;
transform: translateY(-2px) scale(1.05);
}
.migration-banner-close {
background: none;
border: none;
color: white;
font-size: 20px;
cursor: pointer;
padding: 5px;
opacity: 0.8;
transition: opacity 0.2s ease;
}
.migration-banner-close:hover {
opacity: 1;
}
/* Responsive Design */
@media (max-width: 768px) {
.migration-banner {
padding: 12px 15px;
}
.migration-banner-content {
flex-direction: column;
align-items: stretch;
text-align: center;
}
.migration-banner-text {
justify-content: center;
text-align: center;
min-width: unset;
}
.migration-banner-actions {
justify-content: center;
}
.migration-banner-button {
flex: 1;
justify-content: center;
min-width: 140px;
}
}
/* Adjust page content to account for banner */
body {
margin-top: 90px !important;
}
@media (max-width: 768px) {
body {
margin-top: 120px !important;
}
}
</style>
</head>
<body>
<div id="migration-banner" class="migration-banner">
<div class="migration-banner-content">
<div class="migration-banner-text">
<div class="migration-banner-icon">⚠️</div>
<div>
<div class="migration-banner-message">
This documentation is outdated and no longer maintained
</div>
<div class="migration-banner-submessage">
A current version of this page is available in the new documentation
</div>
</div>
</div>
<div class="migration-banner-actions">
<a href="#" id="new-page-link" class="migration-banner-button primary">
📖 View Current Page
</a>
<a href="https://openhdfpv.org" class="migration-banner-button">
🏠 Browse New Docs
</a>
<button class="migration-banner-close" onclick="dismissBanner()">✕</button>
</div>
</div>
</div>
<script>
// URL Mapping from legacy to new documentation
const urlMappings = {
// Main pages
'introduction.md': 'introduction',
'installation-guide.md': 'installation-guide',
'downloads.md': 'downloads',
// General
'general/faq.md': 'general/faq',
'general/software-faq.md': 'general/software-faq',
'general/troubleshooting.md': 'general/troubleshooting',
'general/team.md': 'general/team',
'general/features.md': 'general/features',
'general/contributing.md': 'general/contributing',
// Hardware
'hardware/first-time-setup.md': 'hardware/first-time-setup',
'hardware/raspberry.md': 'hardware/raspberry',
'hardware/radxa.md': 'hardware/radxa',
'hardware/cameras.md': 'hardware/cameras',
'hardware/cameras/raspberry-cameras.md': 'hardware/cameras/raspberry-cameras',
'hardware/cameras/radxa-cameras.md': 'hardware/cameras/radxa-cameras',
'hardware/cameras/usb-camera.md': 'hardware/cameras/usb-camera',
'hardware/cameras/ip-cameras.md': 'hardware/cameras/ip-cameras',
'hardware/cameras/hdmi-cameras-rpi.md': 'hardware/cameras/hdmi-cameras-rpi',
'hardware/cameras/special-camera.md': 'hardware/cameras/special-camera',
'hardware/cameras/custom-cameras.md': 'hardware/cameras/custom-cameras',
'hardware/wifi-adapters.md': 'hardware/wifi-adapters',
'hardware/antennas.md': 'hardware/antennas',
'hardware/displays.md': 'hardware/displays',
'hardware/wiring.md': 'hardware/wiring',
'hardware/flightControllers.md': 'hardware/flightControllers',
'hardware/sbcs.md': 'hardware/sbcs',
'hardware/X86.md': 'hardware/X86',
'hardware/jetson.md': 'hardware/jetson',
'hardware/ochin.md': 'hardware/ochin',
'hardware/ochinv2.md': 'hardware/ochinv2',
'hardware/custom-hardware.md': 'hardware/custom-hardware',
'hardware/discontinued.md': 'hardware/discontinued',
'hardware/hardware.conf.md': 'hardware/hardware.conf',
// Software Setup
'software-setup/ardupilot.md': 'software-setup/ardupilot',
'software-setup/betaflight.md': 'software-setup/betaflight',
'software-setup/inav.md': 'software-setup/inav',
'software-setup/camera-settings.md': 'software-setup/camera-settings',
'software-setup/recording.md': 'software-setup/recording',
'software-setup/tx-power.md': 'software-setup/tx-power',
'software-setup/joystick-rc.md': 'software-setup/joystick-rc',
'software-setup/mcs-via-rc.md': 'software-setup/mcs-via-rc',
'software-setup/tethering.md': 'software-setup/tethering',
'software-setup/ethernet-hotspot.md': 'software-setup/ethernet-hotspot',
'software-setup/wifi-hotspot.md': 'software-setup/wifi-hotspot',
'software-setup/variable-bitrate.md': 'software-setup/variable-bitrate',
'software-setup/telemetry-and-osd.md': 'software-setup/telemetry-and-osd',
// Advanced Setup
'advanced-setup/air-recording.md': 'advanced-setup/air-recording',
'advanced-setup/dual-camera.md': 'advanced-setup/dual-camera',
'advanced-setup/ground-power-monitoring.md': 'advanced-setup/ground-power-monitoring',
'advanced-setup/Joystick.md': 'advanced-setup/Joystick',
// Ground Station Software
'ground-station-software/mission-planner.md': 'ground-station-software/mission-planner',
'ground-station-software/qgroundcontrol.md': 'ground-station-software/qgroundcontrol',
'ground-station-software/gstreamer.md': 'ground-station-software/gstreamer',
'ground-station-software/raspberrypi-camera-viewer.md': 'ground-station-software/raspberrypi-camera-viewer',
'ground-station-software/qopenhd-osd-backup.md': 'ground-station-software/qopenhd-osd-backup',
// Developers
'developers/porting.md': 'developers/porting',
'developers/radxa-commands.md': 'developers/radxa-commands',
'developers/wifi-adresses.md': 'developers/wifi-adresses'
};
function getCurrentPageMapping() {
const currentPath = window.location.pathname;
const currentFile = currentPath.split('/').pop();
// Try direct file mapping first
if (urlMappings[currentFile]) {
return 'https://openhdfpv.org/' + urlMappings[currentFile];
}
// Try path-based mapping
const pathParts = currentPath.split('/');
const documentationIndex = pathParts.findIndex(part => part === 'Documentation' || part === 'Documentation_2-0');
if (documentationIndex !== -1) {
const relativePath = pathParts.slice(documentationIndex + 1).join('/');
// Remove .md extension if present
const cleanPath = relativePath.replace(/\.md$/, '');
if (urlMappings[relativePath]) {
return 'https://openhdfpv.org/' + urlMappings[relativePath];
}
// Try building URL based on path structure
if (cleanPath && cleanPath !== '') {
return 'https://openhdfpv.org/' + cleanPath;
}
}
// Fallback to main documentation
return 'https://openhdfpv.org/introduction';
}
function initializeBanner() {
const newPageLink = document.getElementById('new-page-link');
const newUrl = getCurrentPageMapping();
if (newPageLink) {
newPageLink.href = newUrl;
// Update button text if we found a specific mapping
if (!newUrl.endsWith('/introduction')) {
newPageLink.innerHTML = '📖 View Updated Page';
}
}
}
function dismissBanner() {
const banner = document.getElementById('migration-banner');
banner.style.transform = 'translateY(-100%)';
banner.style.opacity = '0';
setTimeout(() => {
banner.style.display = 'none';
document.body.style.marginTop = '0';
}, 300);
// Remember dismissal for this session
sessionStorage.setItem('migration-banner-dismissed', 'true');
}
// Check if banner was dismissed this session
function shouldShowBanner() {
return !sessionStorage.getItem('migration-banner-dismissed');
}
// Initialize when DOM is loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
if (shouldShowBanner()) {
initializeBanner();
} else {
const banner = document.getElementById('migration-banner');
banner.style.display = 'none';
document.body.style.marginTop = '0';
}
});
} else {
if (shouldShowBanner()) {
initializeBanner();
} else {
const banner = document.getElementById('migration-banner');
banner.style.display = 'none';
document.body.style.marginTop = '0';
}
}
</script>
</body>
</html>