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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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="page">
  <div class="data">
    <h1>Cheese</h1>
    <h2>#Codevember</h2>
    <a class="ghost" href="https://twitter.com/Manz" target="_blank">Code by Manz</a>
    <a class="ghost" href="https://soundcloud.com/marquinho-otaking-433341461/2001-a-space-odyssey" target="_blank">Music by DJ Otaking 333</a>
  </div>
  
  <div id="screen">

    <div class="cheese-shadow">
      <svg id="cheese" viewBox="0 0 65 40">
        <path d="M-5 3l83 36H-15z" fill="#ff8e00"/>
        <path d="M-5 3L31 11l48 28.5z" fill="#ffc900"/>
        <ellipse cx="3" cy="18" rx="6" ry="6"/>
        <ellipse cx="5" cy="30" rx="3" ry="3"/>
        <ellipse cx="16" cy="26" rx="4" ry="4"/>
        <ellipse cx="40" cy="28" rx="2" ry="2"/>
        <ellipse cx="46" cy="32" rx="3" ry="3"/>
        <ellipse cx="29" cy="32" rx="2" ry="2"/>
      </svg>
      <div class="shadow"></div>
    </div>

    <div class="ground"></div>
  </div>
  
</div>

<audio autoplay src="https://rawgit.com/ManzDev/codevember2017/master/assets/space-odyseey-by-dj-otaking-333.mp3"></audio>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Montserrat:400,600');

html {
  background:#FFF;
  overflow:hidden;
}

.data {
  position:relative;
  z-index:1;
  text-align:center;
  top: 25vh;
  opacity:0;
  animation:appears 4s linear 1 forwards 70s;
}

h1, h2, .ghost {
  font-family:Montserrat;
  font-weight:600;  
  margin:0;
}
  
h1 {
  font-size:64px;
  color:#444;
}

h2 {
  font-size:24px;
  color:#888;
}

.ghost {
  font-weight:400;
  font-size:15px;
  color:#ff6100;
  display:inline-block;
  margin:8px 2px;
  padding:8px;
  border:1px solid #ff6100;
  text-decoration:none;
}

a.ghost:hover {
  transition:all .5s linear;
  border-color:yellow;
  color:yellow;
}

#screen {
  position:absolute;
  top:0;
  left:0;
  width:100vw;
  height:100vh;
  transform:translateY(800px);
  
  animation:camera 15s ease 2s 1 forwards;
}

/** Codevember **/

#cheese {
  display:block;
  width:425px;
  height:175px;
}

#cheese ellipse {
  fill:#ff6100;
}

.ground {
  width:100vw;
  height:50px;
  position:absolute;
  top:400px;
  left:0;
  background:linear-gradient(to bottom, #CCC 0%, #FFF 65%);
}

.shadow {
  background:linear-gradient(to bottom, RGBA(0,0,0, .30), RGBA(255,255,255, 0) 75%);
  width:500px;
  height:100px;
  clip-path: polygon(50% 0%, 100% 0, 100% 0, 48% 32%, 0 63%, 20% 0);
  position:absolute;
  top:170px;
  left:-95px;
}

.cheese-shadow {
  position:absolute;
  top:230px;
  left:calc(50vw - 200px);
  z-index:2;
}

.mouse {
  width:1024px;
  height:128px;
  background:url(https://i.imgsafe.org/af/afabe83725.png);
  background-position:0 0;
  background-size:1024px 256px;
  position:absolute;
  z-index:3;
  animation:movemouse 10s linear 1 forwards;
}

.mouse.click {
  background-position:0 128px!important;
}

.mouse.mirror {
  animation:movemousemirror 10s linear 1 forwards reverse;
}

@keyframes camera {
  0% {
    transform:translateY(800px);
  }
  100% {
    transform:translateY(0);
  }
}

@keyframes movemouse {
  0% { transform:translateX(100vw) }
  100% { transform:translateX(60vw) }
}

@keyframes movemousemirror {
  0% { 
    left:calc(-1024px + 40vw);
  }
  100% { 
    left:calc(-1024px)
  }
}

.fade {
  position:absolute;
  top:0;
  left:0;
  width:100vw;
  height:100vh;
  background:#000;
}

@keyframes appears {
  0% { opacity:0 }
  100% { opacity:1 }
}
            
          
!
            
              let ground = document.querySelector('.ground');

Array.prototype.shuffle = function () {
  for (let i = this.length - 1; i > 0; i--) {
    let j = Math.floor(Math.random() * (i + 1));
    [this[i], this[j]] = [this[j], this[i]];
  }
  return this;
}

let paridad = [0, 0, 0, 1, 1].shuffle();
//console.log(paridad);

class Mouse {
  constructor(id) {
    this.mouse = document.createElement('div');
    
    //if (~~(Math.random() * 2) == 0) {
    if (id == 0) {
      this.mouse.className = 'mouse';
      this.mouse.style.left = ~~(Math.random() * 200) + 'px';
    } else {
      this.mouse.className = 'mouse mirror';
      this.mouse.style.transform = 'scale(-1,1) translateX(' + ~~(Math.random() * 200) + 'px)';
      this.mouse.style.left = -1024 + ~~(Math.random() * 200) + 'px';
    }
    this.zindex = 5 + ~~(Math.random() * 50);
    this.mouse.style.zIndex = this.zindex;
    this.mouse.style.top = (295 + this.zindex) + 'px';
    ground.insertAdjacentElement('beforebegin', this.mouse);
  }
  
  update() {
    
    if (~~(Math.random() * 250) == 0) 
      click();
    
  }
}

let mouses = []

function click() {
  console.log('click');
  let i = ~~(Math.random() * mouses.length);
  mouses[i].mouse.classList.add('click');
  setTimeout(function() {
    mouses[this].mouse.classList.remove('click');
  }.bind(i), 250 + ~~(Math.random() * 500));
}

let update = function() {
  
  // Add mouse
  if (~~(Math.random() * 450) == 0) {
    if (mouses.length < 5) {
      mouses.push(new Mouse(paridad.pop()));
    }
  }
  
  for (let i = 0; i < mouses.length; i++)
    mouses[i].update();
  
}

function loop() {
  requestAnimationFrame(loop);
  update();
}

function fadeToBlack() {
  let fade = document.createElement('div');
  fade.className = 'fade';
  document.body.appendChild(fade);
  let p = 100;
  
  update = function() {
    if (p>0) {
      if (p>20)
        p = p - 1;
      else if (p>15)
        p = p - .05
      else
        p = p - .5
      fade.style.background = 'radial-gradient(circle at center, transparent '+p+'%, #000 '+p+'%)';
    }   
  }
}

//loop();
setTimeout(loop, 15000);
setTimeout(fadeToBlack, 66000);
            
          
!
999px
Loading ..................

Console