Add HTML templates for all tools
Some checks failed
CI / test (3.10) (push) Failing after 12s
CI / test (3.11) (push) Failing after 9s
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / build-package (push) Has been cancelled
Some checks failed
CI / test (3.10) (push) Failing after 12s
CI / test (3.11) (push) Failing after 9s
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / build-package (push) Has been cancelled
This commit is contained in:
108
devterm/templates/url.html
Normal file
108
devterm/templates/url.html
Normal file
@@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>URL Encoder - Devterm</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
||||
min-height: 100vh;
|
||||
color: #fff;
|
||||
}
|
||||
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
h1 { font-size: 1.5rem; background: linear-gradient(90deg, #00d4ff, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
||||
.back-link { color: #94a3b8; text-decoration: none; }
|
||||
.back-link:hover { color: #00d4ff; }
|
||||
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
||||
.panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; }
|
||||
.panel-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 600; }
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #e2e8f0;
|
||||
padding: 1rem;
|
||||
font-family: 'Monaco', 'Menlo', monospace;
|
||||
font-size: 14px;
|
||||
resize: none;
|
||||
}
|
||||
textarea:focus { outline: none; }
|
||||
.actions { display: flex; gap: 1rem; margin: 1.5rem 0; }
|
||||
button {
|
||||
background: linear-gradient(90deg, #00d4ff, #7c3aed);
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
button:hover { opacity: 0.9; }
|
||||
.error { color: #ef4444; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<a href="/" class="back-link">←</a>
|
||||
<h1>URL Encoder/Decoder</h1>
|
||||
</header>
|
||||
<div class="grid">
|
||||
<div class="panel">
|
||||
<div class="panel-header">Input</div>
|
||||
<textarea id="input" placeholder="Enter text or URL..."></textarea>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-header">Output</div>
|
||||
<textarea id="output" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button onclick="encode()">Encode →</button>
|
||||
<button onclick="decode()">← Decode</button>
|
||||
<button onclick="clearAll()">Clear</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
async function encode() {
|
||||
const input = document.getElementById('input').value;
|
||||
if (!input.trim()) return;
|
||||
const res = await fetch('/url/encode', { method: 'POST', body: input });
|
||||
const data = await res.json();
|
||||
if (data.error) {
|
||||
alert('Error: ' + data.error);
|
||||
} else {
|
||||
document.getElementById('output').value = data.result;
|
||||
}
|
||||
}
|
||||
async function decode() {
|
||||
const input = document.getElementById('input').value;
|
||||
if (!input.trim()) return;
|
||||
const res = await fetch('/url/decode', { method: 'POST', body: input });
|
||||
const data = await res.json();
|
||||
if (data.error) {
|
||||
alert('Error: ' + data.error);
|
||||
} else {
|
||||
document.getElementById('output').value = data.result;
|
||||
}
|
||||
}
|
||||
function clearAll() {
|
||||
document.getElementById('input').value = '';
|
||||
document.getElementById('output').value = '';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user