-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ejs
130 lines (123 loc) · 3.58 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
<!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" />
<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;
}
</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"><%= 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>
<%= level.point.toLocaleString() %>
<% 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"><%= (target - totalPoint).toLocaleString() %> 積分
<small>( $ <%= ((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><%= log.day %></td>
<td>$ <%= (log.point * 5).toLocaleString() %></td>
<td><%= log.point.toLocaleString() %></td>
<td><%= log.totalPoint.toLocaleString() %></td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>