Skip to content

Commit 5a3cbf1

Browse files
authored
Create 404.html
1 parent d4ced2a commit 5a3cbf1

1 file changed

Lines changed: 300 additions & 0 deletions

File tree

‎404.html‎

Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
6+
<title>404 · devtemDesign</title>
7+
<meta name="description" content="Page not found — but the engine still runs.">
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/devtemdesign@0.0.1/style.css">
10+
<script src="https://cdn.jsdelivr.net/npm/devtemdesign@0.0.1/script.js"></script>
11+
<style>
12+
.template-switcher {
13+
position: fixed;
14+
bottom: 24px;
15+
right: 24px;
16+
z-index: 9997;
17+
display: flex;
18+
gap: 12px;
19+
background: rgba(0,0,0,0.6);
20+
backdrop-filter: blur(16px);
21+
padding: 10px 20px;
22+
border-radius: 60px;
23+
border: 1px solid rgba(255,255,255,0.15);
24+
font-family: monospace;
25+
font-size: 0.75rem;
26+
}
27+
.template-btn {
28+
background: transparent;
29+
border: none;
30+
color: var(--muted, #aaa);
31+
padding: 6px 14px;
32+
border-radius: 40px;
33+
cursor: pointer;
34+
transition: all 0.2s ease;
35+
font-family: monospace;
36+
font-size: 0.7rem;
37+
letter-spacing: 0.05em;
38+
}
39+
.template-btn:hover {
40+
background: rgba(255,255,255,0.1);
41+
color: white;
42+
}
43+
.template-btn.active {
44+
background: var(--accent, #0ff);
45+
color: #000;
46+
font-weight: bold;
47+
}
48+
@media (max-width: 680px) {
49+
.template-switcher { bottom: 16px; right: 16px; padding: 6px 12px; gap: 6px; }
50+
.template-btn { padding: 4px 10px; font-size: 0.6rem; }
51+
}
52+
.error-404-custom {
53+
position: relative;
54+
z-index: 2;
55+
text-align: center;
56+
padding: 80px 32px;
57+
}
58+
.error-code {
59+
font-size: clamp(8rem, 20vw, 14rem);
60+
font-weight: 800;
61+
line-height: 1;
62+
background: linear-gradient(135deg, var(--accent), var(--accent2));
63+
-webkit-background-clip: text;
64+
background-clip: text;
65+
-webkit-text-fill-color: transparent;
66+
margin-bottom: 24px;
67+
letter-spacing: -0.03em;
68+
}
69+
.error-title {
70+
font-size: clamp(1.8rem, 5vw, 2.8rem);
71+
font-weight: 700;
72+
margin-bottom: 20px;
73+
}
74+
.error-desc {
75+
color: var(--muted);
76+
max-width: 500px;
77+
margin: 0 auto 40px;
78+
line-height: 1.6;
79+
}
80+
.home-btn {
81+
display: inline-flex;
82+
align-items: center;
83+
gap: 10px;
84+
padding: 14px 36px;
85+
background: rgba(255,255,255,0.03);
86+
border: 1px solid var(--accent);
87+
backdrop-filter: blur(12px);
88+
color: var(--text);
89+
border-radius: 60px;
90+
font-weight: 500;
91+
transition: 0.25s;
92+
cursor: pointer;
93+
text-decoration: none;
94+
}
95+
.home-btn:hover {
96+
transform: translateY(-2px);
97+
box-shadow: 0 6px 26px rgba(122, 244, 255, 0.2);
98+
background: rgba(255,255,255,0.08);
99+
}
100+
/* Override engine to hide features/panels sections */
101+
.features, .panels-section, .marquee-section {
102+
display: none !important;
103+
}
104+
.hero {
105+
min-height: 80vh;
106+
padding: 100px 32px 60px;
107+
}
108+
</style>
109+
</head>
110+
<body>
111+
112+
<div id="app-root"></div>
113+
<div class="template-switcher">
114+
<span style="color: #888; margin-right: 4px;"><i class="fas fa-palette"></i></span>
115+
<button class="template-btn" data-template="figsh">FIGSH</button>
116+
<button class="template-btn" data-template="cyber">CYBER</button>
117+
<button class="template-btn" data-template="aurora">AURORA</button>
118+
<button class="template-btn" data-template="monochrome">MONO</button>
119+
</div>
120+
121+
<script>
122+
// 404-specific config — no features, no panels, no marquee
123+
let currentConfig = {
124+
template: "cyber",
125+
logoName: "DEVTEM",
126+
navLinks: ["Docs", "Sandbox", "Schema API", "npm Package"],
127+
ctaText: "CDN →",
128+
129+
heroTag: "⚡ 404 • Lost in Space",
130+
heroTitleLine1: "Page Not",
131+
heroTitleLine2: "Found",
132+
heroSubtitle: "The path you requested doesn't exist — but the engine is still running. Navigate back to solid ground.",
133+
134+
primaryBtnText: "← Back Home",
135+
secondaryBtnText: "Copy CDN",
136+
137+
brandsSubtitle: "Even errors look good with glass-morphism",
138+
footerCopy: "Figsh Labs • 404 Engine",
139+
brands: ["RESILIENT", "GLASS", "MOTION", "ZERO-CONFIG", "404", "CSS"],
140+
141+
// Empty arrays to hide sections
142+
features: [],
143+
panels: []
144+
};
145+
146+
// Function to re-render with new template
147+
function renderWithTemplate(templateName) {
148+
currentConfig.template = templateName;
149+
150+
if (typeof devtemDesign === 'function') {
151+
devtemDesign("app-root", currentConfig);
152+
setTimeout(() => {
153+
attach404Handlers();
154+
highlightActiveTemplate(templateName);
155+
// Hide any potential empty sections that might appear
156+
hideEmptySections();
157+
}, 100);
158+
}
159+
}
160+
161+
function hideEmptySections() {
162+
// Additional safety: hide features/panels if they somehow appear
163+
const sections = document.querySelectorAll('.features, .panels-section, .marquee-section');
164+
sections.forEach(section => {
165+
if (section) section.style.display = 'none';
166+
});
167+
}
168+
169+
function attach404Handlers() {
170+
// Home button redirect
171+
const homeHandler = (e) => {
172+
e.preventDefault();
173+
window.location.href = '/';
174+
};
175+
176+
// Copy CDN functionality
177+
const copyCDN = (e) => {
178+
e.preventDefault();
179+
const cdnLinks = `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/devtemdesign@0.0.1/style.css">\n<script src="https://cdn.jsdelivr.net/npm/devtemdesign@0.0.1/script.js"><\/script>`;
180+
navigator.clipboard.writeText(cdnLinks);
181+
182+
if (e.target.classList && e.target.classList.contains('btn-ghost')) {
183+
const original = e.target.innerHTML;
184+
e.target.innerHTML = "✓ Copied!";
185+
setTimeout(() => { e.target.innerHTML = original; }, 1500);
186+
}
187+
};
188+
189+
const primaryBtn = document.querySelector('.btn-primary');
190+
const secondaryBtn = document.querySelector('.btn-ghost');
191+
const navCta = document.querySelector('.nav-cta');
192+
193+
if (primaryBtn) {
194+
// Replace with home navigation
195+
const newPrimary = primaryBtn.cloneNode(true);
196+
primaryBtn.parentNode.replaceChild(newPrimary, primaryBtn);
197+
newPrimary.addEventListener('click', homeHandler);
198+
}
199+
200+
if (secondaryBtn) secondaryBtn.addEventListener('click', copyCDN);
201+
202+
if (navCta) {
203+
navCta.addEventListener('click', (e) => {
204+
e.preventDefault();
205+
const cdnJs = `<script src="https://cdn.jsdelivr.net/npm/devtemdesign@0.0.1/script.js"><\/script>`;
206+
navigator.clipboard.writeText(cdnJs);
207+
const original = navCta.innerHTML;
208+
navCta.innerHTML = "✓ Copied!";
209+
setTimeout(() => { navCta.innerHTML = original; }, 1500);
210+
});
211+
}
212+
213+
// Docs links → home (since docs might not exist in 404 context)
214+
const docLinks = document.querySelectorAll('.nav-links a');
215+
docLinks.forEach(link => {
216+
if (link.innerText.toLowerCase() === 'docs') {
217+
link.addEventListener('click', (e) => {
218+
e.preventDefault();
219+
window.location.href = '/';
220+
});
221+
}
222+
});
223+
}
224+
225+
function highlightActiveTemplate(template) {
226+
const btns = document.querySelectorAll('.template-btn');
227+
btns.forEach(btn => {
228+
if (btn.getAttribute('data-template') === template) {
229+
btn.classList.add('active');
230+
} else {
231+
btn.classList.remove('active');
232+
}
233+
});
234+
}
235+
236+
function initTemplateSwitcher() {
237+
const btns = document.querySelectorAll('.template-btn');
238+
btns.forEach(btn => {
239+
btn.addEventListener('click', (e) => {
240+
const newTemplate = btn.getAttribute('data-template');
241+
renderWithTemplate(newTemplate);
242+
});
243+
});
244+
}
245+
246+
// Inject custom 404 display after engine renders
247+
function inject404Content() {
248+
// Wait for hero to render, then append 404-specific elements
249+
setTimeout(() => {
250+
const heroSection = document.querySelector('.hero');
251+
if (heroSection && !document.querySelector('.error-404-custom')) {
252+
// Add floating 404 visual enhancement
253+
const errorDiv = document.createElement('div');
254+
errorDiv.className = 'error-404-custom';
255+
errorDiv.innerHTML = `
256+
<div class="error-code">404</div>
257+
<div class="error-title">Lost in the void?</div>
258+
<div class="error-desc">The URL you requested doesn't exist. But hey — at least the animations are smooth.</div>
259+
<a href="/" class="home-btn"><i class="fas fa-arrow-left"></i> Return to Home</a>
260+
`;
261+
heroSection.appendChild(errorDiv);
262+
263+
// Also style the hero title differently for 404
264+
const heroTitle = heroSection.querySelector('.hero-title');
265+
if (heroTitle) {
266+
heroTitle.style.marginBottom = '0px';
267+
}
268+
}
269+
hideEmptySections();
270+
}, 200);
271+
}
272+
273+
// Wait for DOM and engine
274+
document.addEventListener("DOMContentLoaded", () => {
275+
setTimeout(() => {
276+
if (typeof devtemDesign === 'function') {
277+
devtemDesign("app-root", currentConfig);
278+
setTimeout(() => {
279+
attach404Handlers();
280+
initTemplateSwitcher();
281+
highlightActiveTemplate('cyber');
282+
inject404Content();
283+
hideEmptySections();
284+
}, 150);
285+
} else {
286+
console.error("devtemDesign engine not found");
287+
// Fallback manual display
288+
document.getElementById('app-root').innerHTML = `
289+
<div style="text-align:center; padding:100px; min-height:100vh;">
290+
<h1 style="font-size:6rem;">404</h1>
291+
<p>Page not found</p>
292+
<a href="/" style="color:var(--accent);">Go Home</a>
293+
</div>
294+
`;
295+
}
296+
}, 50);
297+
});
298+
</script>
299+
</body>
300+
</html>

0 commit comments

Comments
 (0)