Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                 <button class="hamburger">
      <span class="hamburger_bar"></span>
      <span class="hamburger_bar"></span>
      <span class="hamburger_bar"></span>
 </button>
              
            
!

CSS

              
                button {
    background: none;       /* 背景色をリセット */
    color: inherit;         /* 親要素から色を継承 */
    border: none;           /* ボーダーを削除 */
    padding: 0;             /* パディングをリセット */
    margin: 0;              /* マージンをリセット */
    font: inherit;          /* 親要素からフォントスタイルを継承 */
    line-height: normal;    /* 行の高さを通常に設定 */
    cursor: pointer;        /* カーソルをポインターに設定 */
    text-align: center;     /* テキストを中央揃えに設定 */
    user-select: none;      /* テキスト選択を無効化 */
    -webkit-appearance: none;  /* Webkitブラウザでのデフォルトスタイルを削除 */
    -moz-appearance: none;     /* Mozillaブラウザでのデフォルトスタイルを削除 */
    appearance: none;          /* 標準的な外観を削除 */
}
.hamburger {
    width: 40px;
    height: 24px;
    position: absolute;
    top: 15px;
    right: 16px;
    z-index: 100;
    background: transparent;
}

.hamburger_bar {
    display: block;
    width: 100%;
    height: 2px;
    position: absolute;
    left: 0;
    background: #15355b;
    transition:
        top 0.24s,
        transform 0.24s,
        opacity 0.24s;
}

.hamburger_bar:nth-child(1) {
    top: 0;
}

.hamburger_bar:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger_bar:nth-child(3) {
    top: 100%;
    transform: translateY(-100%);
}

.hamburger.active .hamburger_bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(135deg);
}

.hamburger.active .hamburger_bar:nth-child(2) {
    transform: translate(50%, -50%);
    opacity: 0;
}

.hamburger.active .hamburger_bar:nth-child(3) {
    top: 50%;
    transform: translateY(-50%) rotate(-135deg);
}
              
            
!

JS

              
                import $ from "https://esm.sh/jquery";
$(".hamburger").on("click", function () {
  // ハンバーガーメニューを開く
  $(this).toggleClass("active");
});

              
            
!
999px

Console