Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                .container
  .background
    .star 
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
    .star
  .gate
    .ring1
      .ring2
        .gliph(data-content='ह')
        .gliph(data-content='बा')
        .gliph(data-content='के')
        .gliph(data-content='रि')
        .gliph(data-content='पृ')
        .gliph(data-content='ढं')
        .gliph(data-content='बा')
        .gliph(data-content='ह')
        .gliph(data-content='था')
        .gliph(data-content='ढं')
        .gliph(data-content='बा')
        .gliph(data-content='के')
        .gliph(data-content='ह')
        .gliph(data-content='ह')
        .gliph(data-content='पृ')
        .gliph(data-content='शा')
        .gliph(data-content='रि')
        .gliph(data-content='न')
        .gliph(data-content='ह')
        .gliph(data-content='बा')
        .gliph(data-content='के')
        .gliph(data-content='रि')
        .gliph(data-content='पृ')
        .gliph(data-content='ढं')
        .gliph(data-content='बा')
        .gliph(data-content='ह')
        .gliph(data-content='था')
        .gliph(data-content='ढं')
        .gliph(data-content='बा')
        .gliph(data-content='के')
        .gliph(data-content='ह')
        .gliph(data-content='ह')
        .gliph(data-content='पृ')
        .gliph(data-content='शा')
        .gliph(data-content='रि') 
        .gliph(data-content='न') 
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .light
        .lamp
      .slider
        video(src="https://res.cloudinary.com/shanomurphy/video/upload/v1520181785/water_obm8lb.webm" type="video/mebm" loop="" autoplay="autoplay")
        img(src="https://upload.wikimedia.org/wikipedia/commons/7/71/Pyramide_khephren.jpg", alt="pyramide")
        img(src="https://images.pexels.com/photos/2422/sky-earth-galaxy-universe.jpg?w=940&h=650&dpr=2&auto=compress&cs=tinysrgb", alt="earth")
        .background
          .star 
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
          .star
  .floor
    .line
  .wall-left
  .wall-right
  .bridge
    .staircase
      .stair
      .stair
  .barrier-left
  .barrier-right
a(href="#")#reset reset
              
            
!

CSS

              
                .gliph{font-family: 'Karma', serif}
* {padding:0; margin: 0; border:0;box-sizing: border-box;}
body {
  max-width: 100%;
  overflow-x: hidden;
  background: #000 url(https://im-01.gifer.com/6xwT.gif) fixed no-repeat 0 0 / 100vw 100vh;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  
}

.container {
  perspective: 1000px;
  width: 100%;
  transition: all 1.5s;
}

