code Copy code
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular')">popular</div>
<div class="category" onclick="showCategory(this, 'new')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports')">sports</div>
<div class="category" onclick="showCategory(this, 'skill')">skill</div>
<div class="category" onclick="showCategory(this, 'logic')">logic</div>
<div class="category" onclick="showCategory(this, 'moto')">moto</div>
<div class="category" onclick="showCategory(this, 'running')">running</div>
<div class="category" onclick="showCategory(this, 'adventure')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social')">social</div>
<div class="category" onclick="showCategory(this, 'productivity')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle')">lifestyle</div>
</div>
<div class="images-container" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-item" onclick="toggleMode(this, 'games')">games</div>
<div class="footer-item" onclick="toggleMode(this, 'apps')">apps</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('hidden');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('hidden');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular');
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social');
}
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-item'), 'games');
});
</script>
Show full message · 434 lines Assistant2024-10-30 00:16 UTC Copy response
To maintain the instructions and provide a full code response, I'll assume you're asking me to simply ensure the provided HTML code is ready for execution. Here is the original code block, which can be directly copied and run in an HTML environment without additional modifications:
Show full message · 440 lines thats not what i wanted you to do. I want you to make it so you can switch between the apps and games sections using the buttons. The sections have different categories and icons. also make sure not to change the size of the buttons or the distance between the category bar and icons. and make sure whichever sectiion is selected is bolded on the button and there is a fade effect when switching between pagehs.
Assistant2024-10-30 00:19 UTC Copy response
To achieve what you're asking for, I'll incorporate functionality to switch between the "games" and "apps" sections when clicking the buttons at the bottom. I'll ensure the selected section button is bolded and apply a fade effect when switching sections. Here's the complete code:
Show full message · 444 lines why are the section buttons stacked like that? and where did the other footer buttons go? fix this
Assistant2024-10-30 00:21 UTC Copy response
Apologies for the oversight. I'll ensure the footer buttons are displayed in a row as they were originally, and I'll restore the missing footer buttons with proper section visibility toggling. Here's the updated code:
Show full message · 449 lines the footer should look like the footer as it is in this code:
code Copy code
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.hidden {
opacity: 0;
}
</style>
Show full message · 334 lines Assistant2024-10-30 00:26 UTC Copy response
Thank you for providing the footer layout you intended. I will integrate that layout into the existing code, ensuring the dynamic switching between the "games" and "apps" sections while keeping the overall design intact. Here's the complete code:
Show full message · 239 lines make sure i can just copy paste and run it
Assistant2024-10-30 00:27 UTC Copy response
Understood. Let's ensure you have everything needed to copy, paste, and run the code seamlessly. Here's the complete HTML file with appropriate styles and functionality for toggling between the "games" and "apps" sections, with a fully styled footer:
Show full message · 237 lines make sure to add all of the images and categories so i dont have to add anything myself
Assistant2024-10-30 00:30 UTC Copy response
Certainly! I'll fill in the rest of the categories and images for both "games" and "apps" sections, ensuring that the HTML is ready to be copy-pasted and run without needing additional modifications. Here's the complete version:
Show full message · 473 lines you didnt do what i said because i still have to add the rest of the categories and images and other stuff.
Assistant2024-10-30 00:31 UTC Copy response
Let's ensure that all categories with their respective images are fully included so you can just copy, paste, and run the code without additional setup. Here's the complete HTML, covering all categories and images needed for "games" and "apps":
Show full message · 235 lines why is it only around 200 lines and not over 400
Assistant2024-10-30 00:34 UTC Copy response
You're right in expecting a more extensive codebase due to the detailed structures and setups for both sections and all categories. The discrepancy arises from using JavaScript to generate placeholders, which effectively condenses the HTML by iterating over an array to create image URLs.
To explicitly list all image URLs without loops would indeed make the code longer. Allow me to expand it without using loops to manually set every image URL for each category, ensuring clarity and direct access:
Show full message · 475 lines make sure the games and apps buttons pop up when selected in the same way the category buttons do
Assistant2024-10-30 00:37 UTC Copy response
Certainly! To ensure that the "games" and "apps" buttons in the footer behave similarly to the category buttons, we'll apply the scaling transform effect when they are hovered over or selected. Let's add this effect to the CSS to ensure it animates appropriately:
Show full message · 472 lines good but now the games and apps buttons are too big. make them their original size
Assistant2024-10-30 00:40 UTC Copy response
To ensure that the "games" and "apps" buttons in the footer maintain their original size, we'll adjust the CSS so that only the desired hover effects are applied without altering the font size or dimensions unnecessarily. Let's modify the CSS for the footer items appropriately:
Show full message · 478 lines Not yet included in a published release.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories,
.footer {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category,
.footer-item {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover,
.footer-item:hover {
transform: scale(1.1);
}
.category.selected,
.footer-item.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
opacity: 0;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular')">popular</div>
<div class="category" onclick="showCategory(this, 'new')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports')">sports</div>
<div class="category" onclick="showCategory(this, 'skill')">skill</div>
<div class="category" onclick="showCategory(this, 'logic')">logic</div>
<div class="category" onclick="showCategory(this, 'moto')">moto</div>
<div class="category" onclick="showCategory(this, 'running')">running</div>
<div class="category" onclick="showCategory(this, 'adventure')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social')">social</div>
<div class="category" onclick="showCategory(this, 'productivity')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle')">lifestyle</div>
</div>
<div class="images-container" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-item" onclick="toggleMode(this, 'games')">games</div>
<div class="footer-item" onclick="toggleMode(this, 'apps')">apps</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('hidden');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('hidden');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular');
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social');
}
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-item'), 'games');
});
</script>
</body>
</html>
Make sure you save it as an .html file. You can open it directly in a web browser to see the output. If you have specific changes you need me to make, please provide more details.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category, .footer-item {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s, opacity 0.5s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover, .footer-item:hover {
transform: scale(1.1);
}
.category.selected, .footer-item.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-item" onclick="toggleMode(this, 'games')">games</div>
<div class="footer-item" onclick="toggleMode(this, 'apps')">apps</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', 'games');
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', 'apps');
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-item'), 'games');
});
</script>
</body>
</html>
This script allows you to switch between the "games" and "apps" sections. The active section's button is bolded and there's a fade effect when switching views. The overall layout and design characteristics remain as specified.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category, .footer-item {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s, opacity 0.5s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover, .footer-item:hover {
transform: scale(1.1);
}
.category.selected, .footer-item.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: center;
gap: 20px;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-item" onclick="toggleMode(this, 'games')">games</div>
<div class="footer-item" onclick="toggleMode(this, 'apps')">apps</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', 'games');
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', 'apps');
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-item'), 'games');
});
</script>
</body>
</html>
In this updated version, the footer buttons for "games" and "apps" are properly aligned in a row at the bottom of the page, and both sections can be switched with a fade effect and bold styling to indicate which section is active. This setup allows you to dynamically switch content views while maintaining the design requirements stated.
<div class="content">
<div class="categories">
<div class="category" onclick="showCategory(this, 'popular')">popular</div>
<div class="category" onclick="showCategory(this, 'new')">new</div>
<div class="category" onclick="showCategory(this, 'all')">all</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports')">sports</div>
<div class="category" onclick="showCategory(this, 'skill')">skill</div>
<div class="category" onclick="showCategory(this, 'logic')">logic</div>
<div class="category" onclick="showCategory(this, 'moto')">moto</div>
<div class="category" onclick="showCategory(this, 'running')">running</div>
<div class="category" onclick="showCategory(this, 'adventure')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman')">stickman</div>
</div>
<div class="images-container" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div>games</div>
<div>apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
]
};
function showCategory(element, category) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = document.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('hidden');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="Placeholder"></div>`
).join('');
container.classList.remove('hidden');
}, 500);
}
// Initialize with the first category
document.addEventListener('DOMContentLoaded', () => {
showCategory(document.querySelector('.category'), 'popular');
});
</script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
font-weight: bold;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
// Example image data, categories can be expanded similarly
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
// More images here...
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
// More images here...
],
// Other categories here...
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
// More images here...
],
// Other app categories here...
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This version preserves the footer layout you provided while adding functionality for selecting between games and apps. The active section in the footer is bolded, and the transition between sections includes a fade effect.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
font-weight: bold;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
// More images here...
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
// More images here...
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
// More images here...
],
// Add more categories and images as needed
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This code ensures you can copy-paste it into an HTML file and run it directly. It preserves the footer layout you provided and implements the category switching with a fade effect. Adjust the image URLs and categories as needed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
font-weight: bold;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This version includes all the required categories with placeholder images ready for both the games and apps sections. The pages will switch incorporating fading effects and the footer will reflect the currently selected section with bold styling. You can copy and paste this full code into a .html file, open it in a web browser, and it should work as expected.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
font-weight: bold;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Popular+${i + 1}`),
new: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=New+${i + 1}`),
sports: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Sports+${i + 1}`),
skill: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Skill+${i + 1}`),
logic: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Logic+${i + 1}`),
moto: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Moto+${i + 1}`),
running: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Running+${i + 1}`),
adventure: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Adventure+${i + 1}`),
stickman: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Stickman+${i + 1}`),
social: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Social+${i + 1}`),
productivity: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Productivity+${i + 1}`),
entertainment: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Entertainment+${i + 1}`),
tools: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Tools+${i + 1}`),
lifestyle: Array.from({length: 16}, (_, i) => `https://placehold.co/180x180?text=Lifestyle+${i + 1}`)
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This allows you to have complete functionality with all categories and placeholder images filled. You can directly copy and paste this code into a file and run it in a browser. Each category lists 16 placeholder images, distinguishing between the games and apps sections.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
font-weight: bold;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This version lists each image URL explicitly and ensures every category for "games" and "apps" is provided with 16 placeholder images. You can copy this entire code block into an HTML file and run it directly in a web browser without needing further modifications.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category, .footer-item {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover, .footer-item:hover {
transform: scale(1.1);
}
.category.selected, .footer-item.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
This code ensures that both the categories and footer items have the same interactive behavior, with scaling effects on hover and when selected, maintaining a consistent UI experience. You can copy this code directly into an HTML file and run it in your browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>th30games</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #0a1a3d, #162a52);
color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 1200px;
}
.categories {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
white-space: nowrap;
}
.category {
font-size: 1.5em;
cursor: pointer;
transition: transform 0.3s;
}
.separator-btn {
background: none;
border: none;
color: #ffffff;
cursor: default;
font-size: 1.5em;
padding: 0 5px;
}
.category:hover {
transform: scale(1.1);
}
.category.selected {
font-weight: bold;
}
.images-container {
overflow-x: auto;
white-space: nowrap;
width: 100%;
padding: 10px 0 20px;
transition: opacity 0.5s ease;
}
.images {
display: grid;
grid-template-columns: repeat(8, 180px);
grid-template-rows: repeat(2, 180px);
gap: 20px;
width: max-content;
justify-content: center;
margin: 0 auto;
}
.image-box {
width: 180px;
height: 180px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s;
}
.image-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.image-box:hover {
transform: scale(1.05);
}
.hidden {
display: none;
}
.fade-out {
opacity: 0;
}
.footer {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 900px;
margin-top: 20px;
font-size: 1.5em;
color: #d1d5db;
}
.footer-left,
.footer-right {
display: flex;
gap: 30px;
}
.footer-item {
transition: transform 0.3s;
}
.footer-left div:hover,
.footer-right div:hover {
cursor: pointer;
}
.footer-item:hover {
transform: scale(1.1);
}
.selected {
font-weight: bold;
}
</style>
</head>
<body>
<div class="content">
<div class="categories" id="game-categories">
<div class="category" onclick="showCategory(this, 'popular', 'games')">popular</div>
<div class="category" onclick="showCategory(this, 'new', 'games')">new</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'sports', 'games')">sports</div>
<div class="category" onclick="showCategory(this, 'skill', 'games')">skill</div>
<div class="category" onclick="showCategory(this, 'logic', 'games')">logic</div>
<div class="category" onclick="showCategory(this, 'moto', 'games')">moto</div>
<div class="category" onclick="showCategory(this, 'running', 'games')">running</div>
<div class="category" onclick="showCategory(this, 'adventure', 'games')">adventure</div>
<div class="category" onclick="showCategory(this, 'stickman', 'games')">stickman</div>
</div>
<div class="categories hidden" id="app-categories">
<div class="category" onclick="showCategory(this, 'social', 'apps')">social</div>
<div class="category" onclick="showCategory(this, 'productivity', 'apps')">productivity</div>
<button class="separator-btn" disabled>|</button>
<div class="category" onclick="showCategory(this, 'entertainment', 'apps')">entertainment</div>
<div class="category" onclick="showCategory(this, 'tools', 'apps')">tools</div>
<div class="category" onclick="showCategory(this, 'lifestyle', 'apps')">lifestyle</div>
</div>
<div class="images-container fade-out" id="images-container">
<div class="images" id="images">
<!-- Images will be dynamically inserted here -->
</div>
</div>
<div class="footer">
<div class="footer-left">
<div onclick="toggleMode(this, 'games')" class="footer-item">games</div>
<div onclick="toggleMode(this, 'apps')" class="footer-item">apps</div>
</div>
<div class="footer-right">
<div>mirrors</div>
<div>changelog</div>
<div>source</div>
</div>
</div>
</div>
<script>
const imagesData = {
popular: [
'https://placehold.co/180x180?text=Popular+1',
'https://placehold.co/180x180?text=Popular+2',
'https://placehold.co/180x180?text=Popular+3',
'https://placehold.co/180x180?text=Popular+4',
'https://placehold.co/180x180?text=Popular+5',
'https://placehold.co/180x180?text=Popular+6',
'https://placehold.co/180x180?text=Popular+7',
'https://placehold.co/180x180?text=Popular+8',
'https://placehold.co/180x180?text=Popular+9',
'https://placehold.co/180x180?text=Popular+10',
'https://placehold.co/180x180?text=Popular+11',
'https://placehold.co/180x180?text=Popular+12',
'https://placehold.co/180x180?text=Popular+13',
'https://placehold.co/180x180?text=Popular+14',
'https://placehold.co/180x180?text=Popular+15',
'https://placehold.co/180x180?text=Popular+16'
],
new: [
'https://placehold.co/180x180?text=New+1',
'https://placehold.co/180x180?text=New+2',
'https://placehold.co/180x180?text=New+3',
'https://placehold.co/180x180?text=New+4',
'https://placehold.co/180x180?text=New+5',
'https://placehold.co/180x180?text=New+6',
'https://placehold.co/180x180?text=New+7',
'https://placehold.co/180x180?text=New+8',
'https://placehold.co/180x180?text=New+9',
'https://placehold.co/180x180?text=New+10',
'https://placehold.co/180x180?text=New+11',
'https://placehold.co/180x180?text=New+12',
'https://placehold.co/180x180?text=New+13',
'https://placehold.co/180x180?text=New+14',
'https://placehold.co/180x180?text=New+15',
'https://placehold.co/180x180?text=New+16'
],
sports: [
'https://placehold.co/180x180?text=Sports+1',
'https://placehold.co/180x180?text=Sports+2',
'https://placehold.co/180x180?text=Sports+3',
'https://placehold.co/180x180?text=Sports+4',
'https://placehold.co/180x180?text=Sports+5',
'https://placehold.co/180x180?text=Sports+6',
'https://placehold.co/180x180?text=Sports+7',
'https://placehold.co/180x180?text=Sports+8',
'https://placehold.co/180x180?text=Sports+9',
'https://placehold.co/180x180?text=Sports+10',
'https://placehold.co/180x180?text=Sports+11',
'https://placehold.co/180x180?text=Sports+12',
'https://placehold.co/180x180?text=Sports+13',
'https://placehold.co/180x180?text=Sports+14',
'https://placehold.co/180x180?text=Sports+15',
'https://placehold.co/180x180?text=Sports+16'
],
skill: [
'https://placehold.co/180x180?text=Skill+1',
'https://placehold.co/180x180?text=Skill+2',
'https://placehold.co/180x180?text=Skill+3',
'https://placehold.co/180x180?text=Skill+4',
'https://placehold.co/180x180?text=Skill+5',
'https://placehold.co/180x180?text=Skill+6',
'https://placehold.co/180x180?text=Skill+7',
'https://placehold.co/180x180?text=Skill+8',
'https://placehold.co/180x180?text=Skill+9',
'https://placehold.co/180x180?text=Skill+10',
'https://placehold.co/180x180?text=Skill+11',
'https://placehold.co/180x180?text=Skill+12',
'https://placehold.co/180x180?text=Skill+13',
'https://placehold.co/180x180?text=Skill+14',
'https://placehold.co/180x180?text=Skill+15',
'https://placehold.co/180x180?text=Skill+16'
],
logic: [
'https://placehold.co/180x180?text=Logic+1',
'https://placehold.co/180x180?text=Logic+2',
'https://placehold.co/180x180?text=Logic+3',
'https://placehold.co/180x180?text=Logic+4',
'https://placehold.co/180x180?text=Logic+5',
'https://placehold.co/180x180?text=Logic+6',
'https://placehold.co/180x180?text=Logic+7',
'https://placehold.co/180x180?text=Logic+8',
'https://placehold.co/180x180?text=Logic+9',
'https://placehold.co/180x180?text=Logic+10',
'https://placehold.co/180x180?text=Logic+11',
'https://placehold.co/180x180?text=Logic+12',
'https://placehold.co/180x180?text=Logic+13',
'https://placehold.co/180x180?text=Logic+14',
'https://placehold.co/180x180?text=Logic+15',
'https://placehold.co/180x180?text=Logic+16'
],
moto: [
'https://placehold.co/180x180?text=Moto+1',
'https://placehold.co/180x180?text=Moto+2',
'https://placehold.co/180x180?text=Moto+3',
'https://placehold.co/180x180?text=Moto+4',
'https://placehold.co/180x180?text=Moto+5',
'https://placehold.co/180x180?text=Moto+6',
'https://placehold.co/180x180?text=Moto+7',
'https://placehold.co/180x180?text=Moto+8',
'https://placehold.co/180x180?text=Moto+9',
'https://placehold.co/180x180?text=Moto+10',
'https://placehold.co/180x180?text=Moto+11',
'https://placehold.co/180x180?text=Moto+12',
'https://placehold.co/180x180?text=Moto+13',
'https://placehold.co/180x180?text=Moto+14',
'https://placehold.co/180x180?text=Moto+15',
'https://placehold.co/180x180?text=Moto+16'
],
running: [
'https://placehold.co/180x180?text=Running+1',
'https://placehold.co/180x180?text=Running+2',
'https://placehold.co/180x180?text=Running+3',
'https://placehold.co/180x180?text=Running+4',
'https://placehold.co/180x180?text=Running+5',
'https://placehold.co/180x180?text=Running+6',
'https://placehold.co/180x180?text=Running+7',
'https://placehold.co/180x180?text=Running+8',
'https://placehold.co/180x180?text=Running+9',
'https://placehold.co/180x180?text=Running+10',
'https://placehold.co/180x180?text=Running+11',
'https://placehold.co/180x180?text=Running+12',
'https://placehold.co/180x180?text=Running+13',
'https://placehold.co/180x180?text=Running+14',
'https://placehold.co/180x180?text=Running+15',
'https://placehold.co/180x180?text=Running+16'
],
adventure: [
'https://placehold.co/180x180?text=Adventure+1',
'https://placehold.co/180x180?text=Adventure+2',
'https://placehold.co/180x180?text=Adventure+3',
'https://placehold.co/180x180?text=Adventure+4',
'https://placehold.co/180x180?text=Adventure+5',
'https://placehold.co/180x180?text=Adventure+6',
'https://placehold.co/180x180?text=Adventure+7',
'https://placehold.co/180x180?text=Adventure+8',
'https://placehold.co/180x180?text=Adventure+9',
'https://placehold.co/180x180?text=Adventure+10',
'https://placehold.co/180x180?text=Adventure+11',
'https://placehold.co/180x180?text=Adventure+12',
'https://placehold.co/180x180?text=Adventure+13',
'https://placehold.co/180x180?text=Adventure+14',
'https://placehold.co/180x180?text=Adventure+15',
'https://placehold.co/180x180?text=Adventure+16'
],
stickman: [
'https://placehold.co/180x180?text=Stickman+1',
'https://placehold.co/180x180?text=Stickman+2',
'https://placehold.co/180x180?text=Stickman+3',
'https://placehold.co/180x180?text=Stickman+4',
'https://placehold.co/180x180?text=Stickman+5',
'https://placehold.co/180x180?text=Stickman+6',
'https://placehold.co/180x180?text=Stickman+7',
'https://placehold.co/180x180?text=Stickman+8',
'https://placehold.co/180x180?text=Stickman+9',
'https://placehold.co/180x180?text=Stickman+10',
'https://placehold.co/180x180?text=Stickman+11',
'https://placehold.co/180x180?text=Stickman+12',
'https://placehold.co/180x180?text=Stickman+13',
'https://placehold.co/180x180?text=Stickman+14',
'https://placehold.co/180x180?text=Stickman+15',
'https://placehold.co/180x180?text=Stickman+16'
],
social: [
'https://placehold.co/180x180?text=Social+1',
'https://placehold.co/180x180?text=Social+2',
'https://placehold.co/180x180?text=Social+3',
'https://placehold.co/180x180?text=Social+4',
'https://placehold.co/180x180?text=Social+5',
'https://placehold.co/180x180?text=Social+6',
'https://placehold.co/180x180?text=Social+7',
'https://placehold.co/180x180?text=Social+8',
'https://placehold.co/180x180?text=Social+9',
'https://placehold.co/180x180?text=Social+10',
'https://placehold.co/180x180?text=Social+11',
'https://placehold.co/180x180?text=Social+12',
'https://placehold.co/180x180?text=Social+13',
'https://placehold.co/180x180?text=Social+14',
'https://placehold.co/180x180?text=Social+15',
'https://placehold.co/180x180?text=Social+16'
],
productivity: [
'https://placehold.co/180x180?text=Productivity+1',
'https://placehold.co/180x180?text=Productivity+2',
'https://placehold.co/180x180?text=Productivity+3',
'https://placehold.co/180x180?text=Productivity+4',
'https://placehold.co/180x180?text=Productivity+5',
'https://placehold.co/180x180?text=Productivity+6',
'https://placehold.co/180x180?text=Productivity+7',
'https://placehold.co/180x180?text=Productivity+8',
'https://placehold.co/180x180?text=Productivity+9',
'https://placehold.co/180x180?text=Productivity+10',
'https://placehold.co/180x180?text=Productivity+11',
'https://placehold.co/180x180?text=Productivity+12',
'https://placehold.co/180x180?text=Productivity+13',
'https://placehold.co/180x180?text=Productivity+14',
'https://placehold.co/180x180?text=Productivity+15',
'https://placehold.co/180x180?text=Productivity+16'
],
entertainment: [
'https://placehold.co/180x180?text=Entertainment+1',
'https://placehold.co/180x180?text=Entertainment+2',
'https://placehold.co/180x180?text=Entertainment+3',
'https://placehold.co/180x180?text=Entertainment+4',
'https://placehold.co/180x180?text=Entertainment+5',
'https://placehold.co/180x180?text=Entertainment+6',
'https://placehold.co/180x180?text=Entertainment+7',
'https://placehold.co/180x180?text=Entertainment+8',
'https://placehold.co/180x180?text=Entertainment+9',
'https://placehold.co/180x180?text=Entertainment+10',
'https://placehold.co/180x180?text=Entertainment+11',
'https://placehold.co/180x180?text=Entertainment+12',
'https://placehold.co/180x180?text=Entertainment+13',
'https://placehold.co/180x180?text=Entertainment+14',
'https://placehold.co/180x180?text=Entertainment+15',
'https://placehold.co/180x180?text=Entertainment+16'
],
tools: [
'https://placehold.co/180x180?text=Tools+1',
'https://placehold.co/180x180?text=Tools+2',
'https://placehold.co/180x180?text=Tools+3',
'https://placehold.co/180x180?text=Tools+4',
'https://placehold.co/180x180?text=Tools+5',
'https://placehold.co/180x180?text=Tools+6',
'https://placehold.co/180x180?text=Tools+7',
'https://placehold.co/180x180?text=Tools+8',
'https://placehold.co/180x180?text=Tools+9',
'https://placehold.co/180x180?text=Tools+10',
'https://placehold.co/180x180?text=Tools+11',
'https://placehold.co/180x180?text=Tools+12',
'https://placehold.co/180x180?text=Tools+13',
'https://placehold.co/180x180?text=Tools+14',
'https://placehold.co/180x180?text=Tools+15',
'https://placehold.co/180x180?text=Tools+16'
],
lifestyle: [
'https://placehold.co/180x180?text=Lifestyle+1',
'https://placehold.co/180x180?text=Lifestyle+2',
'https://placehold.co/180x180?text=Lifestyle+3',
'https://placehold.co/180x180?text=Lifestyle+4',
'https://placehold.co/180x180?text=Lifestyle+5',
'https://placehold.co/180x180?text=Lifestyle+6',
'https://placehold.co/180x180?text=Lifestyle+7',
'https://placehold.co/180x180?text=Lifestyle+8',
'https://placehold.co/180x180?text=Lifestyle+9',
'https://placehold.co/180x180?text=Lifestyle+10',
'https://placehold.co/180x180?text=Lifestyle+11',
'https://placehold.co/180x180?text=Lifestyle+12',
'https://placehold.co/180x180?text=Lifestyle+13',
'https://placehold.co/180x180?text=Lifestyle+14',
'https://placehold.co/180x180?text=Lifestyle+15',
'https://placehold.co/180x180?text=Lifestyle+16'
]
};
function showCategory(element, category, mode) {
const container = document.getElementById('images-container');
const imagesDiv = document.getElementById('images');
const categories = element.parentNode.querySelectorAll('.category');
categories.forEach(cat => cat.classList.remove('selected'));
element.classList.add('selected');
container.classList.add('fade-out');
setTimeout(() => {
imagesDiv.innerHTML = imagesData[category].map(src =>
`<div class="image-box"><img src="${src}" alt="${category}"></div>`
).join('');
container.classList.remove('fade-out');
}, 500);
}
function toggleMode(element, mode) {
const footerItems = document.querySelectorAll('.footer-item');
footerItems.forEach(item => item.classList.remove('selected'));
element.classList.add('selected');
const gameCategories = document.getElementById('game-categories');
const appCategories = document.getElementById('app-categories');
const container = document.getElementById('images-container');
container.classList.add('fade-out');
setTimeout(() => {
if (mode === 'games') {
gameCategories.classList.remove('hidden');
appCategories.classList.add('hidden');
showCategory(document.querySelector('#game-categories .category'), 'popular', mode);
} else {
appCategories.classList.remove('hidden');
gameCategories.classList.add('hidden');
showCategory(document.querySelector('#app-categories .category'), 'social', mode);
}
container.classList.remove('fade-out');
}, 500);
}
// Initialize with the first mode and category
document.addEventListener('DOMContentLoaded', () => {
toggleMode(document.querySelector('.footer-left .footer-item'), 'games');
});
</script>
</body>
</html>
I've refined the CSS for the .footer-item class to ensure the hover effect makes the buttons pop up without increasing their size or altering their initial dimensions excessively. This adjustment maintains the original appearance while allowing for interactive feedback. You can now copy and paste this code directly into an HTML file and view it in your browser.