Skip to content

Commit 0796125

Browse files
committed
Add settings menu in html
1 parent bbff1dd commit 0796125

File tree

3 files changed

+54
-4
lines changed

3 files changed

+54
-4
lines changed

InteractiveHtmlBom/ibom.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,43 @@ mark.highlight {
218218
padding: 2px;
219219
border-radius: 6px;
220220
}
221+
222+
.menubtn {
223+
background-color: white;
224+
font-size: 16px;
225+
border: none;
226+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 20 20'%3E%3Cpath fill='none' d='M0 0h20v20H0V0z'/%3E%3Cpath d='M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z'/%3E%3C/svg%3E%0A");
227+
background-position: center;
228+
background-repeat: no-repeat;
229+
}
230+
231+
.menu {
232+
position: relative;
233+
display: inline-block;
234+
}
235+
236+
.menu-content {
237+
display: none;
238+
position: absolute;
239+
background-color: white;
240+
right: 0;
241+
min-width: 300px;
242+
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
243+
z-index: 100;
244+
padding: 8px;
245+
}
246+
247+
.menu:hover .menu-content {
248+
display: block;
249+
}
250+
251+
.menu:hover .menubtn {
252+
background-color: #eee;
253+
}
254+
255+
.checkbox-label {
256+
display: inline-block;
257+
padding: 8px;
258+
border: 1px solid #ccc;
259+
width: calc(100% - 18px);
260+
}

InteractiveHtmlBom/ibom.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@
3030

3131
<body>
3232
<div id="topmostdiv" style="width: 100%; height: 100%">
33-
<div id="top" class="split" style="height: 80px; border-bottom: 2px solid black;">
33+
<div id="top" style="height: 80px; border-bottom: 2px solid black;">
3434
<div style="float: right;">
35-
<div class="hideonprint" style="float: right; margin: 10px; position: relative; top: 20px">
36-
<input id="silkscreenCheckbox" type="checkbox" name="silkscreen" value="silkscreen" checked
37-
onchange="silkscreenVisible(this.checked)">Silkscreen
35+
<div class="hideonprint menu" style="float: right; margin: 10px; top: 8px;">
36+
<button class="menubtn"></button>
37+
<div class="menu-content">
38+
<label class="checkbox-label">
39+
<input id="silkscreenCheckbox" type="checkbox" name="silkscreen"
40+
value="silkscreen" checked onchange="silkscreenVisible(this.checked)">
41+
Show silkscreen
42+
</label>
43+
</div>
3844
</div>
3945
<div class="button-container hideonprint"
4046
style="float: right; margin: 10px; position: relative; top: 8px">

icons/baseline-settings-20px.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)