-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
89 lines (78 loc) · 3.62 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<title>Swahili Ipsum</title>
<meta charset="utf-8">
<meta name="google-site-verification" content="fCVJZmWLJj4_CJslYOulWhVx7xuiZpUUOujRi77Zd8I" />
<meta name="description" content="A 'lorem ipsum' type text generator that generates Swahili words">
<meta name="author" content="Bichwaa (Newton Musyani)">
<meta property="og:title" content="Swahili Ipsum" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://bichwaa.github.io/swahili-ipsum/" />
<meta property="og:image" content="images/logo.svg" />
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<script src="./scripts/sw.js"></script>
<script src="./scripts/generator.js"></script>
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="./style/normalize.css">
<link rel="stylesheet" href="./style/skeleton.css">
<link rel="stylesheet" href="./style/style.css">
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="images/logo.svg">
</head>
<body>
<nav>
<a href="#">
<img src="./images/icons8-github.svg" width="50px" height="50px" alt="github icon">
<span>GITHUB</span>
</a>
</nav>
<header class="centered-grid">
<img alt="Swahili Ipsum's logo" src="images/logo.svg" width="250" height="250">
<p>
Its like a Lorem Ipsum generator. But much cooler because it spews out Swahili words.
</p>
</header>
<section class="scaffold"></section>
<div class="form-container centered-grid">
<form id="form" class="centered-grid" action="#" method="POST">
<label for="words">How many words do you need?</label>
<br>
<input id="form-amount" type="number" name="words" value="500">
<br>
<input id="form-submit" type="submit" value="generate"></form>
</div>
<div class="text-container centered-grid">
<div class="boundary tooltip">
<img class="copy" alt="copy-icon" id="copy" src="images/copy.svg" width="35" heigh="35">
<span class="tooltiptext">copy</span>
<p class="text" id="text"> </p>
</div>
</div>
<script>
const copy = document.getElementById("copy");
const form = document.getElementById("form");
copy.addEventListener("click", () => {
if (navigator)
navigator.clipboard.writeText(document.querySelector("#text").innerText)
})
form.addEventListener("submit", (e)=>{
const text = document.getElementById("text");
e.preventDefault();
let amount = parseInt(document.getElementById("form-amount").value)
text.innerText = bunchWords(amount)
})
</script>
</body>
</html>