Navigating through a diagonal path

Struggling to craft a diagonal navigation system similar to the images below. Despite its seemingly simplicity, I'm stuck investing too much time in figuring it out. My goal is for the menu container to smoothly reveal from right to left when clicking on the hamburger icon. The main challenges lie in handling the navbar change and ensuring a fluid animation for the menu container—is it best for the menu items to remain in place or slide as they appear?

To summarize my dilemmas:

  1. How can I achieve this design effectively?
  2. Is duplicating the navbar section necessary?
  3. What's the best way to reveal the underlying content?

Any guidance on this matter would be greatly appreciated.

Below is the code snippet I've experimented with:

.hamburger {
    z-index: 1001;
    position: absolute;
    right: 0;
    top: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    #hamburger {
        z-index: 1;
        position: relative;
        top: 18px;
        left: 25px;
    }
    .line {
        width: 24px;
        height: 2px;
        background-color: #fff;
        display: block;
        margin: 6px auto;
        position: relative;
        z-index: 2;
        transition: all 0.3s ease-in-out;
    }
    &:hover {
        cursor: pointer;
    }
    &:after {
        width: 180px;
        height: 180px;
        display: block;
      
        background: black;
        content: '';
        right: 0;
        top: 0;
        transform: rotate(45deg) translate(-50%, -63%);
    }
}

#hamburger.is-active .line {
    z-index: 1001;
  &:nth-child(2) {
    opacity: 0;
  }
  &:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  &:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

.nav_container {
    width: 200%;
    height: 100%;
    background: black;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    transform: skew(45deg);
    transition: opacity 300ms ease-in-out;
    opacity: 0;
}

.nav_container.is-open {
    display: block;
    opacity: 1;
}

.navigation-menu {
    background-color: transparent;
    pointer-events: none;
    min-height: 100%;
    position: absolute;
    width: 100%;
    // transform: translateX(150%);
    transform: skew(-45deg);

    > * {
        pointer-events: auto;
    }
  
    &--open {
        transform: translateX(0);
        
        & .navigation-menu__bars {
          background-color: transparent;
          
          &::before,
          &::after {
            top: 0;
          }
        
          &::before {
            transform: rotate(45deg);
          }
    
          &::after {
            transform: rotate(-45deg);
          }
        }
        
        .menu-list__item {
          opacity: 1;
        }
        
        $menu-delay: 1s;
        @for $i from 1 through 12 {
          .menu-list__item:nth-child(#{$i}) {
            transition-delay: $menu-delay;
          }
          $menu-delay: $menu-delay + .25s;
        }
    }
}
<div class="hamburger">
    <div id="hamburger"><span class="line"></span><span class="line"></span><span class="line"></span></div>
</div>
<div class="nav_container">
    <nav class="navigation-menu js-nav-menu">
        <div class="navbar__menu">
            <ul>
                <li class='title'><a href="">Home</a></li>
                <li><a href="">One</a></li>
                <li><a href="">Two</a></li>
            </ul>
            <ul>
                <li class='title'><a href="">Home</a></li>
                <li><a href="">One</a></li>
                <li><a href="">Two</a></li>
            </ul>
        </div>
    </nav>
</div>

My CSS is in SCSS format, so it might not compile but gives an idea of my progress. Any assistance would be highly valued.

Answer â„–1

Simply implement the CSS clip-path property and unlock endless styling possibilities. If you need guidance, refer to the Mozilla documentation, or try out this helpful clip path generator

Stay creative

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An error occurred with redirecting using jQuery Mobile's new method in version 1.5

Utilizing jQuery Mobile for its history state feature, I am looking to redirect users to another "page" using the jQuery method recommended in their latest documentation. p/s: I prefer the jQuery navigation method due to the hashchange/history support and ...

Heroku-hosted application experiencing issues with loading website content

I have been working on a nodejs application that serves a web page using express and also functions as a discord bot. The app runs smoothly on localhost with both the web page and discord functionalities working correctly. However, when I deploy it to Hero ...

Requesting data from a server using jQuery's AJAX functionality

