cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="wrap">
<div class="cluster one"></div>
<div class="cluster two"></div>
<div class="cluster three"></div>
<div class="cluster four"></div>
<div class="cluster five"></div>
</div>


<div class="wrap">
  <div class="shark">
    <div class="front">
    </div>
    <div class="tail">
    </div>
  </div>
</div>

<h1><span>S</span><span>E</span><span>A</span><br><span>D</span><span>E</span><span>B</span><span>R</span><span>I</span><span>S</span></h1>

<div class="intro"><p>Washed Ashore builds and exhibits aesthetically powerful art to educate a global audience about plastic pollution in oceans and waterways and spark positive changes in consumer habits.</p></div>
            
          
!
            
              $bg: #273276;
$y: #f99432;

body{
  background:linear-gradient(to bottom, $bg, $y 175%);
  width:100%;
  height:100vh;
  .intro{
    position:absolute;
    width:30%;
    height:auto;
    background:#fff;
    display:inline-block;
    padding:30px 50px;
    bottom:5%;
    right:5%;
    p{
      font-size:18px;
      color:$bg;
      font-family: 'Francois One', sans-serif;
      font-weight:100;
    }
  }
  h1{
    position:absolute;
    left:5%;
    top:5%;
    z-index:9;
    color:rgba(255,255,255,1);
    font-size:20vmin;
    line-height:0.75;
    margin:0;
    text-align:left;
    font-family: 'Francois One', sans-serif;
    span{
      animation:bobbing 3s ease-in-out infinite alternate;
      display:inline-block;
      transform-origin:50% 100%;
      @for $i from 1 through 20{
        &:nth-of-type(#{$i}){
          animation-delay:#{$i / -1.5}s;
        }
      }
      @keyframes bobbing{
        0%{
          transform:translateY(0px) rotate(5deg);
        }
        100%{
          transform:translateY(-20px) rotate(-5deg);
        }
      }
    }
  }
  .wrap{
    position:absolute;
    width:75%;
    height:75%;
    top:12.5%;
    left:12.5%;
    background:$bg;
    overflow:hidden;
    box-shadow:0 50px 50px -40px $bg;
    &:nth-of-type(3){
      transform:scaleY(-1) scaleX(-1);
      background:transparent;
      div{
        background-size:700px;
        opacity:0.25;
      }
    }
    &:nth-of-type(2){
      background:transparent;
      .shark{
        width:500px;
        height:200px;
        position:absolute;
        left:calc(50% - 250px);
        top:calc(50% - 100px);
        perspective:1000px;
        &:before{
          content:'';
          position:absolute;
          width:200%;
          height:200%;
          top:-50%;
          left:-50%;
          background:radial-gradient(ellipse at center, $bg, transparent 75%);
          border-radius:100%;
        }
        .front{
          width:400px;
          height:250px;
          background:url('https://puu.sh/y0xtw/b40c749d20.svg');
            background-size:525px;
            background-position:right center;
            background-repeat:no-repeat;
            position:absolute;
            top:0;
            right:0;
        }
        .tail{
          position:absolute;
          top:0;
          left:0;
          height:250px;
          width:100px;
                    background:url('https://puu.sh/y0xtw/b40c749d20.svg');
            background-size:525px;
            background-position:left center;
            background-repeat:no-repeat;
            transform-style:preserve-3d;
            transform-origin:100% 50%;
            animation:swim 1s ease-in-out infinite alternate;
          @keyframes swim{
            0%{
              transform:rotateY(-25deg);
            }
            100%{
              transform:rotateY(55deg);
            }
          }
        }
      }
    }
  }
  .cluster{
    width:125%;
    position:absolute;
    height:125%;
    background-size:contain;
    left:-12.5%;
    top:-12.5%;
    &.one{
      background-image:url('https://puu.sh/y0m2N/8176b80069.svg');
    }
    &.two{
      background-image:url('https://puu.sh/y0m6A/69241f8fbe.svg');
    }
    &.three{
      background-image:url('https://puu.sh/y0m97/d0da489e59.svg');
    }
    &.four{
      background-image:url('https://puu.sh/y0maP/5f78b49a60.svg');
    }
    &.five{
      background-image:url('https://puu.sh/y0mJT/65b74daef5.svg');
    }
  }
}
            
          
!
            
              var $one = $('.one'),
    $two = $('.two'),
    $three = $('.three'),
    $four = $('.four'),
    $five = $('.five'),
    $shark = $('.shark'),
    $x_axis  = $('#x-axis'),
    $y_axis  = $('#y-axis'),
    $container = $('body'),
    container_w = $container.width(),
    container_h = $container.height();

$(window).on('mousemove.parallax', function(event) {
  var pos_x = event.pageX,
      pos_y = event.pageY,
      left  = 0,
      top   = 0,
      bri  = 0;

  bri  = container_h / 0.25 - pos_y;
  left = container_w / 2 - pos_x;
  top  = container_h / 2 - pos_y;
  
  
  TweenMax.to(
    $x_axis, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * -1) + 'px)'
      }, 
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  
  TweenMax.to(
    $y_axis, 
    1, 
    { 
      css: { 
        transform: 'translateY(' + (top * -1) + 'px)' 
      }, 
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $one, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * -0.06) + 'px) translateY(' + (top * -0.04) + 'px)',
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $two, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * 0.06) + 'px) translateY(' + (top * 0.04) + 'px)',
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $three, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * -0.02) + 'px) translateY(' + (top * 0.04) + 'px)',
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $four, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * 0.04) + 'px) translateY(' + (top * -0.02) + 'px) rotate(' + (left * -0.0025) + 'deg)' ,
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $five, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * -0.04) + 'px) translateY(' + (top * -0.02) + 'px) rotate(' + (top * -0.01) + 'deg)',
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  TweenMax.to(
    $shark, 
    1, 
    { 
      css: { 
        transform: 'translateX(' + (left * -0.07) + 'px) translateY(' + (top * 0.04) + 'px) rotate(' + (top * 0.02) + 'deg)',
        
      }, 
      
      ease:Expo.easeOut, 
      overwrite: 'all' 
    });
  
  });

            
          
!
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.
Loading ..................

Console