-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (72 loc) · 1.87 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vanilla JavaScript Counter - Observer Pattern</title>
<style>
html {
background-color: #002244;
color: blanchedalmond;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
sans-serif;
}
body {
padding: 2rem;
font-size: 1.4rem;
}
form,
input,
button,
a {
font-size: 1.6rem;
}
a {
color: whitesmoke;
}
a:hover {
color: green;
}
.prose {
display: flex;
flex-direction: column;
gap: 1.4rem;
}
.text {
font-size: 1.8rem;
font-weight: bold;
color: #002244;
height: 8rem;
display: flex;
justify-content: center;
align-items: center;
background-color: orange;
border-radius: 12px;
}
button {
border-radius: 12px;
padding: 1rem;
}
</style>
</head>
<body>
<div class="prose">
<h1>Vanilla JavaScript Counter - Observer Pattern</h1>
<p>
The subscription, notification and un-subscription can happen inside the
scope of the click handler or in the global scope, depending on other
events, however take care of un-subscription on unmount / destroy, or
i.e. when navigating to another component / page.
</p>
<p class="text" id="count"></p>
<p><button id="increment">Increment Count</button></p>
<p>
<a target="_blank" href="https://jsfiddle.net/anrc9w3u/"
>https://jsfiddle.net/anrc9w3u/</a
>
</p>
</div>
</body>
<script src="index.js"></script>
</html>