-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
129 lines (111 loc) · 2.84 KB
/
home.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
126
127
128
129
<!DOCTYPE html>
<html>
<head>
<title>Is It Spam?</title>
<script src="https://unpkg.com/[email protected]"></script>
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
background-color: #f5f5f5;
flex-direction: column;
padding: 2rem;
gap: 3rem;
}
h1 {
font-size: 2.5em;
color: #333;
}
p {
font-size: 1.2em;
color: #666;
}
form {
display: flex;
align-items: center;
}
input[type="text"] {
padding: 10px;
font-size: 1em;
width: 25vw;
border: 1px solid #ccc;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
input:focus {
outline: none;
}
button {
padding: 10px 20px;
font-size: 1em;
color: #fff;
background-color: #007bff;
border: 1px solid #007bff;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.loading-bar {
opacity: 0;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: linear-gradient(90deg, transparent,
#000, transparent,
#000, transparent
);
}
.htmx-request.loading-bar {
opacity: 1;
animation: fadeIn 2s linear forwards, slide 0.8s ease-in-out infinite;
}
@keyframes slide {
0% { transform: translateX(-100%); }
100% { transform: translateX( 100%); }
}
@keyframes fadeIn {
0% { opacity: 0; }
50% { opacity: 0; }
100% { opacity: 1; }
}
#summary {
max-width: 50vw;
background-color: #F8F8F8;
padding: 1rem;
border-radius: 10px;
}
#spam {
background-color: #ff5050;
}
#not-spam {
background-color: #40e27c;
}
</style>
</head>
<body hx-indicator=".loading-bar">
{{if eq .isSpam "true"}}
<h1 id="spam" style="font-size: 8rem;">LIKELY SPAM</h1>
{{else}} {{if eq .isSpam "false"}}
<h1 id="not-spam" style="font-size: 8rem;">NOT SPAM</h1>
{{else}}
<h1>Is It Spam?</h1>
{{end}}{{end}}
<form action="/lookup" method="post" hx-boost="true" hx-push-url="false">
<input type="text" id="number" name="number" placeholder="Enter a phone number">
<button>Lookup</button>
</form>
<div class="loading-bar"></div>
{{ if .sum }}
<p id="summary">{{ .sum }}</p>
{{- end}}
</body>
</html>