Skip to content

Commit

Permalink
Merge pull request #113 from WildCodeSchool-2023-09/queries
Browse files Browse the repository at this point in the history
Queries
  • Loading branch information
Ijuaa authored Feb 7, 2024
2 parents 7b5cc6e + 52d8be8 commit 3e5cb4a
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 85 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/Snake.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useRef, useEffect } from "react";
import useInterval from "../components/useInterval";
import borne from "../assets/images/borne_arcade.png";
import borne from "../assets/images/borne_game.png";
import "../styles/snake.scss";

const CANVAS_SIZE = [800, 800];
Expand Down Expand Up @@ -162,7 +162,7 @@ function Snake() {
});

return (
<div className="game-container ">
<div className="snake-container ">
<img src={borne} alt="" className="borne-arcade" />
<div
className="snake-wraper"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Tetris.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Tetris from "react-tetris";
import { useState } from "react";
import "../styles/tetris.scss";
import borne from "../assets/images/borne_arcade.png";
import borne from "../assets/images/borne_game.png";

function TetrisGame() {
const [start, setStart] = useState(false);
Expand Down
16 changes: 13 additions & 3 deletions frontend/src/styles/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
padding-top: 15vh;
z-index: 1;
display: flex;
height: 100vh;

.infos-container {
color: white;
Expand Down Expand Up @@ -241,10 +242,13 @@
background-size: contain;
background-repeat: no-repeat;
flex-grow: 1;
height: 500px;
height: 450px;
display: flex;
align-items: flex-end;
justify-content: center;
@media screen and (min-width: 1920px) {
height: 500px;
}
@media screen and (max-width: 1000px) {
width: 90%;
height: 60vh;
Expand Down Expand Up @@ -297,10 +301,13 @@
background-repeat: no-repeat;
background-position: center;
flex-grow: 1;
height: 500px;
height: 450px;
display: flex;
align-items: flex-end;
justify-content: center;
@media screen and (min-width: 1920px) {
height: 500px;
}
@media screen and (max-width: 1000px) {
width: 90%;
}
Expand Down Expand Up @@ -348,10 +355,13 @@
background-size: contain;
background-repeat: no-repeat;
flex-grow: 1;
height: 500px;
height: 450px;
display: flex;
align-items: flex-end;
justify-content: center;
@media screen and (min-width: 1920px) {
height: 500px;
}
@media screen and (max-width: 1000px) {
width: 90%;
background-size: cover;
Expand Down
17 changes: 11 additions & 6 deletions frontend/src/styles/pacman.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
position: absolute;
z-index: 2;
transform: scale(1.2);
@media screen and (min-width: 1600px) {
transform: scale(1.1);
}

@media screen and (min-width: 1921px) {
top: 5vh !important;
Expand All @@ -31,11 +28,15 @@
@media screen and (max-width: 1160px) {
display: none;
}
@media screen and (max-width: 1160px) {
display: none;
}
@media screen and (min-width: 1161px) and (max-width: 1919px) {
transform: scale(1.8);
top: 200px;
transform: scale(1.4);
top: 0;
}
}

.pacman-play {
position: absolute;
z-index: 100;
Expand Down Expand Up @@ -82,7 +83,8 @@
border-radius: 20px;
}
@media screen and (min-width: 1161px) and (max-width: 1919px) {
width: 1200px;
width: 60svw;
max-width: 1200px;
height: 85vh;
border-radius: 20px;
}
Expand All @@ -93,6 +95,9 @@
@media screen and (max-width: 1160px) {
transform: scale(0.8);
}
@media screen and (min-width: 2100px) {
top: -6em;
}
}
}
}
83 changes: 50 additions & 33 deletions frontend/src/styles/snake.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
.game-container {
transform: scale(0.7);
@media screen and (min-width: 1921px) {
transform: scale(0.9);
.snake-container {
display: flex;
align-items: center;
justify-content: center;
height: 90vh;
width: 100vw;
margin: 0 auto;
position: relative;
@media screen and (min-width: 1920px) {
top: 20vh;
}
.borne-arcade {
top: 0;
position: absolute;
z-index: 2;
transform: scale(1.2);

@media screen and (min-width: 1600px) {
transform: scale(1.1);
}

@media screen and (min-width: 1921px) {
top: -250px;
top: 5vh !important;
margin-bottom: 160px;
transform: scale(2.1);
}
@media screen and (min-width: 1920px) {
Expand All @@ -24,8 +26,12 @@
@media screen and (max-width: 1160px) {
display: none;
}
@media screen and (max-width: 1160px) {
display: none;
}
@media screen and (min-width: 1161px) and (max-width: 1919px) {
transform: scale(2.3);
transform: scale(1.4);
top: 0;
}
}

Expand All @@ -34,52 +40,68 @@
justify-content: center;
align-items: center;
flex-direction: column;
height: 80%;
width: 1220px;
text-align: center;
height: 600px;
width: 60svw;
max-width: 1220px;
position: relative;
top: -10em;
top: 50px;

background-color: #000;
@media screen and (max-width: 1160px) {
top: 200px;
width: 80svw;
}
@media screen and (min-width: 1920px) {
top: -40px;
height: 80%;
}
@media screen and (min-width: 1921px) {
top: -16em;
}
@media screen and (min-width: 1161px) and (max-width: 1920px) {
top: 13px;
}

.score {
position: absolute;
color: white;
top: 5em;
left: 5em;
font-size: 2rem;
top: 100px;
left: 150px;
font-size: 1.2rem;
@media screen and (max-width: 1160px) {
top: 100px;
font-size: 1.6rem;
}
@media screen and (min-width: 1920px) {
top: 10em;
left: 6em;
font-size: 1.6rem;
}
@media screen and (min-width: 2400px) {
top: 12em;
left: 8em;
}
}
.canvas-snake {
position: relative;
background-color: #000000;
justify-self: center;
margin: 0 auto;
position: relative;
width: 34em;
height: 34em;
margin-top: 3rem;
width: 500px;
height: 500px;
transform: scale(0.8);
border: 3px solid rgb(139, 92, 112) !important;
@media screen and (max-width: 1160px) {
width: 100%;
}
@media screen and (min-width: 2000px) {
top: 6em;
transform: scale(1.1);
}
}
button,

.game-over {
position: absolute;
top: 50%;
left: 39%;
top: 40%;
margin: 1.5rem;
height: 3rem;
width: 15rem;
Expand All @@ -97,13 +119,8 @@
}
.game-over {
height: 4rem;
}
.play {
top: 900px;
@media screen and (max-width: 1160px) {
top: 200px;
position: relative;
left: 0;
@media screen and (min-width: 2000px) {
top: 18em;
}
}
}
Expand Down
Loading

0 comments on commit 3e5cb4a

Please sign in to comment.