Hangman gam
How do I make an hangman gam?
What is a hangman gam? How do you make a hangman gam? This script and codes were developed by Taha on 28 August 2022, Sunday.
Hangman gam - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>hangman gam</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <button class="click">new word</button>
<br>
<div class="section">
</div> <div class="letters"> <a>a</a><a>b</a><a>c</a><a>d</a><a>e</a><a>f</a><a>g</a> <a>h</a><a>i</a><a>j</a><a>k</a><a>l</a><a>m</a><a>n</a> <a>o</a><a>p</a><a>q</a><a>r</a><a>s</a><a>t</a><a>u</a> <a>v</a><a>w</a><a>x</a><a>y</a><a>z</a> </div>
<h1>yo</h1> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Hangman gam - Script Codes CSS Codes
.lines p {margin:0; opacity:0;}
button { bordeR:none; background:#eee; border-radius:5px; padding:1%; cursor:pointer;}
.click {float:left;}
.reset{float:right; position:fixed; right:100px;}
.lines{display:inline-block; border-bottom:3px solid crimson; margin:10px 10px; padding:2.5px 12px; background:#eee; font-size:1.5em;}
.letters
{ margin-top:50px;}
.letters a {margin:0 5px; background:rgba(0,0,0,0.7); padding:5px 10px;
color:white; border-radius:5px; font-size:1.5em; line-height:2;
cursor:pointer;}
.letters a:hover {background:crimson;}
.display h4 {opacity:0.5}
.lines .visible { opacity:1;
}
h1 { color:red;
}
Hangman gam - Script Codes JS Codes
var words = ["helicopter","selection","alphabet","raccoon","missippi"];
var wordDisplayed = 0;
/*var letterIndex = 0;
var letterSelected = 0;*/
$("button").click(function(){ var wordDisplayed = newWord();
});
function newWord(){ wordDisplayed = 0; $(".display").remove(); // remove previous word $(".letters a").css("opacity","1"); // display all letters to guess from var x = Math.floor((Math.random() * words.length)); //select a random number that will be index from array to selct word var randomWord = words[x]; $(".section").append("<div class='display'><h4> "+words.splice(x,1)[0]+" </h4></div>"); // display word on screen var splitWord = randomWord.split(""); //split the word into letters for ( var i = 0; i < randomWord.length; i++ ) // display letters on the screen { $(".display").append("<div class='lines'><p>"+splitWord[i]+"</p></div>"); } wordDisplayed = splitWord; return wordDisplayed;
} // end of newWord function
$(".letters a").click(function(){ var thisTag = $(this); thisTag.css("opacity","0"); guessWord(thisTag);
});
function guessWord(thisTag) { var letterSelected = thisTag.html(); var letterIndex = $.inArray(letterSelected,wordDisplayed); if ( letterIndex > -1) { for (var i = 0; i < wordDisplayed.length; i++) { if (wordDisplayed[i] == letterSelected) { $(".lines p").eq(i).addClass("visible"); } } }
}
Developer | Taha |
Username | tkazi |
Uploaded | August 28, 2022 |
Rating | 3 |
Size | 2,611 Kb |
Views | 46,552 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Wordsearch | 2,667 Kb |
Spotify api | 1,505 Kb |
Fluid containers | 1,992 Kb |
Topics with pictures | 2,091 Kb |
Youtube_api | 1,563 Kb |
Tie | 2,453 Kb |
Vogel.photo | 2,399 Kb |
A Pen by taha | 2,844 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Masonry | Uriuriuriu | 5,005 Kb |
Fellowship of the Ring | Aussieyang | 2,639 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
Break Out | AzazelN28 | 12,431 Kb |
Price Comparison Table | Orrinward | 3,459 Kb |
Sassy Buttons | Elyseholladay | 2,299 Kb |
Responsive Minimal Blog Layout | Hackthevoid | 5,261 Kb |
Experiment - SCSS SVG Background Image with Variables | See8ch | 3,270 Kb |
A Pen by Dalton Liu | Liudalton | 12,437 Kb |
We Simplify animation | Meodai | 48,169 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!