Skip to content

Commit 302bdfd

Browse files
committed
fredag
1 parent 382fcb8 commit 302bdfd

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

starter/07-Omnifood-Desktop/css/queries.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ Insted, 1rem = 1em = 16px */
123123
/* MOBILE NAVIGATION */
124124
.btn-mobile-nav {
125125
display: block;
126+
z-index: 100;
126127
}
127128

128129
.main-nav {
129-
background-color: rgba(255, 255, 255, 0.95);
130+
background-color: rgba(255, 255, 255, 0.9);
130131
position: absolute;
131132
top: 0;
132133
left: 0;
@@ -148,7 +149,7 @@ Insted, 1rem = 1em = 16px */
148149
}
149150

150151
.nav-open .main-nav {
151-
z-index: 100;
152+
z-index: 20;
152153
opacity: 1;
153154
pointer-events: auto;
154155
visibility: visible;

starter/07-Omnifood-Desktop/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<link rel="stylesheet" href="css/general.css" />
88
<link rel="stylesheet" href="css/style.css" />
99
<link rel="stylesheet" href="css/queries.css" />
10+
11+
<script src="js/script.js" defer></script>
12+
1013
<title>Omnifood</title>
1114
</head>
1215
<body>
@@ -510,7 +513,9 @@ <h2 class="heading-secondary">Get your first meal for free!</h2>
510513
</li>
511514
</ul>
512515

513-
<p class="copyright">Copyright &copy; 2021 by Omnifood, Inc. All rights reserved</p>
516+
<p class="copyright">
517+
Copyright &copy; <span id="year">2027</span> by Omnifood, Inc. All rights reserved
518+
</p>
514519
</div>
515520

516521
<!-- Adress -->
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
///////////////////////////////////////////////////////////
2+
// Fixing flexbox gap property missing in some Safari versions
3+
function checkFlexGap() {
4+
var flex = document.createElement('div');
5+
flex.style.display = 'flex';
6+
flex.style.flexDirection = 'column';
7+
flex.style.rowGap = '1px';
8+
9+
flex.appendChild(document.createElement('div'));
10+
flex.appendChild(document.createElement('div'));
11+
12+
document.body.appendChild(flex);
13+
var isSupported = flex.scrollHeight === 1;
14+
flex.parentNode.removeChild(flex);
15+
console.log(isSupported);
16+
17+
if (!isSupported) document.body.classList.add('no-flexbox-gap');
18+
}
19+
checkFlexGap();
20+
21+
// https://unpkg.com/smoothscroll-polyfill@0.4.4/dist/smoothscroll.min.js
22+
23+
// get and set current year in footer copy right
24+
document.getElementById('year').textContent = new Date().getFullYear();
25+
26+
// Make mobile navigation work
27+
const btnNav = document.querySelector('.btn-mobile-nav');
28+
btnNav.addEventListener('click', () => {
29+
document.querySelector('.header').classList.toggle('nav-open');
30+
});

0 commit comments

Comments
 (0)