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 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

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

              
                - 150.times do
  .star
.title 404
.gravestones
  - 3.times do
    .cross
.bottompatch
  - 100.times do
    .patch
.msg
  This page doesn't exist.
.crypt
  .roof
  .body
    .door
.ghost
.moon
              
            
!

CSS

              
                @font-face
  font-family: 'stranger'
  src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/455279/stranger.ttf') format('truetype')

html
  background: linear-gradient(0deg, #050514, #30336b)
  overflow: hidden
  height: 100%
  body
    margin: 0
    
.patch
  position: absolute
  bottom: 0
  height: 10vh
  width: 3vw
  background-color: black
  z-index: 2
  &:nth-child(odd)
    background-color: rgba(0,0,0,0.9)
    z-index: 0
  
.bottompatch
  position: absolute
  background-color: red
  bottom: 0
  left: 0
  
.gravestones
  .cross
    position: absolute
    height: 28vh
    width: 1.8vh
    background-color: black
    bottom: 0
    z-index: 1
    &:after
      content: ""
      position: absolute
      background-color: inherit
      height: 1.8vh
      width: 10vh
      top: 5vh
      left: 50%
      transform: translateX(-50%)
    &:nth-child(1)
      left: 20%
    &:nth-child(2)
      left: 70%
      bottom: -4vh
    &:nth-child(3)
      left: 90%
 

.msg
  display: none
  color: black
  font-size: 6.2vh
  font-family: 'stranger', arial
  position: absolute
  bottom: 14vh
  left: 50%
  transform: translateX(-50%)
  z-index: 2
.crypt
  position: absolute
  bottom: 0
  left: 50%
  transform: translateX(-50%)
  width: 38vh
  height: 40vh
  .roof
    height: 10vh
    width: 100%
    background-color: black
    -webkit-clip-path: polygon(21% 0%, 79% 0%, 100% 100%, 0% 100%)
    clip-path: polygon(21% 0%, 79% 14%, 100% 100%, 0% 100%)
  .body
    width: 86%
    height: 100%
    background-color: black
    margin: -1vh auto 0 auto
    .door
      position: absolute
      bottom: 0
      left: 50%
      transform: translateX(-50%) rotateZ(-3deg)
      width: 20%
      height: 45%
      border-top-right-radius: 100%
      border-top-left-radius: 100%
      background-color: black
    
.ghost
  width: 5vh
  height: 20vh
  border-top-right-radius: 100%
  border-top-left-radius: 100%
  background-color: rgba(255,255,255,0.2)
  filter: blur(30px)
  position: absolute
  bottom: 0
  z-index: 1
  animation-name: fog
  animation-iteration-count: infinite
  animation-duration: 80s
  
.moon
  position: absolute
  top: 8vh
  right: 18vh
  height: 20vh
  width: 20vh
  border-radius: 20vh
  box-shadow: inset -2vh 0 0 #dfe6e9
  transform: rotateZ(32deg)
  
.title
  height: 65vh
  margin: 0
  position: absolute
  left: 49%
  bottom: -90vh
  opacity: 0.1
  transition: filter 3s
  transform: translate(-50%, -50%) rotateZ(-4deg)
  font-family: 'stranger', arial
  font-size: 60vh
  color: #dfe6e9
  z-index: 1
  
.life
  opacity: 1
  transition: opacity 4s
  animation-name: float
  animation-iteration-count: infinite
  animation-duration: 5s
  
  

.star
  height: 1px
  width: 1px
  background-color: white
  position: absolute
  z-index: 0

@keyframes fog 
  0%
    left: -9vw
    transform: rotateZ(19deg)
  50%
    left: 109vw
  100% 
    left: 9vw
    transform: rotateZ(-19deg)
  
@keyframes float
  0%
    top: 45%
  50%
    top: 46%
  100% 
    top: 45%
              
            
!

JS

              
                $(".patch").each((i) => {
  let b = i + 1
  let rX = Math.floor(Math.random() * 50)
  let rY = Math.floor(Math.random() * 100)
  let rH = Math.floor(Math.random() * 10) + 15
  $(".patch:nth-child("+b+")").css({
    left: i-1+"vw",
    height: rH+"vh",
    "-webkit-clip-path": "polygon("+rX+"% "+rX+"%, 0% 100%, 100% 100%)",
    "clip-path": "polygon("+rX+"% "+rX+"%, 0% 100%, 100% 100%)"
  })
})

$(".cross").each((i) => {
  let b = i + 1
  let rR = Math.floor(Math.random() * 15) * Math.cos(Math.PI * Math.round(Math.random()))
  $(".cross:nth-child("+b+")").css({
    "transform": "rotateZ("+rR+"deg)"
  })
})

$(".star").each((i) => {
  $(".star:nth-child("+i+")").css({
    top: Math.random() * $(document).height() - $(document).height()/4,
    left: Math.random() * $(document).width()
  })
})

init = () => {
  $(".crypt").css({
    "transform": "translateX(-50%) rotateZ("+Math.floor(Math.random() * 5) * Math.cos(Math.PI * Math.round(Math.random()))+"deg)"
  })
  $(".title").animate({
    top: "45%"
  }, 5000, () => {
    $(".title").addClass("life")
    $(".msg").fadeIn(1000)
  })
} 
init()
              
            
!
999px

Console