123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!DOCTYPE html>
<html lang="ja">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="https://cdn.rawgit.com/balzss/luxbar/ae5835e2/build/luxbar.min.css">
  <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
  <script src="https://www.webopixel.net/lab/sample/14/0710jq-morp/jquery.morphing.min.js"></script>
  <title>bird</title>
</head>

<body>
  <!--   headerタグ内はluxbarのコードのみ配置 -->
  <header id="luxbar" class="luxbar-fixed">
    <input type="checkbox" class="luxbar-checkbox" id="luxbar-checkbox" />
    <div class="luxbar-menu luxbar-menu-reight luxbar-menu-material-cyan">
      <ul class="luxbar-navigation">
        <li class="luxbar-header">
          <label class="luxbar-hamburger luxbar-hamburger-doublespin" id="luxbar-hamburger" for="luxbar-checkbox"> <span></span> </label>
        </li>
        <li class="luxbar-item"><a href="#">TOP</a></li>
        <li class="luxbar-item"><a href="#s-1">GOODS</a></li>
        <li class="luxbar-item"><a href="#s-2">SHOP</a></li>
        <li class="luxbar-item"><a href="#s-3">DROWING</a></li>
      </ul>
    </div>
  </header><!--   header=luxbarの閉じ -->
  <img class="main_visual" src="http://interplan.link/179/sample_img/bird_main.jpg" alt="">
  <div class="scroll">scroll_button</div>
  <section id="s-1">
    <div class="wrapper">
      <h1>GOODS</h1>
      <div class="fl">
        <div class="text">テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト等も沢山揃ってます</div>
        <a class="button" href="#">詳しく見る</a>
      </div>
      <div class="js-morphing">
        <img src="http://interplan.link/179/sample_img/water1.jpg" alt="" width="300" height="300">
      </div>
    </div>
  </section>
  <section id="s-2">
    <div class="wrapper">
      <h1>SHOP</h1>
      <div class="fl">
        <div class="text">テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト</div>
        <a class="button" href="#">詳しく見る</a>
      </div>
      <div class="js-morphing">
        <img src="http://interplan.link/179/sample_img/water2.jpg" alt="" width="300" height="300">
      </div>
    </div>
  </section>
  <section id="s-3">
    <div class="wrapper">
      <h1>DROWING</h1>
      <div class="fl">
        <div class="text">テストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテストテスト</div>
        <a class="button" href="#">詳しく見る</a>
      </div>
      <div class="js-morphing">
        <img src="http://interplan.link/179/sample_img/water3.jpg" alt="" width="300" height="300">
      </div>
    </div>
  </section>
</body>

</html>

            
          
!
            
              * {
  margin: 0;
  padding: 0;
}
.main_visual {
  width: 100%;
  margin-top: 58px;
}
.scroll {
  text-align: center;
}
section {
  text-align: center;
  padding-bottom: 32px;
}
#s-1 {
  background-color: #fcc800;
}
h1 {
  /* レスポンシブ時luxbarのメニューが邪魔なため多めに余白 */
  padding-top: 74px;
}
.text {
  text-align: left;
  margin: 32px 10px;
}
.button { /* ボタン装飾 */
  display: inline-block;
  padding: .5em 2.5em;
  margin-bottom: 32px;
  border: 3px solid #fff;
  border-radius: .4em 2em .5em 3em/3em .5em 2em .5em;
  text-decoration: none;
  color: #fff;
  text-align: center;
  -webkit-transition: .3s ease-in-oput;
  transition: .3s ease-in-out;
}
.button:hover { /* ボタンアニメーション */
  -webkit-transition: bounce 2s ease-in-out;
  animation: bounce 2s ease-in-out;
}
@-webkit-keyframes bounce {
  /* ボタンアニメーション_ベンダープレフィックス付き */
  0% {
    transform: scale(0.8, 0.8);
  }
  5% {
    transform: scale(1.2, 1.2);
  }
  10% {
    transform: scale(1, 1);
  }
  15% {
    transform: scale(1.1, 1.1);
  }
  20% {
    transform: scale(1, 1);
  }
  100% {
    transform: scale(1, 1);
  }
}
@keyframes bounce {
  /* ボタンアニメーション */
  0% {
    transform: scale(0.8, 0.8);
  }
  5% {
    transform: scale(1.2, 1.2);
  }
  10% {
    transform: scale(1, 1);
  }
  15% {
    transform: scale(1.1, 1.1);
  }
  20% {
    transform: scale(1, 1);
  }
  100% {
    transform: scale(1, 1);
  }
}
#s-2 { /* パララックスひとつめ */
  background-color: #e74700;
  background-image: url(http://interplan.link/179/sample_img/back_img.png);
  background-size: cover;
  color: #fff;
}
#s-3 { /* パララックスふたつめ */
  text-align: center;
  background-color: #f3f6e3;
  background-image: url(http://interplan.link/179/sample_img/back_img2.png);
  background-size: cover;
  color: #000;
}
#s-3 .button {
  border: 3px solid #000;
  color: #000;
}
@media screen and (min-width:769px) { 
  /* メディアクエリ(幅769pxまでは以下のCSS追加) */
  .wrapper {
    max-width: 850px;
    margin: 0 auto;
    overflow: hidden;
  }
  .fl {
    margin-left: 50px;
    float: left;
    width: 40%;
    max-width: 400px;
  }
  .js-morphing {
    margin-right: 50px;
    float: right;
    margin-top: 32px;
  }
  #s-2 .fl { /* PCサイズでは並びを逆に */
    margin-left: 0px;
    margin-right: 50px;
    float: right;
  }
  #s-2 .js-morphing { /* PCサイズでは並びを逆に */
    margin-right: 0px;
    margin-left: 50px;
    float: left;
  }
}

            
          
!
            
              //ぷよぷよの球体表現 .js-morphing内のimg要素が対象 canvasサイズはimgのwidth,height
//参考サイト https://www.webopixel.net/javascript/906.html
$(function(){
    $('.js-morphing').morphing({
        numVert: 6, //円の粒度
        spring: 0.005,  //バネ運動の動作数値
        friction: 0.90, //摩擦運動の動作数値
        radius: 150, //Canvasの表示半径
        fps: 45
    });
});

//パララックス
//参考サイト http://webdrawer.net/javascript/parallax.html
$(function(){
var bg01 = $("section").css("height").replace("px","");
$(window).scroll(function(){
var y = $(this).scrollTop();
$("section").css('background-position','10px ' + parseInt( bg01 - y * 0.5) + 'px'); //0.5の値を変更すればスクロール量が変更※値が大きければスクロール量が大きい
});
});


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console