-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
105 lines (90 loc) · 3.11 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=480px, initial-scale=1.0">
<title>Frogress Bar</title>
<!-- Primary Meta Tags -->
<meta name="title" content="Frogress Bar">
<meta name="description" content="Frogress Bar is a HTML/Svelte component to make progress bars with Frogs inside. 🐸">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://frogress.ml/">
<meta property="og:title" content="Frogress Bar">
<meta property="og:description" content="Frogress Bar is a HTML/Svelte component to make progress bars with Frogs inside. 🐸">
<meta property="og:image" content="https://frogress.ml/frogress-preview.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://frogress.ml/">
<meta property="twitter:title" content="Frogress Bar">
<meta property="twitter:description" content="Frogress Bar is a HTML/Svelte component to make progress bars with Frogs inside. 🐸">
<meta property="twitter:image" content="https://frogress.ml/frogress-preview.png">
<script>
const q = s => document.querySelector(s);
let update = () => {
let value = q("#input").value
if (value === "") value = 0
q("#frogressbar").style = `--progress: ${value}%;`
}
</script>
<style>
input {
margin: 10px;
width: 48px;
}
body {
height: 100%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
height: 100%;
margin: 0;
font-family: sans-serif;
}
h4 {
font-family: monospace;
padding: 0 69px;
text-align: center;
}
:root {
height: 100%;
}
</style>
</head>
<body>
<h1>Frogress Bar</h1>
<!-- Frogress bar HTML start -->
<style>
#frogressbar {
background-color: #fff;
border-radius: 999px;
border: 3px solid #000;
padding: 2px;
width: 150px;
height: 20px;
}
#frogressbar div {
border-radius: 999px;
background: url(FROG.jpg);
background-size: cover;
height: 20px;
background-position-x: right;
transition: width 250ms ease-in-out;
width: calc(var(--progress) + (150px - var(--progress)) / 150 * 20);
}
</style>
<div id="frogressbar" style="--progress: 50%">
<div></div>
</div>
<!-- Frogress bar HTML end -->
<div>
<input id="input" type="number" min="0" max="100" value="50" step="10" oninput="update()">%
</div>
<h4>
For the source code and HTML & Svelte components, go to the
<a href="https://github.com/lxhom/frogress/">GitHub repository</a>
</h4>
</body>
</html>