Skip to content

Commit ed30988

Browse files
committed
opacify the background when the columnar menu is showed
1 parent 72b87d6 commit ed30988

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

css/navbar.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
position: absolute;
6767
margin-top: 0;
6868
padding-left: 0;
69-
height: 50vh;
69+
height: 40vh;
7070
background-color: rgb(38, 26, 50);
7171
width: 100%;
7272
z-index: 2;
73-
top: -50vh;
73+
top: -40vh;
7474
transition: all 0.3s ease-in;
7575

7676
}

css/styles.css

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ body {
1313
margin: 0;
1414
}
1515

16-
/* elements */
16+
main {
17+
transition: all 0.8s ease-in;
18+
}
19+
1720
p {
1821
color: var(--default-font-color);
1922
font-family: var(--default-font-family);
@@ -25,9 +28,6 @@ p {
2528
h1,
2629
h2,
2730
h3 {
28-
/* for guide */
29-
/* border: solid 3px aqua; */
30-
3131
font-family: 'Raleway', sans-serif !important;
3232
}
3333

@@ -45,6 +45,9 @@ section {
4545

4646
}
4747

48+
.opacity-effect {
49+
filter: opacity(20%) grayscale(70%);
50+
}
4851

4952

5053
article {
@@ -228,9 +231,11 @@ i {
228231
.navbar {
229232
display: none !important;
230233
}
234+
231235
.navbar-compressed {
232236
display: block !important;
233237
}
238+
234239
section,
235240
footer {
236241
width: 83%;
@@ -245,12 +250,15 @@ i {
245250
:root {
246251
font-size: 10px;
247252
}
253+
248254
.navbar {
249-
display: none !important ;
255+
display: none !important;
250256
}
257+
251258
.navbar-compressed {
252259
display: block !important;
253260
}
261+
254262
p {
255263
max-width: 90%;
256264
}

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
</ul>
7373
</nav>
7474
</header>
75+
<main>
7576
<section>
7677
<div class="presentation centered-article">
7778
<h1 id="presentation-title">Hi, I am <br class='br-show'>Carlos Jorge!</h1>
@@ -155,8 +156,8 @@ <h1 class="subtitle contacts-item">Contact</h1>
155156
</p>
156157
</div>
157158
</div>
158-
159159
</footer>
160+
</main>
160161
</body>
161162

162163
</html>

index.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@ document.addEventListener("DOMContentLoaded", function (event) {
2121
const navColumnarMenu = document.getElementById('nav-columnar-menu');
2222
if (navColumnarMenu.classList.contains('active')) {
2323
navColumnarMenu.classList.remove("active");
24+
document.getElementsByTagName("main")[0].classList.remove('opacity-effect')
2425
}
2526
else if(element.id==='show-nav-columnar-menu'){
2627
navColumnarMenu.classList.add("active");
28+
document.getElementsByTagName("main")[0].classList.add('opacity-effect')
2729
}
2830

2931
})
3032
}
3133
)
32-
// Your code to run since DOM is loaded and ready
33-
})
34-
// ([...document.getElementsByTagName('a')]).forEach(
35-
// // (a)=>{
36-
37-
// // }
38-
// // (element=>{
39-
// // element.addEventListener('click',function(){
40-
// // console.log('aaaaaaaaa')
41-
// // })
42-
// // })
43-
// )
34+
})

0 commit comments

Comments
 (0)