-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtool-30-Git-Ignore-Generator.html
More file actions
632 lines (528 loc) · 18.1 KB
/
tool-30-Git-Ignore-Generator.html
File metadata and controls
632 lines (528 loc) · 18.1 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tool 30 - Git Ignore Generator - Developer Toolbox</title>
<link rel="stylesheet" href="assets/core.css">
<style>
.split-view {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
margin-bottom: 2rem;
}
@media (min-width: 900px) {
.split-view { grid-template-columns: 350px 1fr; }
}
.search-box {
width: 100%;
padding: 0.8rem 1rem;
border: 2px solid var(--border-color);
border-radius: var(--radius-sm);
background: var(--bg-main);
color: var(--text-primary);
font-family: var(--font-main);
font-size: 1rem;
margin-bottom: 1rem;
outline: none;
transition: border-color 0.2s;
}
.search-box:focus {
border-color: var(--primary-color);
}
.category-list {
margin-bottom: 1.5rem;
max-height: 400px;
overflow-y: auto;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
background: rgba(0,0,0,0.2);
padding: 0.5rem;
}
.category-item {
display: flex;
align-items: center;
gap: 0.8rem;
padding: 0.5rem;
border-radius: var(--radius-sm);
cursor: pointer;
transition: background 0.2s;
}
.category-item:hover {
background: rgba(255,255,255,0.05);
}
.category-item input[type="checkbox"] {
width: 1.2rem;
height: 1.2rem;
cursor: pointer;
}
.selected-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 1rem;
}
.tag {
background: var(--primary-color);
color: white;
padding: 0.3rem 0.6rem;
border-radius: 12px;
font-size: 0.85rem;
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
}
.code-output {
width: 100%;
height: 500px;
background: var(--bg-main);
color: var(--text-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
padding: 1rem;
font-family: var(--font-mono);
font-size: 14px;
line-height: 1.5;
resize: vertical;
white-space: pre;
overflow-wrap: normal;
overflow-x: auto;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
</style>
</head>
<body class="theme-dark">
<div class="tool-canvas-container" id="canvas-container"></div>
<main class="main-content">
<div class="container">
<div class="tool-header">
<div>
<a href="index.html" class="back-link">← Back to Toolbox</a>
<h1>30. Git Ignore Generator</h1>
</div>
<div>
<select id="theme-select" aria-label="Select Theme">
<option value="dark">Dark Theme</option>
<option value="light">Light Theme</option>
<option value="solarized">Solarized</option>
<option value="neon">Neon Glow</option>
<option value="highcontrast">High Contrast</option>
</select>
</div>
</div>
<div class="split-view">
<div class="glass-panel">
<h3>Environments & Frameworks</h3>
<input type="text" class="search-box" id="search-box" placeholder="Search (e.g. Node, Python)...">
<div class="selected-tags" id="selected-tags">
<!-- Tags inserted here -->
</div>
<div class="category-list" id="category-list">
<!-- Items inserted via JS -->
</div>
</div>
<div class="glass-panel" style="display: flex; flex-direction: column;">
<div class="toolbar">
<h3>Generated .gitignore</h3>
<div style="display: flex; gap: 0.5rem;">
<button class="btn" id="copy-btn">Copy Output</button>
<button class="btn btn-primary" id="download-btn">Download</button>
</div>
</div>
<textarea class="code-output" id="output-area" readonly placeholder="Select templates from the left to generate..."></textarea>
</div>
</div>
</div>
</main>
<footer class="global-footer">
<div class="container">
Made with ❤️ by <a href="https://github.com/Aliriyaj007" target="_blank">Aliriyaj007</a>
</div>
</footer>
<script src="assets/core.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Local database of common gitignore templates
const templates = {
"Node.js": `
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# dotenv environment variables file
.env
.env.test
# Next.js build output
.next
out/
# Build output
dist
build
`,
"Python": `
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Virtual Environments
venv/
env/
ENV/
env.bak/
venv.bak/
# User-specific python IDE config
.idea/
.vscode/
`,
"Java": `
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# IDE Specific
.idea/
.classpath
.project
.settings/
*.iml
`,
"React": `
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
`,
"macOS": `
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
`,
"Windows": `
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
`,
"Linux": `
*~
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
`,
"Go": `
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with 'go test -c'
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
`
};
const searchBox = document.getElementById('search-box');
const categoryList = document.getElementById('category-list');
const selectedTags = document.getElementById('selected-tags');
const outputArea = document.getElementById('output-area');
const copyBtn = document.getElementById('copy-btn');
const downloadBtn = document.getElementById('download-btn');
let selectedSets = new Set();
const keys = Object.keys(templates).sort((a,b) => a.localeCompare(b));
const renderCategories = (filter = '') => {
categoryList.innerHTML = '';
const fLower = filter.toLowerCase();
keys.forEach(key => {
if (filter && !key.toLowerCase().includes(fLower)) return;
const el = document.createElement('label');
el.className = 'category-item';
const isChecked = selectedSets.has(key);
el.innerHTML = `
<input type="checkbox" value="${key}" ${isChecked ? 'checked' : ''}>
<span>${key}</span>
`;
el.querySelector('input').addEventListener('change', (e) => {
if (e.target.checked) selectedSets.add(key);
else selectedSets.delete(key);
updateOutput();
renderTags();
});
categoryList.appendChild(el);
});
};
const renderTags = () => {
selectedTags.innerHTML = '';
selectedSets.forEach(key => {
const tag = document.createElement('div');
tag.className = 'tag';
tag.innerHTML = `${key} <span style="font-size: 1.2rem; margin-top: -2px">×</span>`;
tag.addEventListener('click', () => {
selectedSets.delete(key);
renderTags();
renderCategories(searchBox.value);
updateOutput();
});
selectedTags.appendChild(tag);
});
};
const updateOutput = () => {
if (selectedSets.size === 0) {
outputArea.value = '';
if(window.update3DShield) window.update3DShield(0);
return;
}
let out = `# Created by Developer Toolbox - Git Ignore Generator\n`;
selectedSets.forEach(key => {
out += `\n### ${key} ###\n`;
out += templates[key];
});
outputArea.value = out;
if(window.update3DShield) window.update3DShield(selectedSets.size);
};
searchBox.addEventListener('input', (e) => renderCategories(e.target.value));
copyBtn.addEventListener('click', () => {
if(!outputArea.value) return;
navigator.clipboard.writeText(outputArea.value);
const og = copyBtn.textContent;
copyBtn.textContent = "Copied!";
setTimeout(() => copyBtn.textContent = og, 1500);
});
downloadBtn.addEventListener('click', () => {
if(!outputArea.value) return;
const blob = new Blob([outputArea.value], { type: 'text/plain;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = '.gitignore';
link.click();
URL.revokeObjectURL(url);
});
// Initial render
renderCategories();
});
// 3D Visualization: A shield that blocks unwanted files.
let scene, camera, renderer, shieldGroup, particlesGroup;
function init3D() {
const container = document.getElementById('canvas-container');
if(!container || !window.THREE) return;
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(0, 0, 10);
camera.lookAt(0, 0, 0);
renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
container.appendChild(renderer.domElement);
const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
scene.add(ambientLight);
const dirLight = new THREE.DirectionalLight(0xffffff, 0.8);
dirLight.position.set(5, 5, 5);
scene.add(dirLight);
shieldGroup = new THREE.Group();
scene.add(shieldGroup);
// Shield Geometry
const shape = new THREE.Shape();
shape.moveTo(0, 2);
shape.quadraticCurveTo(1.5, 2, 2, 1);
shape.quadraticCurveTo(2, -1, 0, -2.5);
shape.quadraticCurveTo(-2, -1, -2, 1);
shape.quadraticCurveTo(-1.5, 2, 0, 2);
const extrudeSettings = { depth: 0.2, bevelEnabled: true, bevelSegments: 2, steps: 2, bevelSize: 0.1, bevelThickness: 0.1 };
const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
// Center the geometry
geometry.computeBoundingBox();
const bdOffset = -0.5 * (geometry.boundingBox.max.z - geometry.boundingBox.min.z);
geometry.translate(0, 0, bdOffset);
const material = new THREE.MeshPhongMaterial({ color: 0x4488ff, shininess: 100, transparent: true, opacity: 0.8 });
const shield = new THREE.Mesh(geometry, material);
shieldGroup.add(shield);
shieldGroup.position.set(3, 0, 0);
shieldGroup.rotation.y = -0.3;
// Particles (Blocked files)
particlesGroup = new THREE.Group();
scene.add(particlesGroup);
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
animate();
}
let baseParticles = 0;
let particles = [];
const fileColors = [0xff4444, 0x44ff44, 0x4444ff, 0xffff44, 0xff44ff];
window.update3DShield = (intensity) => {
if(!shieldGroup) return;
baseParticles = intensity * 5; // number of incoming particles
// Modify shield color based on protection level
const colors = [0x4488ff, 0x22aaee, 0x00ccaa, 0x00ee88, 0x00ff00];
const mixColor = colors[Math.min(intensity, colors.length - 1)];
shieldGroup.children[0].material.color.setHex(mixColor);
};
const createParticle = () => {
const geo = new THREE.BoxGeometry(0.3, 0.3, 0.3);
const mat = new THREE.MeshPhongMaterial({ color: fileColors[Math.floor(Math.random()*fileColors.length)] });
const mesh = new THREE.Mesh(geo, mat);
// Start far left
mesh.position.set(-6, (Math.random() * 4) - 2, (Math.random() * 4) - 2);
particlesGroup.add(mesh);
particles.push({
mesh: mesh,
speedX: 0.05 + Math.random() * 0.05,
rotX: Math.random() * 0.1,
rotY: Math.random() * 0.1,
hit: false
});
};
function animate() {
requestAnimationFrame(animate);
if(shieldGroup) {
// Gentle floating
shieldGroup.position.y = Math.sin(Date.now() * 0.002) * 0.2;
// Spawn particles based on baseParticles
if(particles.length < baseParticles && Math.random() < 0.1) {
createParticle();
}
// Update particles
for(let i = particles.length - 1; i >= 0; i--) {
const p = particles[i];
p.mesh.rotation.x += p.rotX;
p.mesh.rotation.y += p.rotY;
if(!p.hit) {
p.mesh.position.x += p.speedX;
// Bounce off shield
if(p.mesh.position.x > 1.5 && p.mesh.position.x < 3 &&
Math.abs(p.mesh.position.y - shieldGroup.position.y) < 2.5 &&
Math.abs(p.mesh.position.z) < 2) {
p.hit = true;
p.speedX = (-0.05 - Math.random() * 0.05); // bounce back
p.mesh.material.color.setHex(0xffffff); // flash white
}
} else {
// Flying away
p.mesh.position.x += p.speedX;
p.mesh.position.y -= 0.02; // fall
p.mesh.scale.multiplyScalar(0.95); // shrink
if(p.mesh.scale.x < 0.01 || p.mesh.position.x < -8) {
particlesGroup.remove(p.mesh);
particles.splice(i, 1);
}
}
// Cleanup if missed shield
if(p.mesh.position.x > 8) {
particlesGroup.remove(p.mesh);
particles.splice(i, 1);
}
}
}
renderer.render(scene, camera);
}
document.addEventListener('DOMContentLoaded', init3D);
</script>
</body>
</html>