forked from parag477/Amazing-Webdev-Components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_button.html
101 lines (89 loc) · 2.3 KB
/
search_button.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search Box</title>
<style>
/* Your root variables */
:root {
--background-light: lightgray;
--background-dark: #222;
--text-light: black;
--text-dark: white;
}
body {
background-color: var(--background-light);
color: var(--text-light);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
transition: background-color 0.3s, color 0.3s;
}
body.dark-theme {
background-color: var(--background-dark);
color: var(--text-dark);
}
.search-box {
background: var(--background-light);
width: 350px;
border-radius: 20px;
display: flex;
align-items: center;
padding: 0 15px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
border: 3px solid var(--text-light);
}
.search-box img {
width: 18px;
}
.search-box input {
width: calc(100% - 24px);
background: transparent;
padding: 10px;
outline: none;
border: 0;
color: var(--text-dark);
}
.nav-left {
display: flex;
align-items: center;
}
.nav-left ul li {
list-style: none;
display: inline-block;
}
</style>
</head>
<body>
<div class="toggle-button">
<button onclick="toggleTheme()">Toggle Theme</button>
</div>
<nav>
<div class="search-box">
<img src="images/search.png" alt="" />
<input type="text" placeholder="search" />
</div>
</nav>
<div class="nav-left">
<ul>
<li><img src="images/notification.png" alt="" /></li>
<li><img src="images/inbox.png" alt="" /></li>
<li><img src="images/video.png" alt="" /></li>
</ul>
</div>
<div class="container">
<div class="left-sidebar"></div>
<div class="main-content"></div>
<div class="right-sidebar"></div>
</div>
<script>
function toggleTheme() {
const body = document.body;
body.classList.toggle("dark-theme");
}
</script>
</body>
</html>