Skip to content

Commit c3f7c5f

Browse files
authored
[website] Fixed navbar, added mobile menu, prevent codebox from going off screen on mobile / smaller screens. (#328)
* Update index.html Signed-off-by: abhiram v <106994329+abhiramtx@users.noreply.github.com> * Update style.css Signed-off-by: abhiram v <106994329+abhiramtx@users.noreply.github.com> --------- Signed-off-by: abhiram v <106994329+abhiramtx@users.noreply.github.com>
1 parent 4d82cbf commit c3f7c5f

File tree

2 files changed

+82
-4
lines changed

2 files changed

+82
-4
lines changed

website/source/css/style.css

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
@media (max-width: 768px) {
1+
2+
3+
@media only screen and (max-width: 800px) {
24
.nav-buttons {
35
display: none; /* Hides the navigation buttons */
46
}
7+
#menu-button {
8+
display: block!important;
9+
}
10+
.nav-buttons {
11+
display: none!important; /* Hides the navigation buttons */
12+
}
513

614
/* You can also hide the logo if needed */
715
.logo {
8-
display: none; /* Hides the logo */
16+
display: block; /* Hides the logo */
17+
}
18+
19+
.logo img {
20+
width: 100px!important;
921
}
1022

1123
/* Stack columns in section 1 */
@@ -19,19 +31,31 @@
1931
width: 80%; /* Make image responsive */
2032
margin-bottom: 20px; /* Add some space below the image */
2133
}
34+
35+
.expand-box {
36+
width: 90%!important;
37+
}
2238
}
2339

2440
/* General Reset */
2541
* {
2642
margin: 0;
2743
padding: 0;
2844
box-sizing: border-box;
45+
/* overflow-x: hidden; */
46+
}
47+
48+
#menu-button {
49+
background-color: rgba(107, 0, 0, 0);
50+
color: white;
51+
border: none;
2952
}
3053

3154
body {
3255
font-family: 'IBM Plex Sans', sans-serif;
3356
background-color: #121212;
3457
color: #ffffff;
58+
overflow-x: hidden;
3559
}
3660

3761
/* Sticky Header */
@@ -44,8 +68,9 @@ header {
4468
border-bottom: 1px solid #333;
4569
position: sticky;
4670
top: 0;
47-
z-index: 1000;
71+
z-index: 10000000000000000000000000000000000000;
4872
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25); /* Added shadow for the header */
73+
height: 65px;
4974
}
5075

5176
.logo-section {
@@ -467,4 +492,20 @@ a {
467492
font-size: 14px; /* Font size for author */
468493
color: #aaa; /* Slightly lighter color for author */
469494
margin: 0;
470-
}
495+
}
496+
497+
.menu {
498+
top: 65px;
499+
position: absolute;
500+
width: 100vw;
501+
height: 100vh;
502+
background-color: rgba(0, 0, 0, 0.767);
503+
backdrop-filter: blur(10px);
504+
margin: 0;
505+
left: 0;
506+
display: flex;
507+
flex-direction: column;
508+
align-items: center;
509+
justify-content: center;
510+
gap: 10%;
511+
}

website/source/index.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,42 @@ <h1 style="font-family: 'Fira Code', monospace; cursor: pointer;" onclick="scrol
2828
<i data-feather="download" class="icon"></i> Install
2929
</button>
3030
</div>
31+
32+
<button onclick="openorclose();" class=" filled-btn" id="menu-button" style="display: none">
33+
<i data-feather="more-vertical" class="icon"></i>
34+
</button>
35+
36+
<div class="menu" style="display: none" id="menu">
37+
<button onclick="openwin('https://github.com/TimMcCool/scratchattach/wiki/Documentation', '_blank');" class="">
38+
</i>Documentation
39+
</button>
40+
<button onclick="openwin('https://github.com/TimMcCool/scratchattach/', '_blank');" class="">
41+
<i data-feather="github" class="icon"></i> Source
42+
</button>
43+
<button onclick="scrollToSection('installation');" class="filled-btn">
44+
<i data-feather="download" class="icon"></i> Install
45+
</button>
46+
</div>
3147
</header>
48+
49+
<script>
50+
let open = 0;
51+
function openorclose() {
52+
if (open === 0) {
53+
document.getElementById('menu').style = "display: flex;";
54+
open = 1;
55+
} else {
56+
document.getElementById('menu').style = "display: none;";
57+
open = 0;
58+
}
59+
}
60+
61+
function openwin(win, target) {
62+
window.open(win, target);
63+
}
64+
</script>
65+
66+
3267
<div class="background-container">
3368
<div class="background-image"></div> <!-- New div for the background image -->
3469
<section class="section-1" id="intro">
@@ -242,6 +277,8 @@ <h2 style="padding-top:20px">Community Projects</h2>
242277
const section = document.getElementById(sectionId);
243278
const elementPosition = section.getBoundingClientRect().top + window.scrollY; // Add current scroll position
244279
window.scrollTo({ behavior: 'smooth', top: elementPosition-75});
280+
document.getElementById('menu').style = "display: none;";
281+
open = 0;
245282
}
246283

247284
</script>

0 commit comments

Comments
 (0)