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

              
                <head>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!--==============レイアウトを制御する独自のCSSを読み込み===============-->
  <link href="https://assets.codepen.io/6329135/reset04.css" rel="stylesheet">
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Oleo+Script:wght@400;700&display=swap');
  </style>
</head>

<body>

  <div id="wrpeer">
    <header id="header">
      <div class="d-flex justify-content-center oleo">
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-9" style="transform: translate3d(0px, 0px, 0px);">L</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-6" style="transform: translate3d(0px, 0px, 0px);">u</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="-3" style="transform: translate3d(0px, 0px, 0px);">x</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="0" style="transform: translate3d(0px, 0px, 0px);">y</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="3" style="transform: translate3d(0px, 0px, 0px);">.</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="6" style="transform: translate3d(0px, 0px, 0px);">j</div>
        <div class="luxy-el inner-el" data-horizontal="1" data-speed-x="9" style="transform: translate3d(0px, 0px, 0px);">s</div>
      </div>
      <div class="scrolldown"><span>Scroll</span></div>
    </header>

    <div id="luxy">

      <section class="area">
        <figure class="luxy-el" data-speed-y="8" data-offset="50"><img src="https://assets.codepen.io/6329135/jeff-sheldon-3226-unsplash.jpg" alt=""></figure>
        <div class="box luxy-el" data-speed-y="-5">
          <h2>Area1</h2>
          <p>テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</p>
        </div>
      </section>

      <section class="area">
        <figure class="luxy-el" data-horizontal="1" data-speed-x="-2"><img src="https://assets.codepen.io/6329135/fabian-grohs-773959-unsplash.jpg" alt=""></figure>
        <div class="box luxy-el" data-speed-y="-5">
          <h2>Area2</h2>
          <p>テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</p>
        </div>
      </section>

      <section class="area">
        <figure class="luxy-el" data-horizontal="1" data-speed-x="2"><img src="https://assets.codepen.io/6329135/stil-410573-unsplash.jpg" alt=""></figure>
        <div class="box luxy-el" data-speed-y="-5">
          <h2>Area3</h2>
          <p>テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</p>
        </div>
      </section>

      <section class="area">
        <figure class="luxy-el" data-speed-y="5" data-offset="-250"><img src="https://assets.codepen.io/6329135/jeff-sheldon-3226-unsplash.jpg" alt=""></figure>
        <div class="box luxy-el" data-speed-y="-4" data-offset="50">
          <h2>Area4</h2>
          <p>テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</p>
        </div>
      </section>

      <footer>
        <small>使用ライブラリ: <a href="https://min30327.github.io/luxy.js/" target="_blank">https://min30327.github.io/luxy.js/</a></small>
      </footer>

    </div>
    <!--/luxy-->
  </div>

  <script src="https://assets.codepen.io/6329135/luxy.js"></script>

</body>
              
            
!

CSS

              
                @charset "utf-8";

/*========= レイアウトのためのCSS ===============*/

body {
  padding-top: 45vh;
  margin-bottom: 45vh;
  background-image: linear-gradient(
    103.3deg,
    rgba(252, 225, 208, 1) 30%,
    rgba(255, 173, 214, 1) 55.7%,
    rgba(162, 186, 245, 1) 81.8%
  );
}

.oleo {
  font-family: "Oleo Script", curs;
}

.d-flex {
  display: flex;
}

.inner-el {
  font-size: 4rem;
  position: relative;
  text-align: center;
  padding: 0 10px;
  max-width: 50px;
}

.justify-content-center {
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/*========= スクロールダウンのためのCSS ===============*/

/*スクロールダウン全体の場所*/
.scrolldown {
  /*描画位置※位置は適宜調整してください*/
  position: absolute;
  bottom: 10px;
  right: 50%;
  /*マウスの動き1.6秒かけて動く永遠にループ*/
  animation: mousemove 1.6s ease-in-out infinite;
}

/*下からの距離が変化して上から下に動く*/
@keyframes mousemove {
  0% {
    bottom: 10px;
  }
  50% {
    bottom: 5px;
  }
  100% {
    bottom: 10px;
  }
}

/*Scrollテキストの描写*/
.scrolldown span {
  /*描画位置*/
  position: absolute;
  left: -15px;
  bottom: 45px;
  /*テキストの形状*/
  color: #333;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/*マウスの中の線描写 */
.scrolldown span::after {
  content: "";
  /*描画位置*/
  position: absolute;
  top: 10px;
  left: 17px;
  /*線の形状*/
  width: 1px;
  height: 15px;
  background: #333;
  /*線の動き1.4秒かけて動く。永遠にループ*/
  animation: mousepathmove 1.4s linear infinite;
  opacity: 0;
}

/*上からの距離・不透明度・高さが変化して上から下に流れる*/
@keyframes mousepathmove {
  0% {
    height: 0;
    top: 10px;
    opacity: 0;
  }
  50% {
    height: 15px;
    opacity: 1;
  }
  100% {
    height: 0;
    top: 30px;
    opacity: 0;
  }
}

/*マウスの描写 */
.scrolldown:before {
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 0;
  left: -10px;
  /*マウスの形状*/
  width: 25px;
  height: 37px;
  border-radius: 10px;
  border: 1px solid #333;
}

/*マウスの中の丸の描写*/
.scrolldown:after {
  content: "";
  /*描画位置*/
  position: absolute;
  bottom: 26px;
  left: 0;
  /*丸の形状*/
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid #333;
}

img {
  max-width: 100%;
  height: auto;
}

h1 {
  text-align: center;
  font-size: 1.5rem;
  padding: 30px 0;
}

h2 {
  font-size: 1.3rem;
  margin: 0 0 20px 0;
}

/*写真と文章のセット 装飾のためのCSS*/

.area {
  position: relative;
  margin: 60% auto 20% auto;
  padding: 0 30px;
  max-width: 1000px;
  width: 100%;
}

.area figure {
  position: relative;
  left: 0;
  top: 0;
  width: 40%;
  line-height: 0;
  box-shadow: 15px -15px rgba(75, 68, 229, 0.7);
}

.area:nth-child(2n) figure {
  left: 50%;
}

.area .box {
  position: absolute;
  top: 40%;
  left: 30%;
  background: rgba(255, 255, 255, 0.8);
  padding: 30px;
  box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
}

.area:nth-child(2n) .box {
  left: inherit;
  right: 30%;
}

/*Footerを下付きにする*/

footer {
  position: absolute;
  width: 100%;
  z-index: 999;
  /*装飾のためのCSS*/
  padding: 20px 0;
  bottom: 80px;
  height: 80px;
  color: #fff;
  text-align: center;
  background: #333;
}

footer a {
  color: #fff;
}

/*===========タブレット以下の見え方=============*/

@media screen and (max-width: 768px) {
  .area figure {
    width: 50%;
  }

  footer {
    position: inherit;
  }
}

@media screen and (max-width: 600px) {
  h2 {
    text-align: center;
  }

  .area:nth-child(2n) figure {
    left: 0;
  }

  .area figure {
    width: 100%;
  }
  .area .box,
  .area:nth-child(2n) .box {
    position: relative;
    top: 0;
    left: 0;
    right: inherit;
    padding: 20px;
  }
}

              
            
!

JS

              
                if (matchMedia("(min-width: 480px)").matches) {
  //768px以上のみライブラリを読み込む
  luxy.init();
}

              
            
!
999px

Console