/
index.html
125 lines (123 loc) · 3.6 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Daily Beauty 表特日報</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>
if (origin === 'https://www.daily-beauty.xyz') {
window.location.replace('https://daily-beauty.xyz')
}
</script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap-grid.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
body {
margin: 0;
}
hr {
border-top: 1px solid #bfbfbf;
}
#content {
text-align: center;
color: #444444;
padding: 20px 25px;
}
#preview {
background-color: #6cd7e5;
text-align: center;
padding: 50px 0;
}
#preview > img {
width: 100%;
max-width: 360px;
}
.title {
font-size: 40px;
font-family: Georgia, Times, 'Times New Roman', serif;
line-height: 55px;
margin: 22px 0;
}
.description {
padding: 10px 0 20px;
}
.description > p {
font-family: 'Montserrat Light', 'Helvetica Neue', Helvetica, sans-serif;
letter-spacing: 0.05em;
font-size: 22px;
margin: 15px 0;
}
.subscribe > input {
outline: none;
font-size: 18px;
padding: 7px 4px;
width: calc(100% - 50px);
max-width: 300px;
border: 1px solid #bfbfbf;
}
.subscribe > .button {
width: 50px;
color: white;
background-color: #6cd7e5;
border-radius: 5px;
cursor: pointer;
margin-left: 3px;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-7" id="content">
<h1 class="title">
Daily Beauty <br />
表特日報
</h1>
<hr />
<div class="description">
<p>Daily Beauty 就跟它的名字一樣,是一個有關表特的日報</p>
<p>每晚十一點會自動蒐集 PTT 表特版前三名送到你的信箱</p>
<p>這些都是經過鄉民篩選的,可以說是群眾智慧的展現</p>
<p>想要的話就快點訂閱吧~~~</p>
</div>
<div class="subscribe d-flex justify-content-center">
<input name="email" type="email" placeholder="請輸入你的信箱" />
<div
class="button d-flex justify-content-center align-items-center"
>
訂閱
</div>
</div>
</div>
<div class="col-md-5" id="preview">
<img src="https://i.imgur.com/V5NSWlS.png" />
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/validator/10.9.0/validator.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script>
<script>
$('.subscribe > .button').click(function() {
let $input = $('.subscribe > input')
let email = $input.val()
if (!validator.isEmail(email)) {
alert('信箱格式錯誤')
return
}
axios
.post('/api/subscribe', { email: email })
.then(function(res) {
alert(email + ' 訂閱成功')
$input.val('')
})
.catch(function(err) {
alert('訂閱失敗')
})
})
</script>
</body>
</html>