├── README.md ├── images ├── dice1.png ├── dice2.png ├── dice3.png ├── dice4.png ├── dice5.png └── dice6.png ├── scrip.js ├── styles.css └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # dicee-game 2 | It is a simple Dicee game 3 | -------------------------------------------------------------------------------- /images/dice1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice1.png -------------------------------------------------------------------------------- /images/dice2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice2.png -------------------------------------------------------------------------------- /images/dice3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice3.png -------------------------------------------------------------------------------- /images/dice4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice4.png -------------------------------------------------------------------------------- /images/dice5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice5.png -------------------------------------------------------------------------------- /images/dice6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hrshw/dicee-game/HEAD/images/dice6.png -------------------------------------------------------------------------------- /scrip.js: -------------------------------------------------------------------------------- 1 | var randomNumber1 = Math.floor(Math.random()*6)+1; 2 | var randomNumber2 = Math.floor(Math.random()*6)+1; 3 | document.querySelector(".img1").setAttribute("src",`images/dice${randomNumber1}.png`); 4 | document.querySelector(".img2").setAttribute("src",`images/dice${randomNumber2}.png`); 5 | var text = document.querySelector(".container h1"); 6 | 7 | 8 | if(randomNumber1 > randomNumber2){ 9 | text.innerText = " 🚩player 1 is winner"; 10 | }else if(randomNumber1 < randomNumber2){ 11 | text.innerText = "player 2 is winner 🚩"; 12 | }else if(randomNumber1 = randomNumber2){ 13 | text.innerText = "Match is draw" 14 | } 15 | else{ 16 | text.innerText = " Refresh Me" 17 | } -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 70%; 3 | margin: auto; 4 | text-align: center; 5 | } 6 | 7 | .dice { 8 | text-align: center; 9 | display: inline-block; 10 | 11 | } 12 | 13 | body { 14 | background-color: #393E46; 15 | } 16 | 17 | h1 { 18 | margin: 30px; 19 | font-family: 'Lobster', cursive; 20 | text-shadow: 5px 0 #232931; 21 | font-size: 4rem; 22 | color: #4ECCA3; 23 | } 24 | 25 | p { 26 | font-size: 2rem; 27 | color: #4ECCA3; 28 | font-family: 'Indie Flower', cursive; 29 | } 30 | 31 | img { 32 | width: 80%; 33 | } 34 | 35 | footer { 36 | margin-top: 5%; 37 | color: #EEEEEE; 38 | text-align: center; 39 | font-family: 'Indie Flower', cursive; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |Player 1
17 |
18 | Player 2
22 |
23 |