-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.html
95 lines (77 loc) · 3.6 KB
/
project.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Insult Generator</title>
<link href="project.css" rel="stylesheet">
<div class = "menu">
<section class='title'> <!--The Title Section pretty much-->
<h2>
WELCOME TO:
</h2>
<p>
<h1>
THE INSULT GENERATOR
</h1>
</p>
<H5 class = 'mode'> <a href="shakesperian.html">
SHAKESPERIAN MODE =>
</a>
</h5>
<hr class = "top-line">
</section>
<section class="insults"> <!-- The insult Gen Section/ Where the insults are written-->
<form id="numInputForm"> <!-- Form to input the number of insults wanted -->
<h3 class = 'numInput'>Input the number of Insults to generate: <input required type="number" class = number min='1' max='20' id="numberIn" placeholder="Enter a number" value="10">
<input type="button" value="Submit" id="enterButton">
</form>
<section class="numScript"> <!--The Script that I'm not really sure is useful so I just commented out cause they failed-->
<!-- <script id="numScript">
// for (let i = 0; i == numberInputted; i++){
// getAdjective() //function that fetches the insult
// }
//var numberInputted = document.getElementById("numberIn");
//console.log(numberInputted.value)
/*for (let i = 0; i == numberInputted; i++){
getAdjective() //function that fetches the insult
}*/
/*const delay = (ms = 1000) => new Promise(r => setTimeout(r, ms));
const getDataSeries = async items => {
let results = [];
for (let index = 0; index < numberInputted; index++) {
await delay();
const res = await fetch(items[index]);
results.push({ name: res.name, data: res.data });
}
return results;
}; */
</script> -->
</section>
<!--Button to submit number of insults wanted-->
<!--<button id = "enterButton" type = submit form=numInputForm onclick=getElementById(numScript)>Enter!</button></h3>-->
<p>
<h2>You are:<br><span id='insult'></span></h2> <!-- prints insult with template -->
</p>
<p id="showInputHere"></p> <!-- Enter Key presses Button -->
<script>
var input = document.getElementById("numberIn");
// Execute a function when the user presses a key on the keyboard
input.addEventListener("keypress", function(event) {
// If the user presses the "Enter" key on the keyboard
if (event.key === "Enter") {
// Cancel the default action, if needed
event.preventDefault();
// Trigger the button element with a click
document.getElementById("enterButton").click();
}
});
</script> <!--Enter button submits form Script-->
<p></p>
<!--<h2>Insults: <span id='insult'></span></h2>-->
</section>
</div>
<script src="js/script.js"></script> <!-- Fetches the insult-->
</head>
</html>