-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget-demo.html
More file actions
114 lines (110 loc) · 3.79 KB
/
widget-demo.html
File metadata and controls
114 lines (110 loc) · 3.79 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
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KeepRule Widget Demo</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.header {
text-align: center;
padding: 60px 20px 40px;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
color: #fff;
}
.header h1 { font-size: 32px; margin-bottom: 12px; }
.header p { font-size: 16px; color: #a0a0c0; max-width: 600px; margin: 0 auto; }
.section { padding: 60px 20px; max-width: 700px; margin: 0 auto; }
.section h2 { font-size: 22px; margin-bottom: 8px; color: #333; }
.section p.desc { font-size: 14px; color: #666; margin-bottom: 24px; }
.dark-section {
background: #0d0d1a;
padding: 60px 20px;
}
.dark-section .inner { max-width: 700px; margin: 0 auto; }
.dark-section h2 { font-size: 22px; margin-bottom: 8px; color: #e0e0e0; }
.dark-section p.desc { font-size: 14px; color: #a0a0c0; margin-bottom: 24px; }
.code-block {
background: #f4f4f8;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 16px 20px;
font-family: "SF Mono", Monaco, Consolas, monospace;
font-size: 13px;
color: #333;
margin-top: 32px;
overflow-x: auto;
}
.dark-section .code-block {
background: #1a1a2e;
border-color: #2a2a4a;
color: #e0e0e0;
}
.footer {
text-align: center;
padding: 40px 20px;
color: #999;
font-size: 13px;
}
.footer a { color: #2563eb; text-decoration: none; }
</style>
</head>
<body>
<div class="header">
<h1>KeepRule Widget</h1>
<p>Add daily investment wisdom from Buffett, Munger, and other masters to any website with one line of code.</p>
</div>
<div class="section">
<h2>Light Theme</h2>
<p class="desc">The default theme, clean and minimal.</p>
<div id="keeprule-widget" data-theme="light"></div>
<div class="code-block">
<div id="keeprule-widget" data-theme="light"></div><br>
<script src="https://keeprule.com/widget.js"></script>
</div>
</div>
<div class="dark-section">
<div class="inner">
<h2>Dark Theme</h2>
<p class="desc">Perfect for dark-mode websites and dashboards.</p>
<div id="keeprule-widget-dark" data-theme="dark"></div>
<div class="code-block">
<div id="keeprule-widget" data-theme="dark"></div><br>
<script src="https://keeprule.com/widget.js"></script>
</div>
</div>
</div>
<div class="footer">
Built by <a href="https://keeprule.com" target="_blank">KeepRule</a> — AI-powered investment principles platform.
</div>
<script>
// Load light widget
(function() {
var s = document.createElement('script');
s.src = 'widget.js';
s.setAttribute('data-theme', 'light');
document.getElementById('keeprule-widget').parentElement.appendChild(s);
})();
</script>
<script>
// Load dark widget into the dark container
(function() {
var container = document.getElementById('keeprule-widget-dark');
// Temporarily override getElementById to target dark container
var origGet = document.getElementById.bind(document);
document.getElementById = function(id) {
if (id === 'keeprule-widget') return container;
return origGet(id);
};
var s = document.createElement('script');
s.src = 'widget.js';
s.setAttribute('data-theme', 'dark');
s.onload = function() {
document.getElementById = origGet;
};
container.parentElement.appendChild(s);
})();
</script>
</body>
</html>