-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ejs
155 lines (145 loc) · 4.44 KB
/
index.ejs
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
155
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<title>Henry 的海底撈黑海會員之路</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Henry 距離海底撈黑海會員還需要多少積分呢?">
<link rel="stylesheet" href="tocas.min.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap" rel="stylesheet">
<style>
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?6smp2p');
src: url('fonts/icomoon.eot?6smp2p#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?6smp2p') format('truetype'),
url('fonts/icomoon.woff?6smp2p') format('woff'),
url('fonts/icomoon.svg?6smp2p#icomoon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoon' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-trophy:before {
content: "\e900";
}
.icon-check-circle:before {
content: "\e901";
}
.progress-levels {
text-align: right;
line-height: 1rem;
}
.progress-levels .column {
padding-top: .5rem;
}
.progress-levels small {
display: block;
text-align: right;
font-size: .7rem;
color: var(--ts-gray-500);
}
.ts-header small {
font-size: 70%;
color: var(--ts-gray-500);
padding-left: 1rem;
}
.icon-trophy {
position: absolute;
bottom: -1rem;
right: -1rem;
font-size: 6rem;
z-index: 0;
opacity: .1;
overflow: hidden;
}
th:nth-child(2), th:nth-child(3), th:nth-child(4),
td:nth-child(2), td:nth-child(3), td:nth-child(4) {
text-align: right;
}
.number {
font-family: "Roboto", serif;
font-optical-sizing: auto;
font-weight: 400;
font-style: normal;
font-variation-settings: "wdth" 100;
letter-spacing: .1em;
}
td .number:nth-child(2) {
display: inline-block;
min-width: 3em;
}
</style>
</head>
<body>
<div class="ts-container is-narrow has-vertically-padded-large">
<div class="ts-wrap is-vertical has-vertically-spaced-large is-relaxed">
<h1 class="ts-header is-big is-center-aligned">Henry 的海底撈黑海會員之路</h1>
<div>
<div class="ts-progress">
<div class="bar" style="--value: <%= totalPoint / target * 100 %>">
<div class="text number"><%= totalPoint.toLocaleString() %></div>
</div>
</div>
<div class="ts-grid progress-levels">
<% levels.forEach((level, index) => { %>
<div class="column <%= index === levels.length - 1 ? 'is-fluid' : '' %>" <% if (index !== levels.length - 1) { %> style="width: <%= (level.addPoint / target) * 100 %>%" <% } %>>
<%= level.name %>
<small>
<span class="number"><%= level.point.toLocaleString() %></span>
<% if (level.point <= totalPoint) { %> <span class="icon-check-circle"></span> <% } %>
</small>
</div>
<% }) %>
</div>
</div>
<div class="ts-box" <% if (totalPoint >= target) { %>style="display: none;"<% } %>>
<div class="ts-content">
<div class="ts-text is-label has-bottom-spaced-small">距離黑海會員還需要</div>
<div class="ts-header is-large"><span class="number"><%= (target - totalPoint).toLocaleString() %></span> 積分
<small class="number">( $ <%= ((target - totalPoint) * 5).toLocaleString() %> )</small>
</div>
</div>
<span class="icon-trophy"></span>
</div>
<div class="ts-box">
<table class="ts-table is-small">
<thead>
<tr>
<th>日期</th>
<th>花費金額</th>
<th>獲得積分</th>
<th>累積積分</th>
</tr>
</thead>
<tbody>
<% logs.forEach(log => { %>
<tr>
<td class="number"><%= log.day %></td>
<td>
<span class="number">$</span>
<span class="number"><%= (log.point * 5).toLocaleString() %></span>
</td>
<td><span class="number"><%= log.point.toLocaleString() %></span></td>
<td><span class="number"><%= log.totalPoint.toLocaleString() %></span></td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>