body * {position: absolute;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.background {
  width: 100%;
  height: 100vh;
  background: #000;
  min-height: 150vmin;
  transition: all 1s 1.5s;
}

.gate {
  position: relative;
  margin: auto;
  width: 80vmin;
}

.ring1 {
  width: 80vmin;
  height: 80vmin;
  border-radius: 50%;
  top: 2rem;
  background-color: #80A2A3;
  // -webkit-clip-path: inset(50% round 50% 50%);
  // clip-path: inset(14% round 50% 50%);
}
.ring2 {
  width: 90%;
  height: 90%;
  left: 5%;
  top: 5%;
  border: .5vmin dotted #476067;
  border-radius: 50%;
  box-shadow: inset 0 0 1rem #000, 0 0 1rem #000;
  animation: password 25s infinite linear
}

@keyframes password {
  0%, 5% {transform: rotate(0deg)}
  20%, 15% {transform: rotate(45deg)}
  35%,30% {transform: rotate(90deg)}
  50%, 45% {transform: rotate(135deg)}
  65%, 60% {transform: rotate(180deg)}
  80%, 75% {transform: rotate(225deg)}
  95%, 90% {transform: rotate(270deg)}
  100% {transform: rotate(360deg)}
}
.gliph {
  min-width: 1px;
  width: 1%;
  bottom: 50%;
  left: calc(50% - .5%);
  height: 50%;
  background: #476067;
  transform-origin: bottom;
  font-size: 3vmin;
  @for $i from 0 through 36 {
    &:nth-child(#{$i}) {
      transform-origin: bottom;
      transform: rotate(calc(#{$i} * 10deg));
    }
  }
}

.gliph::after {
  content: attr(data-content);
  display: block;
  width: 6vmin;
  padding-top: 1vmin;
  text-align: center;
}

@keyframes water {
  0%, 100% {transform: scale(1)}
  40% {transform: scale(.6)}
  50% {transform: scale(.8)}
  75% {transform: scale(1)}
  80% {transform: scale(1.2)}
}
.slider {
  width: 72%;
  height: 72%;
  top: 14%;
  left: 14%;
  border-radius: 50%;
  background: #2F3871;
  box-shadow: inset 0 0 5rem #000, 0 0 5vmin #000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: initial;
  -webkit-transform-style: initial;
  &::before {
    content: '';
    position: absolute;
    display: block;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: #FFF;
    box-shadow: inset 0 0 15vmin #FFF, 0 0 10vmin #FFF, 0 0 15vmin #FFF, 0 0 5vmin #FFf;
    filter: blur(3vmin);
    mix-blend-mode: ligther;
    animation: water 5s 1s infinite;
  }
  &:hover::after {
    opacity: 1;
  }
  &::after {
    content: "Click to turn on !";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    text-align: center;
    color: #fff;
    font-size: 6vmin;
    opacity: 0;
    text-shadow: 0 0 .5rem #000;
    transition: all 1s;
  }
  .background {
    background: #000;
    opacity: 1;
    transition: all .5s 1.6s;
  }
}
.gate.active .slider::after {
  content: 'Click again to discover the other side !';
}
.otherWorld .gate.active .slider::after {
  content: 'Welcome ! You want to go back ?';
}
.light {
  background-color: #4448;
  transition: all 1s;
  width: 7%;
  height: 7%;
  border-radius: 50%;
  left: 46.5%;
  bottom: 50%;
  margin-bottom: 43%;
  transform-origin: center 700%;
  @for $i from 1 through 8 {
    &:nth-child(#{$i + 1}) {
      transition-delay: calc(#{$i - 1} * .2s);
      transform: rotate(calc(#{$i - 1} * 45deg));
    }
  }
}

.lamp {
  width: 0;
  height: 0;
  left: 8%;
  bottom: -70%;
  border-top: 5vmin solid #717B72;
  border-right: 2vmin solid transparent;
  border-left: 2vmin solid transparent;
  &::before, &::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: .6vmin;
    height: 8vmin;
    background: #717B72;
    transform-origin: bottom;
    transform: rotateZ(20deg);
  }
  &::after {transform:rotateZ(-20deg)}
}

.floor {
  width: 100vw;
  top: 80vmin;
  height: 800px;
  background: #6F8BA3;
  transform-origin: top;
  transform: rotateX(90deg);
  .line {
    width: 100vw;
    background-image: linear-gradient(to right, black 50%, #FBD06A 0%);
    background-position: bottom;
    background-size: 15% 3vmin;
    background-repeat: repeat-x;
    margin-top: 40vmin;
    height: 3vmin;
    transform: skewX(60deg) rotate(5deg);
  }
}

.bridge {
  transform-origin: top;
  width: 40vmin;
  left: calc(50% - 20vmin);
  top: 70vmin;
  height: 500px;
  background: repeating-linear-gradient(90deg, 
		#546174, #546174 .1em, #283A50 0, #283A50 .5em);
  box-shadow: inset 0 0 5vmin #000;
  transform: rotateX(95deg);
  &::after, .stair::after {
    content: '';
    position: absolute;
    display: block;
    width: 100%;
    height: 3px;
    background: #000;
    transform-origin: bottom;
    bottom: 0;
    transform: rotateX(90deg);
  }
}

.staircase {
  top: 100%;
  width: 100%;
  height: 50px;
  transform-origin: top;
  transform: rotateX(-50deg);
  border: 4px solid;
  border-top: none;
  .stair {
    width: 100%;
    background: repeating-linear-gradient(90deg, 
		#546174, #546174 .1em, #283A50 0, #283A50 .5em);
    height: 25px;
    transform: rotateX(50deg);
    &:first-child {
      bottom: 0;
    }
    &:last-child {
      bottom: 40%;
    }
  }
}

div[class^="barrier"] {
  width: 50px;
  height: 350px;
  // background: repeating-linear-gradient(0deg, 
  // red, red 1em, green 0, #283A50 5em);
  transform-origin: top left;
  left: calc(50% - 20vmin);
  top: 70vmin;
  border-radius: 50px 50px 0 0;
  border: 1vmin solid #31363C;
  transform:  rotateZ(-90deg) rotateX(90deg) skew(4deg);
  &::before {
    content: '';
    position: absolute;
    width: 1vmin;
    background-color: #31363C;
    height: 100%;
    left: 20%;
    top: 0
  }
  &::after {
    content: '';
    position: absolute;
    display: block;
    width: 50%;
    height: 100%;
    right: 0;
    box-shadow: 0 0 1rem #FFFDF1, inset 0 0 5vmin #FFFDF1;
    background-color: #FFFDF1C3;
  }
}

div[class^="barrier"]:last-of-type {
  transform: translate(39vmin) rotateZ(-90deg) rotateX(90deg) skew(4deg);
}

.slider img:first-of-type { 
  transform: scale(1.5);
}
.slider img {
  max-width: 100%;
  opacity: 0;
  transition: all 2s;
}
.slider video {
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  top: 0;
  left: 0;
  mix-blend-mode: multiply;
}
.slider .active {
  opacity: 1;
  mix-blend-mode: initial;
}

@keyframes blink {
  0%,100% {transform: scale(1)}
  50% {transform: scale(.5)}
}

.star {
  background-color: #e4efab;
  border-radius: 50%;
  &:nth-of-type(3n) {
    animation: blink 1s infinite;
  }
  @for $i from 0 through 99 {
    &:nth-of-type(#{$i}) {
      top: random(100) + vh;
      left: random(100) + vw;
      $width: random(2) + 1 + px;
      height: $width;
      width: $width;
      animation-delay: random() + s;
    }
  }
}

.gate.active {
  .light {
    background-color: #EBFE81;
    box-shadow: 0 0 4vmin #EBFE81;
  }
  .background {
    opacity: 0; 
  }
}

body.travel {
  .container {
    transform: scale(3);
    transform-origin: 50% 50vmin;
    opacity: 0;
  }
}

.otherWorld .background {
    background-color: #dcb02d;
}

a {
  color: #fff;
  font-size: 1.5rem;
  position: fixed;
  top: 0;
}
              
            
!

JS

              
                var i=1;
$('.gate').on('click', function() {
  if (!$(this).hasClass('active')) {
    $(this).addClass('active');
  } else if (!$('.slider img').hasClass('active')) {
    if ($('body').hasClass('otherWorld')) {
      $('.slider img:nth-of-type(2)').addClass('active');
    } else {
      $('.slider img:nth-of-type(1)').addClass('active');
    }    
  } else if (!$('body').hasClass('otherWorld')) {
    $('body').addClass('travel');
    setTimeout(function() {
      $('body').removeClass('travel').addClass('otherWorld');
      $('.slider img:nth-of-type(1)').removeClass('active');
      $('.slider img:nth-of-type(2)').addClass('active');
    },2000)
  } else {
    $('body').addClass('travel').removeClass('otherWorld');
    setTimeout(function() {
      $('body').removeClass('travel');
      $('.slider img:nth-of-type(1)').addClass('active');
      $('.slider img:nth-of-type(2)').removeClass('active');
    },2000)
  }
});

$('#reset').click(function(e) {
  e.preventDefault();
  $('body').removeClass('travel').removeClass('otherWorld');
  $('.slider img').removeClass('active');
  $('.gate').removeClass('active');
})
              
            
!
999px

Console