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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              d.container
  .card
    .image
    .info
      .header Charlie Quinn
      .body
        p I'm the prettiest thing! And I know it.
        p I like to run. And sing. And blow kisses. And fight with light sabers.
        p I'm pretty much the best thing ever. Fact. Period. End of story.
            
          
!
            
              @import "compass/css3";

/* start functions */
@function color($color, $adjustment: 0) {
  $newColor: "";
  $adjustment: $adjustment * .1; 
  @if ($adjustment > 0) {
    $newColor: shade($color, percentage($adjustment));
  }
  @else {
    $adjustment: $adjustment * -1;
    $newColor: tint($color, percentage($adjustment));
  }
  @return $newColor;
}

@function buildComplexBoxShadow($direction: "v") {
  $boxShadowVal: 0px 700px 0 0 rgba(color($color-5), .25),;
  $colorVar: "";
  @for $i from 1 through 12 {
    @if $i == 1 {$colorVar: $color-1};
    @if $i == 2 {$colorVar: $color-2};
    @if $i == 3 {$colorVar: $color-3};
    @if $i == 4 {$colorVar: $color-4};
    @if $i == 5 {$colorVar: $color-5};
    @if $i == 6 {$colorVar: $color-6};
    @if $i == 7 {$colorVar: $color-1};
    @if $i == 8 {$colorVar: $color-2};
    @if $i == 9 {$colorVar: $color-3};
    @if $i == 10 {$colorVar: $color-4};
    @if $i == 11 {$colorVar: $color-5};
    @if $i == 12 {$colorVar: $color-6};
    $x: random(2);
    @if $x == 2 {$x: -1};
    @if $direction == "v" {
      $boxShadowVal: $boxShadowVal, -($i * 80px) (max(random(4800), random(4800)) * $x) + px 0 0 rgba(color($colorVar), .25);
      $boxShadowVal: $boxShadowVal, ($i * 80px) max(random(4800), random(4800)) + px 0 0 rgba(color($colorVar), .25);
    }
    @else {
      $boxShadowVal: $boxShadowVal, ((max(random(4800), random(4800)) * $x) + px) ($i * -1 * 80px) 0 0 rgba(color($colorVar), .25);
      $boxShadowVal: $boxShadowVal, (max(random(4800), random(4800)) + px) ($i * 80px) 0 0 rgba(color($colorVar), .25);
    }
  }
  @return $boxShadowVal;
}

/* end functions */

$color-a: #333;
$color-1: darkviolet;
$color-2: dodgerblue;
$color-3: lawngreen;
$color-4: gold;
$color-5: orange;
$color-6: deeppink;

* {
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
  overflow: hidden;
  perspective: 1000px;
  position: relative;
  width: 100%;
  &:before,
  &:after {
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    transform-origin: center center;
    transform-style: preserve-3d;
    top: 0;
    width: 100%;
    z-index: -1;
  }
  &:before {
    width: 40px;
    left: 50%;
  }
  &:after {
    height: 40px;
  }
}
html {
  background: color($color-a, -8);
  &:before {
    animation: moveHtmlV 16s linear infinite;
    box-shadow: buildComplexBoxShadow("v");
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg);
  }
  &:after {
    animation: moveHtmlH 14s linear infinite;
    box-shadow: buildComplexBoxShadow("h");
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg);
  }
}
body {
  &:before {
    animation: moveBodyV 14s linear infinite;
    box-shadow: buildComplexBoxShadow("v");
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg);
  }
  &:after {
    animation: moveBodyH 16s linear infinite;
    box-shadow: buildComplexBoxShadow("h");
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg);
  }
}

@keyframes moveHtmlH {
  0% {
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateX(0);
  }
  45% {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateX(1000%);
  }
  51% {
    opacity: 0;
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateX(-1000%);
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateX(0);
  }
}
@keyframes moveHtmlV {
  0% {
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateY(0);
  }
  45% {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateY(1000%);
  }
  51% {
    opacity: 0;
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateY(-1000%);
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: rotateX(-45deg) rotateY(-45deg) rotateZ(0deg) translateY(0);
  }
}
@keyframes moveBodyH {
  0% {
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateX(0);
  }
  45% {
    opacity: 1;
  }
  50%{
    opacity: 0;
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateX(-1000%);
  }
  51% {
    opacity: 0;
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateX(1000%);
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateX(0);
  }
}
@keyframes moveBodyV {
  0% {
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateY(0);
  }
  45% {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateY(-1000%);
  }
  51%{
    opacity: 0;
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateY(1000%);
  }
  55% {
    opacity: 1;
  }
  100% {
    transform: rotateX(45deg) rotateY(0deg) rotateZ(45deg) translateY(0);
  }
}

.container {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 1;
}
.card {
  background: white;
  border: 2px solid color($color-a);
  border-radius: 70px 0 0 0;
  opacity: .95;
  padding: 10px;
  position: fixed;
  transform: translateX(-50%) translateY(-50%);
  width: 350px;
  .image {
    background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/186175/charlie-thug.JPG") no-repeat center center/ cover;
    border-radius: 50%;
    display: block;
    float: left;
    height: 120px;
    margin: 0 10px 10px 0;
    width: 120px;
  }
  .info {
    margin-left: 130px;
    width: 200px;
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console