Currently, I am utilizing the following piece of code for an ajax call: $('#filter').submit(function(){ var filter = $('#filter'); $.ajax({ url:filter.attr('action'), data:filter.serialize(), // form ...

Attempting to perform recursion on two functions simultaneously may result in one of the functions being undefined

There is a page on my site that clients tend to keep open for long periods of time without refreshing, sometimes over 24 hours. Some of the actions on this page require a valid PHP session, so I created a simple set of functions to check this every 10 minu ...

Transforming a vertical table into a horizontal layout

I'm facing an issue with transforming the database object for table display. My database contains a table structured like this. name total date Awoc1 100 9/14/2022 Awoc1 200 9/15/2022 Awoc1 300 9/16/2022 Awoc2 100 9/14/2022 Awoc2 ...

What are the steps to implement character movement in a 2D game using JavaScript?

I'm having trouble getting the image with the ID "yoshi" to move around in my 2D game document.onkeydown = (e) => { if (e.keyCode == 37) yoshi.style.left = yoshi.offsetLeft - 5 + "px"; else if (e.keyCode == 38) yoshi.style.top = yoshi.offset ...

Is there a way to retrieve the current logged in user when working with socket.io?

When it comes to retrieving the logged in user using passport.js in most of my routes, it's a breeze - just use req.user.username. However, I've encountered an issue with a page that relies solely on websockets. How can I determine the username o ...

Retrieve an element generated by a React script without using the ref attribute

There is a chat button on my website generated by a script (zendesk chat) that creates an iframe with the ID "launcher". I am using Nextjs and I am trying to access this element, but I am unable to attach a ref since I do not have the code. I have been sea ...

Instructions on how to implement a readmore button for texts that exceed a specific character length

I am attempting to display a "Read more" button if the length of a comment exceeds 80 characters. This is how I am checking it: <tr repeat.for="m of comments"> <td if.bind="showLess">${m.comment.length < 80 ? m.comment : ...

What's the best way to add line numbers to source code on an HTML webpage after parsing?

I am currently working with AngularJS and MongoDB. In my MongoDB data, there are some text elements that contain a \n, causing each line to be displayed on a new line based on the occurrence of \n. However, I also want to add line numbers to each ...

The image selection triggers the appearance of an icon

In my current project, I am working on implementing an icon that appears when selecting an image. The icon is currently positioned next to the beige image, but I am facing difficulties in making it disappear when no image is selected. Below are some image ...

Implementing PHP echo alerts using Javascript

My current task involves validating the IP address entered in a textbox using PHP. $('#check_ip').click(function() { var iptext = $('#Ip_Txt').val(); $.ajax({ type : "POST", url : "mypage.php", data : { iptext : ip ...

Create static HTML files using an Express server

Recently, I developed a nodejs web project using express-js and ejs. However, upon further reflection, it occurred to me that hosting it as static html files on Netlify might be more cost-effective than running it as a nodejs app on Heroku. Since the data ...

Zurb Foundation gem causing navigation errors

Typically, I rely on the Twitter Bootstrap Rails gem for my projects, but this time I decided to try out the Zurb Foundation gem. Following the installation instructions meticulously, I added the navigation code: <div class="row"> <div class="th ...

"Encountering issues when trying to retrieve a global variable in TypeScript

Currently facing an issue with my code. I declared the markers variable inside a class to make it global and accessible throughout the class. However, I am able to access markers inside initMap but encountering difficulties accessing it within the function ...

Assign the DatePicker Object to an HTML Element

I am currently using a SyncFusion date picker in my project and the implementation looks like this: var datepicker = null; $("#datepicker").hide(); $("#click").click(function(){ $("#datepicker").show(); datepicker = new ej.calendars.DatePi ...

Steps for checking if the specified row has been accurately filled out in a loop

Here is an example of how my JSON data is structured: { "main_object": { "id": "5", "getExerciseTitle": "TestFor", "language": "nl_NL", "application": "lettergrepen", "main_object": { "title": "TestFor", "language": "nl_NL", "exercises": [ { ...

Emphasize the interactions within the table cells based on their corresponding column and row

I'm looking to achieve a specific interaction in my Angular Material table. I want to highlight the table cell interactions with column and row by extending the highlighting up to the column header and left to the row header. Is this something that ca ...

Activate a specific component of hover effect within multiple components generated by the `v-for` loop

Hey there! I'm currently facing a CSS challenge related to Vue. Let's say I want to display multiple components using v-for, and I want to add a hover effect to each component individually. The goal is to have the hover effect only apply to the c ...

Explicitly employ undefined constants deliberately

So I am working on a project called WingStyle: https://github.com/IngwiePhoenix/WingStyle. It is still in the development phase, and I'm looking for ways to improve its functionality. One thing I want to address is the use of quotes. For example, whe ...