thecodercoder / fem-easybank Goto Github PK
View Code? Open in Web Editor NEWEasybank landing page from Frontend Mentor
Easybank landing page from Frontend Mentor
I have added a dark theme feature for the same project.
Check it out here: https://easybank-landing-page-abhishekgmv.vercel.app/
What
The burger mobile menu doesn't close on pressing escape key
Why
Edge case is not handled either in JS or CSS code
Fix
JavaScript code to close the modal
document.addEventListener("keyup", (event) => {
if (event.keyCode === 27 && header.classList.contains("open")) {
header.classList.remove("open");
body.classList.remove("noscroll");
fadeElems.forEach(function (element) {
element.classList.remove("fade-in");
element.classList.add("fade-out");
});
}
});
Also
Moving the code to close the modal into a function to maintain DRY
const closeModal = () => {
header.classList.remove("open");
body.classList.remove("noscroll");
fadeElems.forEach(function (element) {
element.classList.remove("fade-in");
element.classList.add("fade-out");
});
};
document.addEventListener("keyup", (event) => {
if (event.keyCode == 27 && header.classList.contains("open")) {
closeModal();
}
});
Hey Jessica,
I just visited the website and in my opinion I think that the title in the cards seem to be a bit too small. Apart from this everything else seems to be great visually.
Kindly make the necessary changes
Cheers
<footer class="footer"> <div class="container"> <a class="footer__logo" href="#"> <img src="/images/logo-dark.svg" /> </a>
we haven't a logo-dark.svg
in images file unfortunately. did you see?
The burger menu is still open after resizing the window to large displays. I have this suggestion to scripts.js
const btnHamburger = document.querySelector('#btnHamburger');
const body = document.querySelector('body');
const header = document.querySelector('.header');
const fadeElements = document.querySelectorAll('.has-fade');
const closeHamburgerMenu = () => {
body.classList.remove('no-scroll');
header.classList.remove('open');
fadeElements.forEach(function (element) {
element.classList.remove('fade-in');
element.classList.add('fade-out');
});
};
const openHamburgerMenu = () => {
body.classList.add('no-scroll');
header.classList.add('open');
fadeElements.forEach(function (element) {
element.classList.remove('fade-out');
element.classList.add('fade-in');
});
};
const handleResizeWindow = () => {
if (window.innerWidth > 1023) {
closeHamburgerMenu();
}
};
btnHamburger.addEventListener('click', function () {
if (header.classList.contains('open')) {
closeHamburgerMenu();
} else {
openHamburgerMenu();
}
});
window.onresize = handleResizeWindow;
Dear @thecodercoder you wrote to description of the video, "you can write that snippet
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/dist",
"savePathSegmentKeys": null,
"savePathReplaceSegmentsWith": null
}
],
but I get Property savePathSegmentKeys is not allowed.
Property savePathReplaceSegmentsWith is not allowed.
What can I do for dismiss these errors?
thanks for the responding to this issue from now on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.