feat: add initial testing site and Cloudflare edge headers

- Implement semantic HTML5 layout with deployment diagnostics and test widget
- Add responsive stylesheet supporting light and dark color schemes
- Add client-side logic for real-time clock, hostname reflection, and counter
- Add _headers configuration for baseline edge security policies
This commit is contained in:
kiskaadee committed 2026-10-31 03:43:53 -05:00
1 parent 88a788a1d3
commit 509baec232
4 files changed
+350

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
/*
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
+49
View File
@@ -0,0 +1,49 @@
document.addEventListener("DOMContentLoaded", () => {
// Update year
const yearEl = document.getElementById("year");
if (yearEl) {
yearEl.textContent = new Date().getFullYear();
}
// Update domain display based on current window location
const domainEl = document.getElementById("domain-display");
if (domainEl && window.location.hostname) {
domainEl.textContent = window.location.hostname;
}
// Update protocol
const protocolEl = document.getElementById("protocol-display");
if (protocolEl) {
protocolEl.textContent = window.location.protocol.replace(":", "").toUpperCase();
}
// Live client clock
const timeEl = document.getElementById("client-time");
function updateTime() {
if (timeEl) {
timeEl.textContent = new Date().toLocaleTimeString();
}
}
updateTime();
setInterval(updateTime, 1000);
// Simple interactive counter
let count = 0;
const counterVal = document.getElementById("counter-value");
const btnIncrement = document.getElementById("btn-increment");
const btnReset = document.getElementById("btn-reset");
if (btnIncrement && counterVal) {
btnIncrement.addEventListener("click", () => {
count += 1;
counterVal.textContent = count;
});
}
if (btnReset && counterVal) {
btnReset.addEventListener("click", () => {
count = 0;
counterVal.textContent = count;
});
}
});
+73
View File
@@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Simple testing website deployed on Cloudflare Pages">
<title>Cloudflare Pages Test | roadtotech.me</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<header class="site-header">
<span class="badge">Edge Deployment</span>
<h1>Testing Site for Cloudflare Pages</h1>
<p class="subtitle">A lightweight static site running on Cloudflare's global edge network.</p>
</header>
<main class="site-main">
<section class="card">
<h2>Deployment Status</h2>
<div class="status-grid">
<div class="status-item">
<span class="status-label">Network</span>
<span class="status-value status-online">Cloudflare Edge CDN</span>
</div>
<div class="status-item">
<span class="status-label">Domain Target</span>
<code class="status-value" id="domain-display">*.roadtotech.me</code>
</div>
<div class="status-item">
<span class="status-label">Protocol</span>
<span class="status-value" id="protocol-display">Detecting...</span>
</div>
<div class="status-item">
<span class="status-label">Client Time</span>
<span class="status-value" id="client-time">--:--:--</span>
</div>
</div>
</section>
<section class="card">
<h2>Interactive Test Widget</h2>
<p>Test client-side execution and latency:</p>
<div class="interactive-panel">
<div class="counter-display">
<span>Click Count:</span>
<strong id="counter-value">0</strong>
</div>
<div class="button-group">
<button id="btn-increment" class="btn primary">Increment</button>
<button id="btn-reset" class="btn secondary">Reset</button>
</div>
</div>
</section>
<section class="card">
<h2>Architecture Highlights</h2>
<ul class="features-list">
<li><strong>Zero Origin Cold-Start:</strong> Static assets are cached and distributed worldwide.</li>
<li><strong>Automatic SSL/TLS:</strong> HTTPS certs are provisioned and renewed automatically by Cloudflare.</li>
<li><strong>Native Subdomain:</strong> Mapped to <code>roadtotech.me</code> via CNAME within the same Cloudflare zone.</li>
</ul>
</section>
</main>
<footer class="site-footer">
<p>&copy; <span id="year"></span> <a href="https://roadtotech.me" target="_blank" rel="noopener noreferrer">roadtotech.me</a> &bull; Deployed via Cloudflare Pages</p>
</footer>
</div>
<script src="app.js"></script>
</body>
</html>
+224
View File
@@ -0,0 +1,224 @@
:root {
--bg-color: #0f172a;
--card-bg: #1e293b;
--text-primary: #f8fafc;
--text-secondary: #94a3b8;
--accent-color: #f97316;
--accent-hover: #ea580c;
--success-color: #10b981;
--border-color: #334155;
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
:root {
--bg-color: #f8fafc;
--card-bg: #ffffff;
--text-primary: #0f172a;
--text-secondary: #64748b;
--border-color: #e2e8f0;
}
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
background-color: var(--bg-color);
color: var(--text-primary);
line-height: 1.6;
min-height: 100vh;
display: flex;
justify-content: center;
padding: 2rem 1rem;
}
.container {
max-width: 720px;
width: 100%;
display: flex;
flex-direction: column;
gap: 1.75rem;
}
.site-header {
text-align: center;
padding: 1rem 0;
}
.badge {
display: inline-block;
padding: 0.25rem 0.75rem;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #fff;
background-color: var(--accent-color);
border-radius: 9999px;
margin-bottom: 0.75rem;
}
.site-header h1 {
font-size: 2rem;
font-weight: 800;
letter-spacing: -0.025em;
margin-bottom: 0.5rem;
}
.subtitle {
color: var(--text-secondary);
font-size: 1.1rem;
}
.site-main {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.card {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 1.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.card h2 {
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 1rem;
border-bottom: 1px solid var(--border-color);
padding-bottom: 0.5rem;
}
.status-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
}
.status-item {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.status-label {
font-size: 0.8rem;
text-transform: uppercase;
color: var(--text-secondary);
font-weight: 600;
}
.status-value {
font-size: 1rem;
font-weight: 600;
}
.status-online {
color: var(--success-color);
}
.interactive-panel {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1rem;
padding: 1rem;
background-color: rgba(0, 0, 0, 0.05);
border-radius: 8px;
}
.counter-display {
font-size: 1.1rem;
}
.counter-display strong {
font-size: 1.5rem;
color: var(--accent-color);
margin-left: 0.5rem;
}
.button-group {
display: flex;
gap: 0.5rem;
}
.btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 6px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.15s ease-in-out;
}
.btn.primary {
background-color: var(--accent-color);
color: #fff;
}
.btn.primary:hover {
background-color: var(--accent-hover);
}
.btn.secondary {
background-color: var(--border-color);
color: var(--text-primary);
}
.btn.secondary:hover {
opacity: 0.8;
}
.features-list {
list-style: none;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.features-list li {
padding-left: 1.5rem;
position: relative;
font-size: 0.95rem;
}
.features-list li::before {
content: "✓";
position: absolute;
left: 0;
color: var(--accent-color);
font-weight: 700;
}
code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
background-color: rgba(0, 0, 0, 0.1);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9em;
}
.site-footer {
text-align: center;
padding: 1rem 0;
color: var(--text-secondary);
font-size: 0.875rem;
}
.site-footer a {
color: var(--accent-color);
text-decoration: none;
}
.site-footer a:hover {
text-decoration: underline;
}