Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive Hamburger Menu #169

Closed
wants to merge 7 commits into from
Closed

Responsive Hamburger Menu #169

wants to merge 7 commits into from

Conversation

jorgeamadosoria
Copy link
Contributor

Cutoff for the hamburger menu is 768px. Could be smaller but the amount and size of the icons is too much at 768px to keep in one line.

The cutoff could be moved to 648 or smaller if necessary, if the icon sizes are changed for 768px. I like it as it is, but I'm not married to it.

A new menu.js file is introduced, to initialize the burger icon click. I think it's overkill, but that's the architecture, nothing to do about it.

The stylesheet is refactored to contain all the classes for a particular size together, order by size in descendent order. That way smaller resolution screens will overwrite bigger ones, as expected, and all classes for a particular resolution are lumped together.

A new media query is added, with min-width: 768px. This media query contains the hover and focus effects for the icons in the menu, which are not needed in the responsive menu since there are no icons there.

Several new CSS classes are introduced as well as new ids for menu elements.

@jorgeamadosoria jorgeamadosoria linked an issue Jan 9, 2022 that may be closed by this pull request
public/index.pug Outdated Show resolved Hide resolved
public/scripts/menu.js Outdated Show resolved Hide resolved
@mondeja mondeja added design Issues and Pull Requests regarding the visual design of the website enhancement New feature or request labels Jan 16, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@simple-icons simple-icons deleted a comment from mondeja Jan 22, 2022
@jorgeamadosoria jorgeamadosoria dismissed mondeja’s stale review February 28, 2022 06:37

All changes requested were put in

Copy link
Member

@mondeja mondeja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jorgeamadosoria. Are you still interested in this PR? I guess that the functionality relative to the input is currently broken.

rect(width='100', height='20')
rect(y='30', width='100', height='20')
rect(y='60', width='100', height='20')
input.hidden(type='checkbox')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is doing this input? It is not needed, I think 🤔

Comment on lines +59 to +60
#menu-Toggle
svg(viewBox='0 0 100 80', width='40', height='40')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We reallly need a wrapper container for the SVG? I think that the SVG can be the container itself. Also, the identifier breaks our style, it shouldn't be capitalized: menu-toggle.

Comment on lines +4 to +5
.addEventListener('click', (e) =>
domUtils.toggleClass(document.querySelector('#menu'), 'hidden-gt-768px'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event is not needed here.

-    .addEventListener('click', (e) =>
+    .addEventListener('click', () =>

Comment on lines +851 to +862
@media (hover: hover) {
.grid-item__link:hover {
opacity: 1;
text-decoration: underline;
}

.copy-button:not(:disabled):hover::before {
cursor: pointer;
display: block;
z-index: 1;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you've moved all the @media to the end? I think that this confuses more than clarifies.

Comment on lines +956 to +970
#menu-Toggle input {
display: block;
width: 40px;
height: 32px;
position: absolute;
top: -7px;
left: -5px;

cursor: pointer;

opacity: 0; /* hide this */
z-index: 2; /* and place it over the hamburger */

-webkit-touch-callout: none;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As before, I don't know that is this.

Comment on lines +990 to +1021
#menu-Toggle span:first-child {
transform-origin: 0% 0%;
}

#menu-Toggle span:nth-last-child(2) {
transform-origin: 0% 100%;
}

/*
* Transform all the slices of hamburger
* into a crossmark.
*/
#menu-Toggle input:checked ~ span {
opacity: 1;
transform: rotate(45deg) translate(-2px, -1px);
background: #232323;
}

/*
* But let's hide the middle one.
*/
#menu-Toggle input:checked ~ span:nth-last-child(3) {
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}

/*
* Ohyeah and the last one should go the other direction
*/
#menu-Toggle input:checked ~ span:nth-last-child(2) {
transform: rotate(-45deg) translate(0, -1px);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is doing nothing.

@mondeja
Copy link
Member

mondeja commented Apr 5, 2023

I'm closing this due to inactivity and very deep conflicts between branches.

@mondeja mondeja closed this Apr 5, 2023
@mondeja mondeja deleted the issue-144 branch April 5, 2023 12:21
@mondeja mondeja added the abandoned Pull requests that have been abandoned by the contributor label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned Pull requests that have been abandoned by the contributor design Issues and Pull Requests regarding the visual design of the website enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Burger icon for responsive menu
2 participants