-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard.html
More file actions
154 lines (142 loc) · 3.73 KB
/
Copy pathcard.html
File metadata and controls
154 lines (142 loc) · 3.73 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
/* ---- THEMING CONTRACT ----
Everything the CLI lets the user override lives here.
Your Rust code rewrites this :root block from the user's config;
the markup below never changes. */
:root {
/* colors */
--bg: {{ bg }};
--fg: {{ fg }};
--muted: {{ muted }};
--accent: {{ accent }};
--tag-bg: {{ tag_bg }};
--tag-fg: {{ tag_fg }};
--hairline: {{ hairline }};
--bg-image-overlay: {{ bg_image_overlay }};
/* type — user supplies families; sizes have sane defaults */
--font-title: {{ font_title }};
--font-body: {{ font_body }};
--title-size: {{ title_size }}px;
--site-size: {{ site_size }}px;
--text-size: {{ text_size }}px;
--meta-size: {{ meta_size }}px;
/* shape */
--radius: {{ radius }}px;
--pad: {{ pad }}px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: {{ width }}px; height: {{ height }}px; }
.card {
width: {{ width }}px;
height: {{ height }}px;
background: var(--bg);
color: var(--fg);
padding: var(--pad);
display: flex;
flex-direction: column;
justify-content: space-between; /* header pins top, footer pins bottom */
font-family: var(--font-body);
position: relative;
overflow: hidden;
}
{% if bg_image_data %}
.card::before {
content: "";
position: absolute;
inset: 0;
background:
linear-gradient(var(--bg-image-overlay), var(--bg-image-overlay)),
url("{{ bg_image_data }}");
background-size: cover;
background-position: center;
}
.card > * {
position: relative;
z-index: 1;
}
{% endif %}
/* ---- header: icon + site ---- */
.header {
display: flex;
align-items: center;
gap: 24px;
}
.avatar {
width: 84px;
height: 84px;
border-radius: var(--radius);
background: var(--accent);
color: var(--bg);
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-title);
font-weight: 700;
font-size: 44px;
flex-shrink: 0;
overflow: hidden; /* clips <img> to the rounded box */
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.site {
font-size: var(--site-size);
color: var(--muted);
font-weight: 500;
letter-spacing: 0.2px;
}
/* ---- body: title + text ---- */
.body { display: flex; flex-direction: column; gap: 22px; }
.title {
font-family: var(--font-title);
font-size: var(--title-size);
font-weight: 700;
line-height: 1.12;
letter-spacing: -0.5px;
}
.text {
font-size: var(--text-size);
line-height: 1.42;
color: var(--muted);
}
/* ---- footer: date + tags ---- */
.footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 28px;
border-top: 1px solid var(--hairline);
}
.date { font-size: var(--meta-size); color: var(--muted); }
.tags { display: flex; gap: 14px; }
.tag {
font-size: var(--meta-size);
color: var(--tag-fg);
background: var(--tag-bg);
padding: 10px 20px;
border-radius: 999px;
font-weight: 500;
}
</style>
</head>
<body>
<div class="card">
<div class="header">
<div class="avatar">{% if icon_data %}<img src="{{ icon_data }}">{% else %}{{ monogram }}{% endif %}</div>
<div class="site">{{ site }}</div>
</div>
<div class="body">
<div class="title">{{ title }}</div>
<div class="text">{{ text }}</div>
</div>
<div class="footer">
<div class="date">{{ date }}</div>
<div class="tags">
{% for t in tags %}<div class="tag">{{ t }}</div>{% endfor %}
</div>
</div>
</div>
</body>
</html>