Skip to content

Commit

Permalink
prepare items with images
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sabagh committed Jan 22, 2023
1 parent 8c42bd5 commit 19ff60d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import header from './Components/Header/Header.js'
import footer from './Components/Footer/Footer.js'
import panel from './Components/Panel/Panel.js'
import rock from './images/rock.png'
import paper from './images/paper.png'
import scissor from './images/scissor.png'

export default class {

Expand All @@ -13,12 +16,15 @@ export default class {
counter--
if(counter <= 0){
clearInterval(interval)
panel.innerHTML = ''
resolve('done')
}
},1000)
}).then((result)=>{
let items = ['Paper','Scissor','Rock']
document.querySelector('.panel').innerHTML = items[Math.floor(Math.random()*items.length)]
let items = [rock,paper,scissor]
let img = document.createElement('img')
img.src = items[Math.floor(Math.random()*items.length)]
document.querySelector('.panel').append(img)
})
}

Expand Down
9 changes: 9 additions & 0 deletions src/Components/Panel/Panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
text-align: center;
}
.panel {
display: flex;
justify-content: space-around;
align-items: center;
width: 500px;
height: 400px;
line-height: 400px;
Expand All @@ -14,6 +17,12 @@
font-size: 6em;
font-weight: bolder;
}

.panel img {
width: 300px;
height: auto;
}

button{
color: #212529;
background-color: #ffc107;
Expand Down
File renamed without changes
File renamed without changes

0 comments on commit 19ff60d

Please sign in to comment.