-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
238 lines (203 loc) · 7.43 KB
/
index.html
File metadata and controls
238 lines (203 loc) · 7.43 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
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>QuickMock - Python Data Generator</title>
<style>
:root {
--main: #6366f1;
--bg: #0b0f1a;
--card: #161b2c;
--text: #e2e8f0;
}
body {
font-family: 'Inter', sans-serif;
background: var(--bg);
color: var(--text);
padding: 30px;
}
.wrapper {
max-width: 950px;
margin: auto;
background: var(--card);
padding: 25px;
border-radius: 15px;
border: 1px solid #2d3748;
position: relative;
}
/* Sosyal Medya Butonları */
.social-links {
position: absolute;
top: 25px;
right: 25px;
display: flex;
gap: 10px;
}
.social-btn {
padding: 8px 12px;
border-radius: 6px;
font-size: 12px;
text-decoration: none;
color: white;
font-weight: bold;
transition: 0.3s;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.github {
background: #24292e;
}
.linkedin {
background: #0077b5;
}
.discord {
background: #5865f2;
}
.social-btn:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.data-row {
display: flex;
gap: 12px;
margin-bottom: 12px;
padding: 10px;
background: #1f2937;
border-radius: 8px;
}
input,
select {
background: #111827;
border: 1px solid #374151;
color: #fff;
padding: 12px;
border-radius: 6px;
flex: 1;
outline: none;
}
button {
cursor: pointer;
border: none;
border-radius: 6px;
font-weight: bold;
transition: 0.2s;
}
.add-btn {
background: #374151;
color: #fff;
padding: 10px 20px;
margin-bottom: 20px;
border: 1px dashed #4b5563;
}
.run-btn {
background: var(--main);
color: white;
padding: 15px;
width: 100%;
font-size: 1.1rem;
}
.del-btn {
background: #7f1d1d;
color: #fecaca;
padding: 0 15px;
}
#output {
background: #010409;
padding: 20px;
border-radius: 10px;
color: #7ee787;
overflow-x: auto;
border: 1px solid #30363d;
margin-top: 25px;
font-family: 'Consolas', monospace;
}
.footer-tag {
text-align: center;
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #2d3748;
color: #64748b;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="social-links">
<a href="https://github.com/Emrans99" target="_blank" class="social-btn github">GitHub</a>
<a href="https://www.linkedin.com/in/emirhan-g%C3%BCrb%C3%BCz/" target="_blank"
class="social-btn linkedin">LinkedIn</a>
</div>
<h1 style="margin:0 0 10px 0;">QuickMock <span style="font-weight:200; color:var(--main);">v3</span></h1>
<p style="color:#94a3b8; margin-bottom:25px;">Hızlıca Python mock veri seti oluştur. Değişkenleri tanımla ve
kodu kopyala.</p>
<div id="setup-area">
<div class="data-row">
<input type="text" placeholder="Değişken İsmi" class="var-name">
<select class="var-type">
<option value="int">Sayı (Integer)</option>
<option value="float">Ondalıklı (Float)</option>
<option value="str">Metin (String)</option>
<option value="bool">Mantıksal (Boolean)</option>
<option value="name">Hazır İsimler</option>
</select>
<button class="del-btn" onclick="this.parentElement.remove()">Sil</button>
</div>
</div>
<button class="add-btn" onclick="newRow()">+ Yeni Alan Ekle</button>
<div style="margin-bottom: 25px; background: #111827; padding: 15px; border-radius: 8px;">
<label>Üretilecek Satır Sayısı: </label>
<input type="number" id="count" value="10" style="width: 70px; background: #0b0f1a;">
</div>
<button class="run-btn" onclick="build()">Sihri Başlat ✨</button>
<pre id="output"># Kodunuz burada hazır olacak...</pre>
<div class="footer-tag">
Developed by <strong>Emirhan Gürbüz</strong>
</div>
</div>
<script>
const randomNames = ["Arda", "Zeynep", "Mert", "Selin", "Kaan", "Buse", "Demir", "Ece", "Emirhan", "Derin"];
function newRow() {
const box = document.getElementById('setup-area');
const div = document.createElement('div');
div.className = 'data-row';
div.innerHTML = `
<input type="text" placeholder="Değişken İsmi" class="var-name">
<select class="var-type">
<option value="int">Sayı (Integer)</option>
<option value="float">Ondalıklı (Float)</option>
<option value="str">Metin (String)</option>
<option value="bool">Mantıksal (Boolean)</option>
<option value="name">Hazır İsimler</option>
</select>
<button class="del-btn" onclick="this.parentElement.remove()">Sil</button>
`;
box.appendChild(div);
}
function build() {
const limit = document.getElementById('count').value;
const names = document.querySelectorAll('.var-name');
const types = document.querySelectorAll('.var-type');
let code = "# Created by Emirhan Gurbuz\n";
code += "mock_data = [\n";
for (let i = 0; i < limit; i++) {
let line = " {";
names.forEach((input, index) => {
let key = input.value.trim() || `field_${index + 1}`;
let type = types[index].value;
let val;
if (type === 'int') val = Math.floor(Math.random() * 500) + 1;
else if (type === 'float') val = (Math.random() * 100).toFixed(2);
else if (type === 'bool') val = Math.random() > 0.5 ? "True" : "False";
else if (type === 'name') val = `"${randomNames[Math.floor(Math.random() * randomNames.length)]}"`;
else val = `"${Math.random().toString(36).substring(7)}"`;
line += `"${key}": ${val}`;
if (index < names.length - 1) line += ", ";
});
line += "},";
code += line + "\n";
}
code += "]";
document.getElementById('output').innerText = code;
}
</script>
</body>
</html>