diff --git a/Dice Game/Images/dice1.png b/Dice Game/Images/dice1.png new file mode 100644 index 00000000..543a9eec Binary files /dev/null and b/Dice Game/Images/dice1.png differ diff --git a/Dice Game/Images/dice2.png b/Dice Game/Images/dice2.png new file mode 100644 index 00000000..472bbacd Binary files /dev/null and b/Dice Game/Images/dice2.png differ diff --git a/Dice Game/Images/dice3.png b/Dice Game/Images/dice3.png new file mode 100644 index 00000000..5bb30aad Binary files /dev/null and b/Dice Game/Images/dice3.png differ diff --git a/Dice Game/Images/dice4.png b/Dice Game/Images/dice4.png new file mode 100644 index 00000000..2c116a94 Binary files /dev/null and b/Dice Game/Images/dice4.png differ diff --git a/Dice Game/Images/dice5.png b/Dice Game/Images/dice5.png new file mode 100644 index 00000000..d566cd85 Binary files /dev/null and b/Dice Game/Images/dice5.png differ diff --git a/Dice Game/Images/dice6.png b/Dice Game/Images/dice6.png new file mode 100644 index 00000000..8b98b3c3 Binary files /dev/null and b/Dice Game/Images/dice6.png differ diff --git a/Dice Game/dice.css b/Dice Game/dice.css new file mode 100644 index 00000000..61f9149e --- /dev/null +++ b/Dice Game/dice.css @@ -0,0 +1,47 @@ +.container { + width: 70%; + margin: auto; + text-align: center; + } + + .dice { + text-align: center; + display: inline-block; + + } + + body { + background-color: #393E46; + } + + h1 { + margin: 30px; + font-family: 'Lobster', cursive; + text-shadow: 5px 0 #232931; + font-size: 8rem; + color: #4ECCA3; + } + + p { + font-size: 2rem; + color: #4ECCA3; + font-family: 'Indie Flower', cursive; + } + + img { + width: 80%; + } + + footer { + margin-top: 5%; + color: #EEEEEE; + text-align: center; + font-family: 'Indie Flower', cursive; + + } + + .but{ + margin-left: 745px; + margin-top: 16px; + } + \ No newline at end of file diff --git a/Dice Game/dice.html b/Dice Game/dice.html new file mode 100644 index 00000000..43f811fa --- /dev/null +++ b/Dice Game/dice.html @@ -0,0 +1,32 @@ + + + + + Dicee + + + + + + +
+

Refresh Me

+ +
+

Player 1

+ +
+ +
+

Player 2

+ +
+ +
+ + + + + + + diff --git a/Dice Game/dice.js b/Dice Game/dice.js new file mode 100644 index 00000000..51c67aa3 --- /dev/null +++ b/Dice Game/dice.js @@ -0,0 +1,22 @@ +const button = document.querySelector(".but"); +button.addEventListener('click', (e) => { + e.preventDefault(); + const randomNumber1 = Math.ceil(Math.random()*6); + const randomNumber2 = Math.ceil(Math.random()*6); + const img1 = document.querySelector(".img1"); + const img2 = document.querySelector(".img2"); + img1.src = `Images/dice${randomNumber1}.png`; + img2.src = `Images/dice${randomNumber2}.png`; + if(randomNumber1>randomNumber2) + { + document.querySelector("h1").innerHTML = "Player 1 Wins!"; + } + else if(randomNumber1