Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dice game #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Dice game Js
Dice game developed using basic js
SudhanshuJCodes authored Oct 8, 2021
commit 76707cbfe65cd48be89b6d412d9e404f73ca9478
38 changes: 38 additions & 0 deletions Dice Game in JavaScript/Dicee Challenge/dicee.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!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">
<button style="display: block"> <a style="text-decoration: none;" href="http://127.0.0.1:5500/dicee.html "><h1 style="align-items: center;">Refresh Me </h1>></a></button>

<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 🎲 App Brewery 🎲 com
</footer>

</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Dice Game in JavaScript/Dicee Challenge/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let randomnumber1 = Math.floor(Math.random() * 6) + 1;
let randomdice = "images/" + "dice" + randomnumber1 + ".png";
let image1 = document.querySelectorAll("img")[0];
image1.setAttribute("src",randomdice);
let image2 = document.querySelectorAll("img")[1];
image2.setAttribute("src",randomdice);
41 changes: 41 additions & 0 deletions Dice Game in JavaScript/Dicee Challenge/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;

}