Skip to content

Commit 89659a7

Browse files
authored
Add mock index.html for generating mock data
1 parent 1e471e0 commit 89659a7

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

mock/index.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Mock Gen | RMKR Dev</title>
6+
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23FFC300' d='M448 96c0-35.3-28.7-64-64-64H128C92.7 32 64 60.7 64 96v320c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V96z'/%3E%3C/svg%3E">
7+
<script src="https://cdn.tailwindcss.com"></script>
8+
<style>
9+
:root { --color-bg: #0C1524; --color-card: #18233C; --color-accent: #FFC300; --color-line: #2D3748; }
10+
body { font-family: 'Inter', sans-serif; background: var(--color-bg); color: #F0F4F8; }
11+
textarea { font-family: 'Fira Code', monospace; background: #080E1A; border: 1px solid var(--color-line); color: #4ade80; resize: none; width: 100%; padding: 1rem; border-radius: 12px; }
12+
</style>
13+
</head>
14+
<body class="p-8">
15+
<div class="max-w-4xl mx-auto">
16+
<header class="flex justify-between items-center mb-8 border-b border-[--color-line] pb-4">
17+
<h1 class="text-2xl font-black italic">MOCK<span class="text-[--color-accent] not-italic">GEN</span></h1>
18+
<a href="../" class="text-xs font-bold text-[--color-accent] hover:underline uppercase">Back to Hub</a>
19+
</header>
20+
21+
<div class="mb-6">
22+
<label class="text-[10px] font-bold uppercase text-[--color-muted] mb-2 block">Comma separated keys for Mock Object</label>
23+
<input id="keys" type="text" value="id, name, email, status, timestamp" class="w-full bg-[#080E1A] border border-[--color-line] p-3 rounded-lg text-white mb-4 outline-none focus:border-[--color-accent]">
24+
<button onclick="generate()" class="bg-[--color-accent] text-black font-black px-6 py-2 rounded-lg text-xs uppercase">Generate 10 Records</button>
25+
</div>
26+
27+
<textarea id="output" class="h-96 text-xs" readonly></textarea>
28+
</div>
29+
30+
<script>
31+
function generate() {
32+
const keys = document.getElementById('keys').value.split(',').map(k => k.trim());
33+
const data = [];
34+
for (let i = 1; i <= 10; i++) {
35+
const obj = {};
36+
keys.forEach(k => {
37+
if (k === 'id') obj[k] = i;
38+
else if (k.includes('email')) obj[k] = `user${i}@example.com`;
39+
else if (k.includes('timestamp')) obj[k] = new Date().toISOString();
40+
else obj[k] = `mock_${k}_${Math.floor(Math.random() * 1000)}`;
41+
});
42+
data.push(obj);
43+
}
44+
document.getElementById('output').value = JSON.stringify(data, null, 4);
45+
}
46+
</script>
47+
</body>
48+
</html>

0 commit comments

Comments
 (0)