Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Santhosh-Siddhardha authored May 5, 2024
1 parent 6d4d979 commit 4e76ebb
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added 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 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 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 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 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 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.
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!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>

<div class="dice">
<p>Player 1</p>
<img class="img1" src="" />
</div>

<div class="dice">
<p>Player 2</p>
<img class="img2" src="" />
</div>
</div>

<footer>www 🎲 App Brewery 🎲 com</footer>
<script src="./index.js" charset="utf-8"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var n1 = Math.floor(6*Math.random())+1;
var n2 = Math.floor(6*Math.random())+1;

if(n1>n2){
document.querySelector("h1").textContent="Player 1 wins!!";
}
else if(n2>n1){
document.querySelector("h1").textContent = "Player 2 wins!!";
}
else{
document.querySelector("h1").textContent = "Draw";
}

for(var i=1;i<=6;i++){
if(i==n1){
document.querySelector(".img1").src = "./images/dice"+i+".png";
}
if(i==n2){
document.querySelector(".img2").src = "./images/dice"+i+".png";
}
}
41 changes: 41 additions & 0 deletions 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 4e76ebb

Please sign in to comment.