-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
153 lines (134 loc) · 3.99 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
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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Online Dictionary</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.container {
max-width: 600px;
margin: 2rem auto;
padding: 2rem;
background: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
flex: 1;
}
h1 {
text-align: center;
color: #2196F3;
margin-bottom: 2rem;
font-size: 2rem;
}
.search-form {
display: flex;
flex-direction: column;
gap: 1rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
label {
font-weight: 500;
color: #666;
}
input[type="text"] {
padding: 0.8rem;
border: 2px solid #e0e0e0;
border-radius: 6px;
font-size: 1rem;
transition: border-color 0.3s ease;
}
input[type="text"]:focus {
outline: none;
border-color: #2196F3;
}
input[type="submit"] {
background: #2196F3;
color: white;
border: none;
padding: 1rem;
border-radius: 6px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background: #1976D2;
}
footer {
text-align: center;
padding: 1.5rem;
background-color: #2196F3;
color: white;
margin-top: auto;
}
footer a {
color: white;
text-decoration: none;
border-bottom: 1px dotted white;
}
footer a:hover {
border-bottom: 1px solid white;
}
@media (max-width: 640px) {
.container {
margin: 1rem;
padding: 1rem;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Online Dictionary</h1>
<form class="search-form" action="/dict" method="get">
<div class="form-group">
<label for="query">Query:</label>
<input type="text" id="query" name="query" placeholder="Enter a word..." required autocomplete="off"/>
</div>
<div class="form-group">
<label for="engine">Engine:</label>
<input type="text" id="engine" name="engine" value="mdx" placeholder="mdx"/>
</div>
<input type="hidden" name="format" value="html" />
<input type="submit" value="Search"/>
</form>
</div>
<footer>
<p>This is an open-source project</p>
<p>Author: ChaosNyaruko</p>
<p><a href="https://github.com/ChaosNyaruko/ondict">GitHub Repository</a></p>
</footer>
<script>
// Focus the query input when page loads
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('query').focus();
});
// Simple form validation
document.querySelector('.search-form').addEventListener('submit', (e) => {
const query = document.getElementById('query').value.trim();
if (!query) {
e.preventDefault();
alert('Please enter a word to search');
}
});
</script>
</body>
</html>