Grafical Games hub + home button :p

This commit is contained in:
2024-08-20 22:15:06 +02:00
parent ff2f9ddc29
commit a8e196f8ec
4 changed files with 86 additions and 5 deletions

View File

@@ -3,12 +3,15 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="icon.png" type="image/x-icon">
<title>Games</title>
</head>
<body>
<a href="./2048/">2048</a>
<a href="./RockPaperScissors/">RockPaperScissors</a>
<a href="./NumberQuess6/">NumberQuess</a>
<a href="./DiceWar/">DiceWar</a>
<div id="blob"></div>
<div id="blur"></div>
<script src="main.js"></script>
<a href="../" id="home"></a>
</body>
</html>

24
Games/main.js Normal file
View File

@@ -0,0 +1,24 @@
const games = [
{
name: '2048',
link: '2048',
},{
name: 'Dice War',
link: 'DiceWar',
},{
name: 'Number Quess 6',
link: 'NumberQuess6',
},{
name: 'Rock Paper Scissors',
link: 'RockPaperScissors',
},
];
window.onload = () => {
for(let i=0; i<games.length; i++){
document.body.innerHTML += `
<a href="./${games[i].link}" class="game">
<img src="./img/${games[i].link}.png" alt="${games[i].name}">
</a>`
}
}

54
Games/style.css Normal file
View File

@@ -0,0 +1,54 @@
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-content: center;
align-items: center;
min-height: 100vh;
background: #333;
flex-wrap: wrap;
}
#home{
position: absolute;
right: 0;
bottom: 0;
height: 50px;
width: 50px;
border-radius: 25px 0 0 0;
background: #555;
}
.game{
z-index: 5;
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 150px;
/*border: 5px red solid;*/
border-radius: 10px;
margin: 1rem;
overflow: hidden;
box-shadow:
inset 5px 5px 15px #aaa,
5px 5px 15px #555;
}
.game img{
transition: .5s;
width: 200px;
height: 150px;
}
.game:hover img{
transition: .25s;
scale: 1.25;
}

View File

@@ -92,7 +92,7 @@ span p{
display: block;
}
.Lime{color: lime;}.Yellow{color: yellow;}.Orange{color: orange;}.Red{color: red;}.DarkRed{color: darkred;}
.Lime{color: lime; user-select: none;}.Yellow{color: yellow; user-select: none;}.Orange{color: orange; user-select: none;}.Red{color: red; user-select: none;}.DarkRed{color: darkred; user-select: none;}
.cash{
position: absolute;