<input id="switch" type="checkbox" checked="">
<label class="switch-label" for="switch">電源 </label>

<div class="container">
  <div class="screen">
    <img class="glitch" width="1280" height="720" src="https://i.ytimg.com/vi/xgOz7832pt0/maxresdefault.jpg" alt="">
  </div>
  <div class="overlay"><img src="https://vignette.wikia.nocookie.net/steins-gate/images/0/07/Amadeuslogo.png" width="50%" alt="AmadeusSystem"></div>
</div>
@function get_vw($size, $viewport: 750) {
  @return $size / $viewport * 100 + vw;
}

@mixin fontSize_vw($font_size: 16) {
  font-size: $font_size / 2 + px;
  font-size: get_vw($font_size);
}

$ease-out-quint: cubic-bezier(0.230, 1.000, 0.320, 1.000);
$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060);
$screen-background: #121010;

body {
  background: #111;
  color: #fff;
}

#switch {
  display: none;
  ~ .container {
    > .screen {
      animation: turn-off 0.55s $ease-out-quint;
      animation-fill-mode: forwards;
    }
  }
  &:checked {
    + .switch-label {
      &:before {
        border-color: #063;
        background: #2f9;
      }
      &:after {
        content: 'off';
      }
    }
    ~ .container {
      > .screen {
        animation: turn-on 4s linear;
        animation-fill-mode: forwards;
      }
      &:after {
        animation: flicker 0.15s infinite;
      }
      .overlay {
        animation: overlay-anim 5s linear;
        animation-fill-mode: forwards;
      }
    }
  }
}

.switch-label {
  display: inline-block;
  cursor: pointer;
  background: transparent;
  color: #eee;
  padding: 10px 15px;
  border-radius: 5px;
  margin-top: 2px;
  border: 2px solid #eee;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: bold;
  &:after {
    content: 'on';
  }
  &:before {
    content: ' ';
    display: inline-block;
    border-radius: 100%;
    width: 10px;
    height: 10px;
    background: #003321;
    margin-right: 10px;
    border: 1px solid #111;
  }
  &:active {
    box-shadow: none;
    transform: translate3d(0, 2px, 0);
  }
}

.container {
  background: $screen-background;
  // width: 640px;
  // height: 360px;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  border: 2px solid #666;
  // flicker
  &:after {
    content: ' ';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: transparentize($screen-background, 0.9);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
  }
  // scanlines
  &:before {
    content: ' ';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(transparentize($screen-background, 1) 50%, transparentize(darken($screen-background, 10), 0.75) 50%), linear-gradient(90deg, transparentize(#ff0000, 0.94), transparentize(#00ff00, 0.98), transparentize(#0000ff, 0.94));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
  }
}

.screen {
  width: 100%;
  height: 100%;
  border: none;
  .glitch {
    width: 100%;
    height: auto;
    vertical-align: bottom;
  }
}

.overlay {
  color: #e4c955;
  position: absolute;
  top: 5%;
  left: 3%;
  // font-size: 40px;
  @include fontSize_vw(40);
  //text-shadow: 2px 2px black,-2px -2px black, -2px 2px black, 2px -2px black;
  visibility: hidden;
  pointer-events: none;
}

@keyframes flicker {
  $steps: 20;
  @for $i from 0 through $steps {
    #{percentage($i*(1/$steps))} {
      opacity: random();
    }
  }
}

@keyframes turn-on {
  0% {
    transform: scale(1, 0.8) translate3d(0, 0, 0);
    filter: brightness(30);
    opacity: 1;
  }
  3.5% {
    transform: scale(1, 0.8) translate3d(0, 100%, 0);
  }
  3.6% {
    transform: scale(1, 0.8) translate3d(0, -100%, 0);
    opacity: 1;
  } 
  9% {
    transform: scale(1.3, 0.6) translate3d(0, 100%, 0);
    filter: brightness(30);
    opacity: 0;
  }
  11% {
    transform: scale(1, 1) translate3d(0, 0, 0);
    filter: contrast(0) brightness(0);
    opacity: 0;
  }
  100% {
    transform: scale(1, 1) translate3d(0, 0, 0);
    filter: contrast(1) brightness(1.1) saturate(1.1);
    opacity: 1;
  }
}


@keyframes turn-off {
  0% {
    transform: scale(1, 1.3) translate3d(0, 0, 0);
    filter: brightness(1);
    opacity: 1;
  }
  60% {
    transform: scale(1.3, 0.001) translate3d(0, 0, 0);
    filter: brightness(10);
  }
  100% {
    animation-timing-function: $ease-in-quint;
    transform: scale(0.000, 0.0001) translate3d(0, 0, 0);
    filter: brightness(50);
  }
}

@keyframes overlay-anim {
  0%{
    visibility: hidden;
  }
  20%{
    visibility: hidden;
  }
  21%{
    visibility: visible;
  }
  100%{
    visibility: hidden;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.