-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.html
More file actions
101 lines (92 loc) · 2.89 KB
/
Copy pathwidget.html
File metadata and controls
101 lines (92 loc) · 2.89 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>simplelikes — demo</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
max-width: 480px;
margin: 0 auto;
padding: 2rem 1rem;
color: #333;
}
h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
p { color: #666; margin-bottom: 2rem; }
.demo-row {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem;
border: 1px solid #eee;
border-radius: 8px;
margin-bottom: 1rem;
}
.demo-row label { font-size: 0.85rem; color: #999; min-width: 80px; }
pre {
background: #f5f5f5;
padding: 1rem;
border-radius: 6px;
overflow-x: auto;
font-size: 0.85rem;
}
.sl-btn.liked { color: #e74c3c; }
</style>
</head>
<body>
<h1>simplelikes</h1>
<p>Drop-in anonymous likes for your static site.</p>
<div class="demo-row">
<label>Post 1:</label>
<simple-likes slug="demo-post-1" type="artigos"></simple-likes>
</div>
<div class="demo-row">
<label>Post 2:</label>
<simple-likes slug="demo-post-2"></simple-likes>
</div>
<div class="demo-row">
<label>Note:</label>
<simple-likes slug="demo-note" type="notas"></simple-likes>
</div>
<h2>Custom text examples</h2>
<div class="demo-row">
<label>Português:</label>
<simple-likes slug="demo-pt" type="artigos" text="coração" text-plural="corações"></simple-likes>
</div>
<div class="demo-row">
<label>Stars:</label>
<simple-likes slug="demo-stars" text="star" text-plural="stars"></simple-likes>
</div>
<div class="demo-row">
<label>Claps:</label>
<simple-likes slug="demo-claps" type="notas" text="clap"></simple-likes>
</div>
<p><em>Global config (<code>window.__simpleLikesConfig</code>) is set below — tags without inline attributes use "star"/"stars". Inline attributes win over the global config.</em></p>
<h2>Usage</h2>
<pre><!-- Inline (takes precedence) -->
<simple-likes slug="artigo-1" type="artigos" text="coração" text-plural="corações"></simple-likes>
<simple-likes slug="nota-1" type="notas" text="clap"></simple-likes>
<!-- Global config (fallback for tags without inline attributes) -->
<script>
window.__simpleLikesConfig = {
apiUrl: "https://likes.yourdomain.com",
type: "artigos",
text: "star",
"text-plural": "stars",
};
</script>
<script src="dist/simplelikes.js"></script></pre>
<h2>Styling</h2>
<pre>.sl-btn.liked { color: #e74c3c; }
simple-likes { margin: 0 4px; }</pre>
<script>
window.__simpleLikesConfig = {
apiUrl: "http://localhost:8787",
text: "star",
"text-plural": "stars",
};
</script>
<script src="simplelikes.js"></script>
</body>
</html>