Skip to content

Commit

Permalink
Merge pull request FirmanKurniawan#234 from hiranmayee1123/main
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
FirmanKurniawan authored Oct 24, 2022
2 parents b88b96b + 2678753 commit 9d18350
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 0 deletions.
36 changes: 36 additions & 0 deletions dice-master/dicee.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Dicee</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Indie+Flower|Lobster" rel="stylesheet">

</head>
<body>

<div class="container">
<h1>Refresh Me</h1>
<p>&#128522</p>
<div class="dice">
<p>Player 1</p>
<img class="img1" src="images/dice6.png">
</div>

<div class="dice">
<p>Player 2</p>
<img class="img2" src="images/dice6.png">
</div>

</div>
<script src="index.js">

</script>

</body>

<footer>
www 🎲Fun Games 🎲 com
</footer>
</html>
1 change: 1 addition & 0 deletions dice-master/images/dice1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dice-master/images/dice2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dice-master/images/dice3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dice-master/images/dice4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dice-master/images/dice5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dice-master/images/dice6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions dice-master/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// alert("Welcome, Lets begin!");

var n1=Math.floor(Math.random()*6)+1; //ranges from 1-6

var image1="dice" + n1 + ".png"; //all 6 images show up

var folder1="images/" + image1;

var i1=document.querySelectorAll("img")[0];

i1.setAttribute("src",folder1); //changes first image on refreshing

var n2=Math.floor(Math.random()*6)+1;

var image2="dice" + n2 + ".png";

var folder2="images/" + image2;

var i2=document.querySelectorAll("img")[1];

i2.setAttribute("src",folder2); //changes second image on refreshing


if(n1>n2)
{
document.querySelector("h1").innerHTML="Player 1 wins!";
}

else if(n2>n1)
{

document.querySelector("h1").innerHTML="Player 2 wins!";
}
else
{
document.querySelector("h1").innerHTML="Tie!";
}
41 changes: 41 additions & 0 deletions dice-master/styles.css
Original file line number Diff line number Diff line change
@@ -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;

}

0 comments on commit 9d18350

Please sign in to comment.