-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (48 loc) · 1.74 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Password Generator</title>
<link rel="stylesheet" href="./assets/css/reset.css" />
</head>
<body>
<!-- Dynamic CSS-->
<!-- Acceptance criteria: This app will run in the browser and will feature dynamically updated HTML and CSS powered by JavaScript code that you write. -->
<!-- reference used: https://css-tricks.com/forums/topic/load-random-css-on-page-load/#post-247699 -->
<script>
(function () {
var sheet = document.createElement("link"); // create link in the document
sheet.rel = "stylesheet"; // link will be of the type sylesheet
sheet.href =
"./assets/css/style-" + (Math.floor(Math.random() * 3) + 1) + ".css"; // 3 options of css
console.log("Style used: " + sheet.href);
document.getElementsByTagName("head")[0].appendChild(sheet); // we append the link into our head element
})();
</script>
<div class="wrapper">
<header>
<h1>( Secret Salad Generator )</h1>
</header>
<div class="card">
<div class="card-header">
<h2>Generate your salad 🤫</h2>
<br />
</div>
<div class="card-body">
<textarea
readonly
id="password"
placeholder="Your Secure Password"
aria-label="Generated Password"
></textarea>
</div>
<div class="card-footer">
<button id="generate" class="btn">Generate</button>
</div>
</div>
</div>
<script src="./assets/js/script.js"></script>
</body>
</html>