-
Notifications
You must be signed in to change notification settings - Fork 1
/
binary_search.html
180 lines (168 loc) · 7.25 KB
/
binary_search.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./assest/css/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
<style>
.array-container {
display: flex;
align-items:center;
text-align: center;
overflow: auto;
margin: auto;
}
.array-element {
padding: 10px 20px;
margin: 5px;
background-color: #FF8364;
color: black;
border-radius: 5px;
font-weight: bold;
opacity: 1;
}
.element_found {
background-color: #5F6CAF;
font-size: 40px;
color: white;
transform: scale(1.2);
}
.highlight {
background-color: greenyellow;
transform: scale(1.2);
}
.low {
background-color: orchid;
}
.high {
background-color: orchid;
}
.hidden {
opacity: 0.4;
}
.info-container {
margin-top: 20px;
}
</style>
</head>
<body style="background-color: #E1F7F5;">
<!-- ***** Header Start ***** -->
<header id="header_section" class="mb-0" style="background-color: #1E0342;">
<div class="conatiner-fluid border-bottom border-warning" >
<div class="container">
<nav class="navbar" style="background-color: #1E0342;">
<div class="container-fluid">
<a href="index.html"> <img class="img-fluid" style="width: 80px;" src="./assest/image/idea_logo_first.gif" alt=""> </a>
<button class="navbar-toggler" style="background-color: white;" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight"
aria-controls="offcanvasRight" aria-expanded="false" aria-label="Toggle navigation">
<span style="color: white;" class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</div>
</div>
</header>
<!-- ***** Header End ***** -->
<div class="container-fluid">
<div class="container_new">
<div class="row mt-2">
<div class="col-lg-3 d-none d-lg-block" id="sidebar_section">
<div class="overflow-auto pt-3 mt-3 pb-3" id="inside_sidebar_section">
<div class="d-flex flex-column flex-md-row ">
<div id="radio-buttons-container" class="list-group list-group-radio d-grid gap-2 border-0">
</div>
</div>
</div>
</div>
<div class="col-lg-9" id="playground_section">
<div class="card mt-3" id="playground_card">
<!-- Title of DSA and Algorith & small Desp -->
<div class="card-header" style="background-color: #0E46A3;color:white;">
<div class="row">
<div class="col">
<h5 class="mt-2" id="algo_title">Visualizer</h5>
</div>
<div class="col text-end d-none d-lg-block">
<button class="btn text-end" is_full="0" id="maximize_area"><span class="material-symbols-outlined">
fullscreen
</span></button>
</div>
</div>
</div>
<!-- Title of DSA and Algorith & small Desp -->
<div class="card-body" id="visualizer_play_ground" style="overflow: auto;">
<div class="" style="width: 100%;height: 350px;box-sizing: border-box;">
<span class="text-center" style="display: block;" id="span_in_binary_search"></span>
<div class="array-container" id="arrayContainer" style="height: 150px;box-sizing: border-box;"></div>
<div id="info" class="info-container">
</div>
<div id="message" class="text-center mt-4 mb-4">
</div>
</div>
</div>
<div class="card-footer">
<form id="inputForm" class="form-inline justify-content-center">
<div class="row">
<div class="col-12 mb-2">
<div class="row">
<div class="col-md-2">
<label for="">Speed</label>
<input type="range" class="form-range" value="15" min="1" max="30" id="algo_sppeed">
</div>
</div>
</div>
<div class="col-md-6 mb-2">
<div class="input-group">
<input type="text" id="arrayInput" class="form-control" placeholder="Array (comma separated)" required>
<button class="btn btn-warning" type="button" id="random_array_generate">Random Arr</button>
</div>
</div>
<div class="col-6 col-md-3">
<input type="text" id="targetInput" class="form-control mb-2 mr-sm-2" placeholder="Target Value" required>
</div>
<div class="col-6 col-md-3">
<button type="submit" style="width: 100%;" class="btn btn-primary mb-2" >Start Search</button>
</div>
</div>
</form>
</div>
</div>
<!-- About DSA & Algorithm -->
<div class="card mt-3" id="info_section">
<div class="card-body" id="output"></div>
</div>
<!-- About DSA & Algorithm -->
</div>
</div>
</div>
</div>
<!-- **** sidebar on mobile Start **** -->
<div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel" style="background-color: wheat;">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasRightLabel">Explore More Algorithms!</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="d-flex flex-column flex-md-row align-items-center justify-content-center">
<div id="radio-buttons-container2" class="list-group list-group-radio d-grid gap-2 border-0">
</div>
</div>
</div>
</div>
<!-- **** sidebar on mobile End **** -->
</body>
<script src="./algorithm/binary_search.js"></script>
<!--Common JS Scripts -->
<script src="./assest/js/common.js"></script>
<script src="./assest/js/algo_list.js"></script>
<script src="./assest/js/sidebar.js"></script>
<script src="./assest/js/Algo_content.js"></script>
</html>