forked from yegor256/colorizejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
41 lines (39 loc) · 854 Bytes
/
example.html
File metadata and controls
41 lines (39 loc) · 854 Bytes
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
<!-- Copyright (c) 2018 Yegor Bugayenko -->
<!-- SPDX-License-Identifier: MIT -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>ColorizeJS Example</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="./src/colorizejs.js"></script>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}
.red {
color: red;
}
.green {
color: green;
}
#foo {
font-size: 48px;
font-weight: bold;
}
p {
color: #444;
}
</style>
</head>
<body>
<p>
A minimal example showing how the plugin colors a number based on rules:
</p>
<div id="foo">350</div>
<script>
$("#foo").colorize({ 500: ".green", 0: ".red" });
</script>
</body>
</html>