.container
    input(type="checkbox" id="switch")
    .ellipse
    .ray
    .head
    .neck
    .body
        label(for="switch")

.container
    .msg.msg_1 404
    .msg.msg_2 Page Not Found
View Compiled
@import url(https://fonts.googleapis.com/css?family=Fjalla+One);
$black:  #000;
$white:  rgb(255, 254, 226);
$l-grey: rgb(141, 142, 126);
$grey:   rgb(100, 100, 100);
$d-grey: rgb(51, 51, 51);
$yellow: rgb(255, 171, 43);
$time: 9s;

$c-width: 36vmin;
$c-height: 90vmin;

@mixin animation($name) {
    @-webkit-keyframes #{$name} {@content;}
    @-moz-keyframes #{$name} {@content;}
    @-o-keyframes #{$name} {@content;}
    @keyframes #{$name} {@content;}
}

@mixin animation-use($name) {
    -webkit-animation: $name $time infinite linear;
    -moz-animation: $name $time infinite linear;
    -o-animation: $name $time infinite linear;
    animation: $name $time infinite linear;
}

@mixin rotate($val) {
    -webkit-transform: rotate($val);
    -ms-transform: rotate($val);
    transform: rotate($val);
}

@include animation(rotate) {
    25% {
        @include rotate(-28deg);
    }
    75% {
        @include rotate(28deg);
    }
}

@mixin message($val) {
    @include animation(msg_ + $val) {
        0%, 25%, 75.001%, 100% {
            @if ($val == 'first') {
                opacity: 1;
            } @else {
                opacity: 0;
            }
        }
    
        25.001%, 75% {
            @if ($val == 'first') {
                opacity: 0;
            } @else {
                opacity: 1;
            }
        }
    }
}

@include message('first');
@include message('second');
 
body {
    margin: 0;
    overflow: hidden;
    background: $black;
    
    .container {
        position: absolute;
        left: 50%;
        top: 50%;
        width: $c-width;
        height: .866*$c-height;
        margin-left: -$c-width/2;
        margin-top: -.433*$c-height;
        
        &:first-child {
            transform-origin: 50% 100%;
            @include animation-use(rotate);
        }
        
        &:last-of-type {
            pointer-events: none;
        }
        
        #switch {
            display: none;
            
            &:checked ~ .ellipse,
            &:checked ~ .ray {
                opacity: 0;
            }
        }
        
        .ellipse {
            position: relative;
            width: $c-width;
            height: .75*$c-width;
            background: $white;
            border-radius: 50%;
            z-index: 1;
        }
        
        .ray {
            position: relative;
            border-top: .4*$c-height solid $l-grey;
	        border-left: .13*$c-height solid transparent;
	        border-right: .13*$c-height solid transparent;
            margin-top: -.14*$c-height;
        }
        
        .head {
            position: relative;
            width: .4*$c-width;
            height: .02*$c-height;
            margin-left: .3*$c-width;
            background: $yellow;
        }
        
        .neck {
            position: relative;
	        width: .205*$c-width;
            margin-left: .3*$c-width;
	        border-top: .12*$c-width solid $d-grey;
	        border-left: .1*$c-width solid transparent;
	        border-right: .1*$c-width solid transparent;
        }
        
        .body {
            position: relative;
            width: .203*$c-width;
            margin-left: .4*$c-width;
            height: .24*$c-height;
            background: $grey;
        }
        
        label {
            position: absolute;
            top: .04*$c-height;
            left: .073*$c-width;
            width: .04*$c-width;
            height: .04*$c-height;
            border: .012*$c-width solid $d-grey;
            background: $yellow;
            border-radius: 10px;
            cursor: pointer;
        }
    }
    
    .msg {
        position: absolute;
        width: $c-width;
        margin-left: -$c-width/2;
        left: 50%;
        text-align: center;
        font-family: 'Fjalla One', sans-serif;
        color: $black;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        z-index: 2;
        
        &.msg_1 {
            top: .07*$c-height;
            font-size: 12vmin;
            @include animation-use(msg_first);
        }
        
        &.msg_2 {
            top: .12*$c-height;
            font-size: 4.2vmin;
            @include animation-use(msg_second);
        }
    }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.