Skip to content

Commit a381250

Browse files
committed
add search box for search ip
1 parent e2efec4 commit a381250

File tree

1 file changed

+71
-62
lines changed

1 file changed

+71
-62
lines changed

server/templates/home.html

Lines changed: 71 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>whatismyip</title>
77
<link rel="icon" href="{{ url_for('logo') }}" type="image/x-icon">
8-
98
<style>
109
body {
1110
background-color: #121212;
@@ -20,112 +19,122 @@
2019
min-height: 100vh;
2120
text-align: center;
2221
}
23-
2422
h1 {
2523
color: #1db954;
2624
margin-bottom: 20px;
2725
font-size: 2rem;
2826
}
29-
3027
.info-card {
31-
background-color: #1e1e1e;
32-
border: 1px solid #333;
33-
border-radius: 8px;
28+
background: linear-gradient(135deg, #1e1e1e, #292929);
29+
border-radius: 12px;
3430
padding: 20px;
3531
width: 90%;
3632
max-width: 600px;
37-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
38-
text-align: center;
33+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
34+
margin-bottom: 20px;
35+
text-align: left;
3936
}
40-
4137
.info-item {
4238
margin-bottom: 15px;
4339
font-size: 1rem;
40+
padding: 10px;
41+
border-bottom: 1px solid #333;
42+
}
43+
.info-item:last-child {
44+
border-bottom: none;
4445
}
45-
4646
.info-item span {
4747
font-weight: bold;
4848
color: #1db954;
4949
}
50-
50+
.input-container {
51+
display: flex;
52+
gap: 12px;
53+
width: 85%;
54+
max-width: 550px;
55+
align-items: center;
56+
justify-content: space-between;
57+
}
58+
input {
59+
padding: 12px;
60+
border-radius: 8px;
61+
border: none;
62+
background-color: #1e1e1e;
63+
color: #ffffff;
64+
outline: none;
65+
font-size: 1rem;
66+
text-align: center;
67+
flex-grow: 1;
68+
}
69+
input::placeholder {
70+
color: #888;
71+
}
72+
button {
73+
padding: 12px;
74+
border: none;
75+
border-radius: 8px;
76+
background: linear-gradient(135deg, #1db954, #17a74a);
77+
color: white;
78+
font-size: 1rem;
79+
cursor: pointer;
80+
flex-shrink: 0;
81+
min-width: 120px;
82+
}
83+
button:hover {
84+
background: linear-gradient(135deg, #17a74a, #1db954);
85+
}
5186
footer {
5287
margin-top: 20px;
5388
font-size: 0.9rem;
5489
color: #777;
5590
}
56-
5791
footer a {
5892
text-decoration: none;
59-
}
60-
61-
footer a:first-of-type {
6293
color: #c5c5c5;
6394
}
64-
65-
footer a:last-of-type {
66-
color: #1db954;
67-
}
68-
69-
footer a:hover {
70-
text-decoration: underline;
71-
}
72-
73-
@media (min-width: 1024px) {
95+
@media (max-width: 480px) {
7496
body {
7597
padding: 20px;
7698
}
77-
7899
h1 {
79-
font-size: 2.5rem;
80-
}
81-
82-
.info-card {
83-
padding: 30px;
84-
max-width: 400px;
85-
}
86-
87-
.info-item {
88-
font-size: 1.2rem;
89-
}
90-
91-
footer {
92-
font-size: 1rem;
100+
font-size: 1.5rem;
93101
}
94-
}
95-
96-
@media (max-width: 480px) {
97102
.info-card {
98-
padding: 10px;
103+
padding: 15px;
104+
width: 90%;
105+
border-radius: 15px;
106+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
99107
}
100-
101108
.info-item {
102109
font-size: 0.9rem;
110+
padding: 8px;
103111
}
104-
105-
h1 {
106-
font-size: 1.5rem;
112+
.input-container {
113+
flex-direction: column;
114+
gap: 8px;
115+
width: 100%;
116+
}
117+
input, button {
118+
width: 90%;
119+
font-size: 1rem;
107120
}
108121
}
109122
</style>
110123
</head>
111124
<body>
112-
<h1>Your Information</h1>
125+
<h1>WHAT IS MY IP</h1>
113126
<div class="info-card">
114-
<div class="info-item">
115-
<span>IP Address:</span> <span id="ip">{{ip}}</span>
116-
</div>
117-
<div class="info-item">
118-
<span>Country:</span> <span id="location">{{country}}</span>
119-
</div>
120-
<div class="info-item">
121-
<span>City:</span> <span id="isp">{{city}}</span>
122-
</div>
123-
<div class="info-item">
124-
<span>ISP:</span> <span id="browser">{{isp}}</span>
125-
</div>
127+
<form action="{{ url_for('whatismyip') }}" method="POST" class="input-container">
128+
<input type="text" name="ip" placeholder="Enter IP Address">
129+
<button type="submit">Check</button>
130+
</form>
131+
<div class="info-item"><span>IP Address:</span> <span id="ip">{{ip}}</span></div>
132+
<div class="info-item"><span>Country:</span> <span id="location">{{country}}</span></div>
133+
<div class="info-item"><span>City:</span> <span id="city">{{city}}</span></div>
134+
<div class="info-item"><span>ISP:</span> <span id="isp">{{isp}}</span></div>
126135
</div>
127136
<footer>
128-
Made with ❤️ By <a href="https://github.com/mateo-rfz">Mateo</a> | <a href="https://github.com/mateo-rfz/whatismyip">Learn More</a>
137+
Made with ❤️ By <a href="https://github.com/mateo-rfz">Mateo</a>
129138
</footer>
130139
</body>
131140
</html>

0 commit comments

Comments
 (0)