Skip to content

Commit aa6a104

Browse files
authored
Merge pull request #324 from abhiramtx/main
[website] fixed navbar and added a new mobile menu. also fixed the codeboxes going off screen in the getting started section.
2 parents 76224b7 + ba79288 commit aa6a104

File tree

2 files changed

+80
-6
lines changed

2 files changed

+80
-6
lines changed

website/source/css/style.css

Lines changed: 40 additions & 3 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 */
@@ -26,12 +38,20 @@
2638
margin: 0;
2739
padding: 0;
2840
box-sizing: border-box;
41+
/* overflow-x: hidden; */
42+
}
43+
44+
#menu-button {
45+
background-color: rgba(107, 0, 0, 0);
46+
color: white;
47+
border: none;
2948
}
3049

3150
body {
3251
font-family: 'IBM Plex Sans', sans-serif;
3352
background-color: #121212;
3453
color: #ffffff;
54+
overflow-x: hidden;
3555
}
3656

3757
/* Sticky Header */
@@ -44,8 +64,9 @@ header {
4464
border-bottom: 1px solid #333;
4565
position: sticky;
4666
top: 0;
47-
z-index: 1000;
67+
z-index: 10000000000000000000000000000000000000;
4868
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25); /* Added shadow for the header */
69+
height: 6vh;
4970
}
5071

5172
.logo-section {
@@ -467,4 +488,20 @@ a {
467488
font-size: 14px; /* Font size for author */
468489
color: #aaa; /* Slightly lighter color for author */
469490
margin: 0;
491+
}
492+
493+
.menu {
494+
top: 6vh;
495+
position: absolute;
496+
width: 100vw;
497+
height: 100vh;
498+
background-color: rgba(0, 0, 0, 0.767);
499+
backdrop-filter: blur(10px);
500+
margin: 0;
501+
left: 0;
502+
display: flex;
503+
flex-direction: column;
504+
align-items: center;
505+
justify-content: center;
506+
gap: 10%;
470507
}

website/source/index.html

Lines changed: 40 additions & 3 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">
@@ -171,19 +206,19 @@ <h3>... and more!</h3>
171206
<div class="content">
172207
<h2 style="padding-top:20px">Getting started</h2>
173208
<p style="margin-bottom:20px">Log in with your Scratch account:</p>
174-
<div class="expand-box" data-width="700px" id="logInCmd">
209+
<div class="expand-box" data-width="90%" id="logInCmd">
175210
<p id="expandText0" data-text="import scratchattach as sa" margin="0"></p>
176211
<p id="expandText1" data-text="session = sa.login('username', 'password')" margin="0"></p>
177212
</div>
178213
<p style="margin-bottom:20px">Set and get cloud variables anytime:</p>
179-
<div class="expand-box" data-width="700px" id="cloudCmd">
214+
<div class="expand-box" data-width="90%" id="cloudCmd">
180215
<p id="expandText0" data-text="cloud = session.connect_cloud('project_id')"></p>
181216
<p id="expandText1" data-text=""></p>
182217
<p id="expandText2" data-text="cloud.set_var('variable', 'value')"></p>
183218
<p id="expandText3" data-text="cloud.get_var('variable')"></p>
184219
</div>
185220
<p style="margin-bottom:20px">Follow users, love their projects and comment:</p>
186-
<div class="expand-box" data-width="700px" id="siteCmd">
221+
<div class="expand-box" data-width="90%" id="siteCmd">
187222
<p id="expandText0" data-text="user = session.connect_user('username')"></p>
188223
<p id="expandText1" data-text="user.follow()"></p>
189224
<p id="expandText2" data-text=""></p>
@@ -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)