diff --git a/dicegame/dice.html b/dicegame/dice.html new file mode 100644 index 0000000..eba73d9 --- /dev/null +++ b/dicegame/dice.html @@ -0,0 +1,34 @@ + + + + + Dicee + + + + + + +
+

Refresh Me

+ +
+

Player 1

+ +
+ +
+

Player 2

+ +
+ +
+ + + + + + + \ No newline at end of file diff --git a/dicegame/images/dice1.png b/dicegame/images/dice1.png new file mode 100644 index 0000000..543a9ee Binary files /dev/null and b/dicegame/images/dice1.png differ diff --git a/dicegame/images/dice2.png b/dicegame/images/dice2.png new file mode 100644 index 0000000..472bbac Binary files /dev/null and b/dicegame/images/dice2.png differ diff --git a/dicegame/images/dice3.png b/dicegame/images/dice3.png new file mode 100644 index 0000000..5bb30aa Binary files /dev/null and b/dicegame/images/dice3.png differ diff --git a/dicegame/images/dice4.png b/dicegame/images/dice4.png new file mode 100644 index 0000000..2c116a9 Binary files /dev/null and b/dicegame/images/dice4.png differ diff --git a/dicegame/images/dice5.png b/dicegame/images/dice5.png new file mode 100644 index 0000000..d566cd8 Binary files /dev/null and b/dicegame/images/dice5.png differ diff --git a/dicegame/images/dice6.png b/dicegame/images/dice6.png new file mode 100644 index 0000000..8b98b3c Binary files /dev/null and b/dicegame/images/dice6.png differ diff --git a/dicegame/images/m2.jpg b/dicegame/images/m2.jpg new file mode 100644 index 0000000..ccacf7f Binary files /dev/null and b/dicegame/images/m2.jpg differ diff --git a/dicegame/index2.js b/dicegame/index2.js new file mode 100644 index 0000000..eb11bab --- /dev/null +++ b/dicegame/index2.js @@ -0,0 +1,27 @@ + +var rn1 = Math.floor(Math.random()*6) + 1; +var randomdice = "dice" + rn1 + ".png"; + +var randomimage = "images/" + randomdice; + +var image1 = document.querySelectorAll("img")[0]; +image1.setAttribute("src",randomimage); + + +var rn2 = Math.floor(Math.random()*6) + 1; +var randomdice2 = "dice" + rn2 + ".png"; + +var randomimage2 = "images/" + randomdice2; + +var image2 = document.querySelectorAll("img")[1]; +image2.setAttribute("src",randomimage2); + +if(rn1>rn2){ + document.querySelector("h1").innerHTML = "player 1 wins" +} +else if(rn2>rn1){ + document.querySelector("h1").innerHTML = "player 2 wins" +} +else{ + document.querySelector("h1").innerHTML = "DRAW" +} \ No newline at end of file diff --git a/dicegame/styles.css b/dicegame/styles.css new file mode 100644 index 0000000..1ac7b63 --- /dev/null +++ b/dicegame/styles.css @@ -0,0 +1,41 @@ +.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; + + } \ No newline at end of file