Pen Settings



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


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


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.


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.


                <div class="pararaxArea" id="js-parallaxArea">
  <div class="js-parallax pararaxItem"></div>
  <div class="js-parallax pararaxItem"></div>
  <div class="js-parallax pararaxItem"></div>
  <div class="centerObj"><img src="" alt="" decoding="async"/>


                .pararaxArea {
  position: relative;
  background-color: #f8f8f8;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;

  .pararaxItem {
    position: absolute;

    opacity: .5;

    &:nth-child(1) {
      width: 300px;
      height: 300px;
      background-color: rgba(104, 152, 208, 0.85);
      transition: transform .6s linear .008s;
    &:nth-child(2) {
      width: 270px;
      height: 270px;
      background-color: rgba(114, 188, 201, 0.71);
      transition: transform .5s linear .004s;
    &:nth-child(3) {
      width: 240px;
      height: 240px;
      background-color: rgba(#4cc5f9, 0.68);
      transition: transform .3s linear 0s;

  .centerObj {
    position: absolute;
    z-index: 100;
    width: 80px;
    height: 80px;
    img {
      width: 100%;


                // パララックスのターゲット取得
  const target = document.getElementsByClassName('js-parallax');
  // パララックスを行うエリア
  const activeArea = document.getElementById('js-parallaxArea');
  // ウィンドウの中心の取得
  const xCenter = window.innerWidth / 2;
  const yCenter = window.innerHeight / 2;
  // パララックスで移動させる距離
  const parallaxVal = 10; //中心からマウスの距離の10分1移動

  // マウスがパララックスエリアに入った時のイベント
  activeArea.addEventListener('mousemove', (e) => {
    // マウスの座標を取得して 中心からの距離取得、 そこからpararaxValで距離を調整
    const x = (xCenter - e.pageX) / parallaxVal;
    const y = (yCenter - e.pageY) / parallaxVal;
    // パララックスさせる要素にstyleの指定
    for (var i = 0; i < target.length; i++) {
      target[i].style.transform = `translate(${-x}px, ${-y}px)`;