-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
74 lines (60 loc) · 1.59 KB
/
test.html
File metadata and controls
74 lines (60 loc) · 1.59 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>DotPipe Demo</title>
<style>
body { font-family: sans-serif; margin: 2em; }
.title { font-size: 1.5em; margin: 0.5em 0; }
.badge { display: inline-block; padding: 0.3em 0.6em; background: #eee; margin: 0.2em; border-radius: 4px; }
.highlight { background-color: yellow; }
.active { background-color: #0af; color: white; }
.card { border: 1px solid #ccc; padding: 1em; margin: 0.5em 0; }
</style>
<script src="dotpipe.js"></script>
<script>
document.addEventListener("DOMContentLoaded", async () => {
dotPipe.register(); // register all elements with 'inline'
console.log("DotPipe demo executed!");
});
</script>
</head>
<body>
<h1>DotPipe Demo</h1>
<!-- Titles -->
<div class="title"></div>
<div class="title"></div>
<div class="title"></div>
<!-- Badges -->
<div class="badge"></div>
<div class="badge"></div>
<div class="badge"></div>
<!-- Cards -->
<div class="card" id="card1">Card 1</div>
<div class="card" id="card2">Card 2</div>
<div class="card" id="card3">Card 3</div>
<div class="card" id="card4">Card 4</div>
<!-- Controls -->
<button id="incBtn" inline="
inc:$counter,4|
$counter
">+4</button>
<button id="decBtn" inline="
dec:$counter|
$counter
">-1</button>
<span id="counter">0</span>
<!-- Example inline macros -->
<div id="s1" inline="
|&msg:Hello DotPipe|
.title[0].text:!msg|
.title[1].text:World|
.title[2].text:!|
.badge[0].add:highlight|
.badge[1].text:!msg|
.badge[1].add:active|
.card[0:2].border:2px solid red|
.card[2:4].background:#f0f0f0|
">Body</div>
</body>
</html>