Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Rotating Navigation</title>
    <link rel="stylesheet" href="style.css">
    
</head>
<body>

    <header>
        <div class="menu-trigger"><span class="close">+</span> <span>+</span></div>
    </header>

    <main class="container">
        <article>
            <h1>Amazing Article</h1>
            <h2 class="subheading">Florin Pop</h2>

            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium quia in ratione dolores cupiditate, maxime aliquid impedit dolorem nam dolor omnis atque fuga labore modi veritatis porro laborum minus, illo, maiores recusandae cumque ipsa quos. Tenetur, consequuntur mollitia labore pariatur sunt quia harum aut. Eum maxime dolorem provident natus veritatis molestiae cumque quod voluptates ab non, tempore cupiditate? Voluptatem, molestias culpa. Corrupti, laudantium iure aliquam rerum sint nam quas dolor dignissimos in error placeat quae temporibus minus optio eum soluta cupiditate! Cupiditate saepe voluptates laudantium. Ducimus consequuntur perferendis consequatur nobis exercitationem molestias fugiat commodi omnis. Asperiores quia tenetur nemo ipsa.</p>

            <h3>My Dog</h3>

            <img src="https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80" />

            <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Sit libero deleniti rerum quo, incidunt vel consequatur culpa ullam. Magnam facere earum unde harum. Ea culpa veritatis magnam at aliquid. Perferendis totam placeat molestias illo laudantium? Minus id minima doloribus dolorum fugit deserunt qui vero voluptas, ut quia cum amet temporibus veniam ad ea ab perspiciatis, enim accusamus asperiores explicabo provident. Voluptates sint, neque fuga cum illum, tempore autem maxime similique laborum odio, magnam esse. Aperiam?</p>
        </article>

        <aside>
            <nav>
                <ul>
                    <li>Home</li>
                    <li>About</li>
                    <li>Contact</li>
                </ul>
            </nav>
        </aside>
    </main>

    <script src="script.js"></script>
</body>
</html>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: rgba(0, 0, 0, 0.9);
    letter-spacing: 1.5;
    line-height: 1.5;
    background-color: #666;
    overflow-x: hidden;
}

h1, h2, h3 {
    margin: 0;
}

.container {
    width: 100vw;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform .5s ease-in;
    padding: 0px 60px;
}

.container.rotated{
    transform: translate(200px, -300px) rotate(-20deg);
}

.container aside {
    position: absolute;
    left: -150px;
    top: 300px;

    transform: rotate(20deg) scale(0.9);

    color: white;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.container aside ul {
    list-style: none;
}

.container aside ul li{
    cursor: pointer;
}

article {
    padding: 80px 0px 160px;
    max-width: 960px;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

.subheading {
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(0, 0, 0, 0.7);
}

article img {
    max-width: 100%;
    margin: 16px 0;
    background-color: white;
}

header {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background-color: #ff7979;

    position: absolute;
    top: -120px;
    left: -120px;

    z-index: 2;

    transition: transform .5s ease-in;
}

header.rotated {
    transform: rotate(-90deg);
}

header .menu-trigger {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0 20px 40px;
}

header .menu-trigger span{
    cursor: pointer;
    color: white;
    font-size:  3rem;
}

.close {
    transform: rotate(45deg);
}

              
            
!

JS

              
                !(function () {
  "use strict";

  function onMenuTriggerClick() {
    let container = document.querySelector(".container");

    let header = document.querySelector("header");

    let isOpen = container.classList.contains("rotated");

    if (isOpen) {
      container.classList.remove("rotated");
      header.classList.remove("rotated");
    } else {
      container.classList.add("rotated");
      header.classList.add("rotated");
    }
  }

  let menuTrigger = document.querySelector(".menu-trigger");
  menuTrigger.addEventListener("click", onMenuTriggerClick);
})();

              
            
!
999px

Console