Skip to content

Commit

Permalink
feat: FlappyBird_Game - test
Browse files Browse the repository at this point in the history
  • Loading branch information
welisten authored Dec 27, 2023
1 parent a167444 commit 26cca68
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
2 changes: 0 additions & 2 deletions css/flappy.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ body {
justify-content: center;
overflow: hidden;
padding: 70px;
background-color: red; /*retirar*/
}

[wm-flappy]{
Expand Down Expand Up @@ -301,7 +300,6 @@ body {
.conteudo{
justify-content: center;
font-size: 1.6rem;
background-color: #fee500;/*retirar*/
}
#fade{
height: 100%;
Expand Down
59 changes: 59 additions & 0 deletions css/orientation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.conteudo{
justify-content: center;
overflow: hidden;
padding: 70px;
background-color: aliceblue;
}

[wm-flappy]{
min-width: 90vh;
min-height: 75vw;
}

.sol{
width: 20rem;
}

.passaro{
width: 4rem;
}


.barreira .borda{
height: 2rem;
width: 8.7rem;
border: .1rem solid #304605
}

.barreira .corpo{
height: 10rem;
width: 7.4rem;
border-left: .1rem solid #304605;
border-right: .1rem solid #304605;
}

.progresso{
font-size: 5rem;
}



#fade{
max-width: 100vh;
height: 100vw;
transform-origin: top left;
transform: rotate(90deg) translateY(-100%);
}

.modal{
max-height: 60%;
transform: translate(-50%, -40%);
font-size: 1.2rem;
}
#modal-replay{
min-width: 300px;
}

.title{
display: none;
}
12 changes: 8 additions & 4 deletions js/orientation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const flappyContainer = document.querySelector('[wm-flappy]')
const titleContainer = document.querySelector('.title')
const modalContainer = document.querySelector('#fade')
const conteudo = document.querySelector('.conteudo')
// const conteudo = document.querySelector('.conteudo')

const screenWidth = document.documentElement.clientWidth
const screenHeight = document.documentElement.clientHeight
Expand All @@ -10,16 +12,18 @@ const screenHeight = document.documentElement.clientHeight
console.log(flappyContainer, titleContainer, modalContainer)
function adjustScreen(){
if(window.innerHeight > window.innerWidth){
flappyContainer.style.transform = `rotate(90deg)`
// titleContainer.style.display = `none`
modalContainer.style.transform = `rotate(90deg)`

const styleTag = document.createElement('link')
styleTag.setAttribute('href', './css/orientation.css')
styleTag.setAttribute('rel', 'stylesheet')
document.head.appendChild(styleTag)

flappyContainer.style.transform = `rotate(90deg)`
flappyContainer.style.width = `${screenHeight}px`
flappyContainer.style.height = `${screenWidth}px`
modalContainer.style.width = `${screenHeight}px`
modalContainer.style.height = `${screenWidth}px`

console.log(screenHeight, screenWidth)
}else{
flappyContainer.style.transform = `rotate(0deg)`
// titleContainer.style.diplay = `contents`
Expand Down

0 comments on commit 26cca68

Please sign in to comment.