when clicking all button show both the columns, art and games beside each others, when clicking games button show only games column and have it centered on the screen, the art button works the same way but show the art column
Browse files- index.html +42 -29
index.html
CHANGED
|
@@ -378,45 +378,58 @@ View All Projects
|
|
| 378 |
allBtn.classList.remove('bg-red-600', 'text-white');
|
| 379 |
allBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 380 |
if (filter === 'games') {
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
|
|
|
| 388 |
gamesBtn.classList.remove('border', 'border-red-600', 'text-red-600');
|
| 389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
gamesCol.style.display = 'none';
|
| 391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
artBtn.classList.remove('border', 'border-red-600', 'text-red-600');
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
allBtn.classList.
|
| 396 |
-
allBtn.classList.
|
| 397 |
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
`;
|
| 405 |
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
|
|
|
| 412 |
}
|
| 413 |
}
|
| 414 |
// Initialize with all shown by default
|
| 415 |
document.addEventListener('DOMContentLoaded', function() {
|
| 416 |
const projectsGrid = document.getElementById('projects-grid');
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
|
|
|
| 420 |
// Scroll to section function
|
| 421 |
function scrollToSection(sectionId) {
|
| 422 |
if (sectionId === 'hero') {
|
|
|
|
| 378 |
allBtn.classList.remove('bg-red-600', 'text-white');
|
| 379 |
allBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 380 |
if (filter === 'games') {
|
| 381 |
+
// Show only games column centered
|
| 382 |
+
gamesCol.style.display = 'grid';
|
| 383 |
+
artCol.style.display = 'none';
|
| 384 |
+
projectsGrid.style.gridTemplateColumns = '1fr';
|
| 385 |
+
projectsGrid.style.maxWidth = '640px'; // Narrower width for single column
|
| 386 |
+
|
| 387 |
+
// Update button styles
|
| 388 |
+
gamesBtn.classList.add('bg-red-600', 'text-white');
|
| 389 |
gamesBtn.classList.remove('border', 'border-red-600', 'text-red-600');
|
| 390 |
+
artBtn.classList.remove('bg-red-600', 'text-white');
|
| 391 |
+
artBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 392 |
+
allBtn.classList.remove('bg-red-600', 'text-white');
|
| 393 |
+
allBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 394 |
+
|
| 395 |
+
} else if (filter === 'art') {
|
| 396 |
+
// Show only art column centered
|
| 397 |
gamesCol.style.display = 'none';
|
| 398 |
+
artCol.style.display = 'grid';
|
| 399 |
+
projectsGrid.style.gridTemplateColumns = '1fr';
|
| 400 |
+
projectsGrid.style.maxWidth = '640px'; // Narrower width for single column
|
| 401 |
+
|
| 402 |
+
// Update button styles
|
| 403 |
+
artBtn.classList.add('bg-red-600', 'text-white');
|
| 404 |
artBtn.classList.remove('border', 'border-red-600', 'text-red-600');
|
| 405 |
+
gamesBtn.classList.remove('bg-red-600', 'text-white');
|
| 406 |
+
gamesBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 407 |
+
allBtn.classList.remove('bg-red-600', 'text-white');
|
| 408 |
+
allBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 409 |
|
| 410 |
+
} else { // all
|
| 411 |
+
// Show both columns side by side
|
| 412 |
+
gamesCol.style.display = 'grid';
|
| 413 |
+
artCol.style.display = 'grid';
|
| 414 |
+
projectsGrid.style.gridTemplateColumns = '1fr 1fr';
|
| 415 |
+
projectsGrid.style.maxWidth = '1024px'; // Wider width for two columns
|
|
|
|
| 416 |
|
| 417 |
+
// Update button styles
|
| 418 |
+
allBtn.classList.add('bg-red-600', 'text-white');
|
| 419 |
+
allBtn.classList.remove('border', 'border-red-600', 'text-red-600');
|
| 420 |
+
gamesBtn.classList.remove('bg-red-600', 'text-white');
|
| 421 |
+
gamesBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 422 |
+
artBtn.classList.remove('bg-red-600', 'text-white');
|
| 423 |
+
artBtn.classList.add('border', 'border-red-600', 'text-red-600');
|
| 424 |
}
|
| 425 |
}
|
| 426 |
// Initialize with all shown by default
|
| 427 |
document.addEventListener('DOMContentLoaded', function() {
|
| 428 |
const projectsGrid = document.getElementById('projects-grid');
|
| 429 |
+
projectsGrid.style.gridTemplateColumns = '1fr 1fr';
|
| 430 |
+
projectsGrid.style.maxWidth = '1024px';
|
| 431 |
+
filterProjects('all');
|
| 432 |
+
});
|
| 433 |
// Scroll to section function
|
| 434 |
function scrollToSection(sectionId) {
|
| 435 |
if (sectionId === 'hero') {
|