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

              
                .image__wrapper
  .image__container
    .word__container
      .word
        span.letter S
        span.letter t
        span.letter a
        span.letter y
        span.letter 
        span.letter a
        span.letter t
      .word
        span.letter H
        span.letter o
        span.letter m
        span.letter e
    .inner-image__container
      .flower
        .stem
        .bulb
          .bulb__bottom
          .bulb__top
            .petal
            .petal.petal--reverse
            .petal
            .petal.petal--reverse
            .petal
            .petal.petal--reverse
            .petal
        .leaf
        .leaf.leaf--reverse
        .leaf.leaf--transparent
      .flower.flower--reverse
        .stem
        .bulb
          .bulb__bottom
          .bulb__top
            .petal
            .petal.petal--reverse
            .petal
            .petal.petal--reverse
            .petal
            .petal.petal--reverse
            .petal
        .leaf
        .leaf.leaf--reverse
        .leaf.leaf--transparent
      .star__container
        .star.twinkle
        .star.twinkle
        .star.star--large.twinkle
        .star.star--small.twinkle
      .moon.twinkle
      .dot__container
        .dot.twinkle
        .dot.twinkle
      .toilet-paper
        .roll-edge.roll-edge--left
          .roll-outer
        .roll
        .roll-under
        .sheet
          .sheet-border
            .circle
            .circle
            .circle
            .circle
            .circle
            .circle
            .circle
            .circle
            .circle
        .roll-edge
          .roll-outer.roll-outer--right
            .roll-inner
a.link(href='https://dribbble.com/shots/10858937-Stay-At-Home') Original Design: Lizzie Morgan


              
            
!

CSS

              
                $bg: #f6bcd4;
$letters: #ed6c61;
$stem: #51b9a5;
$dark-accent: #212022;
$light-accent: #FFFFFF;

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

@mixin transition {
  @for $i from 1 through 7 {
    &:nth-child(#{$i}) {
      left: #{($i * (100% / 6) - (100% / 6) - (100% / 12) - 2)};
    }
  }
}
@mixin transform($transforms) {
	-webkit-transform: $transforms;
	-moz-transform: $transforms;
	-ms-transform: $transforms;
	transform: $transforms;
}

@mixin rotated-text($num-letters: 100, $angle-span: 180deg, $angle-offset: 0deg) {
  $angle-per-char: $angle-span / $num-letters;
  @for $i from 1 through $num-letters {
    &:nth-child(#{$i}) {
      @include transform(rotate($angle-offset + $angle-per-char * $i))
        }
  }
}

body {
  background: $bg;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  padding: 50px;
  font-family: 'Sahitya', serif;
  font-weight: 700;
  
}

.image__wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80%;
  max-width: 80vh;
}
.image__container {
  width: 100%;
  border-radius: 50%;
}

.image__container:after {
   content: "";
  display: block;
  padding-bottom: 100%;
}

.word__container, .inner-image__container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}


.moon {
  position: absolute;
  top: 35%;
  left: 20%;
  transform: rotate(25deg);
  width: 10%;
height: 10%;
border-radius: 50%;
box-shadow: -2.5vh 2.5vh 0 0 $light-accent;
  @media screen and (orientation: portrait) {
  box-shadow: -2.5vw 2.5vw 0 0 $light-accent;
  }
}
.star {
   position:absolute;
   height:6%;
   width:6%;
  
  &:after {
    content: "";
    position: absolute;
    top: -50%;
    bottom: -50%;
    right: -50%;
    left: -50%;
    background-image:
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 70%);
    display: block;
    border-radius: 50%;
    opacity: 0;
  }
  
  &:before {
    content: "";
    position:absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
  background: white;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  }
}

.star:nth-of-type(1) {
  top: 18%;
  left: 35%;
}

.star:nth-of-type(2) {
  top: 50%;
  left: 80%;
}

.star.star--large {
  left: 60%;
  top: 68%;
  width: 10%;
  height: 10%;
}

.star.star--small {
  width: 4%;
  height: 4%;
  top: 80%;
  left: 45%;
}

.dot {
  position: absolute;
  width: 3%;
  height: 3%;
  background: $light-accent;
  border-radius: 50%;
}

.dot:nth-child(1) {
  left: 65%;
  top: 22%;
}

.dot:nth-child(2) {
  left: 18%;
  top: 65%;
}



.flower {
  position: absolute;
  width: 35%;
  transform: translate(-50%, -50%) rotate(-5deg);
  left: 95%;
  top: 55%;
  
  &:after {
    content: "";
    display: block;
    padding-bottom: 100%;
  }
}

.flower--reverse {
  left: 5%;
  transform: translate(-50%, -50%)  rotate(5deg) scaleX(-1);
}

// Bulb 
.bulb {
  position: absolute;
  width: 30%;
  left: 50%;
  transform: translateX(-50%);
  
  &:after {
    content: "";
    display: block;
    padding-bottom: 100%;
  }
}

.bulb__top {
  width: 100%;
  height: 30%;
  position: absolute;
  overflow: hidden;
  z-index: 1000;
}

.petal {
  transform: translateY(7%);
  width: calc(100% / 5);
  background: #ed6c61;
  position: absolute;
  border-radius: 50%;
  z-index: 10;
  @include transition;
}

.petal--reverse {  
  width: calc(100% / 6);
  transform: translateX(10%);
  z-index: 11;
  background: $bg;
  border-radius: 50% 50% 50% 50% / 0% 0% 100% 100% ;
}

.petal:after {
  content: "";
  display: block;
  padding-bottom: 120%;
}

.bulb__bottom {
  width: 100%;
  height: 75%;
  background: $letters;
  position:absolute;
  top: 10%;
}

// Stem
.stem {
  width: 20%;
  height: 80%;
  position: absolute;
  top: 20%;
  left: 37%;
  transform: rotate(3deg);
  
  &:after {
    content: "";
    display: block;
    position: absolute;
    background: $bg;
    top: 0;
    bottom:0;
    left: 0;
    right: 0;
    border-radius: 100% 0% 100% 0% / 100% 0% 100% 0% ;
    transform: rotate(-5deg) translateX(-38%);
  }
}

.stem:before {
    content: "";
    display: block;
    position: absolute;
    background: $stem;
    top: 0;
    bottom:0;
    left: 0;
    right: 0;
    border-radius: 100% 0% 100% 0% / 100% 0% 100% 0% ;
    transform: rotate(-5deg) translateX(-20%);
}

.leaf {
  width: 20%; 
  height: 20%; 
  box-sizing: border-box;
  position: absolute;
  background: $stem;
  left: 50%;
  top: 15%;
  border-radius: 0% 100% 0% 100% / 15% 85% 15% 85% ;
  border-top: 6px solid $dark-accent;
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  border-bottom: none;
  transform: rotate(2deg) translateX(calc(-100% + 4px));
}

.leaf--transparent {
  background: transparent;
  border: 6px solid $stem;
  top: 50%;
  left: 48%;
  position: absolute;
}

.leaf--reverse {
  transform: scaleX(-1) rotate(-2deg) translateX(4px);
}

// Words


.word {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.letter {
  text-transform: uppercase;
  color: $letters;
  font-size: 14vh;
  height: 100%;
  width: 15%;
  top: 0;
  left: 50%;
  position: absolute;
  transform-origin: 50% 50%;
  display: flex;
  justify-content: center;
  
  @media screen and (orientation: portrait) {
    font-size: 11vw;
  }
}

.word:nth-child(1) {
  
  top: -10%;
  bottom: -10%;
  .letter:nth-child(1) {
    transform: translateX(-50%) rotate(-53deg);
  }
  .letter:nth-child(2) {
    transform: translateX(-50%) rotate(-36deg);
  }
  .letter:nth-child(3) {
    transform: translateX(-50%) rotate(-18deg);
  }
  .letter:nth-child(4) {
    transform: translateX(-50%) rotate(0deg);
  }
  .letter:nth-child(5) {
    transform: translateX(-50%) rotate(18deg);
  }
  .letter:nth-child(6) {
    transform: translateX(-50%) rotate(36deg);
  }
  .letter:nth-child(7) {
    transform: translateX(-50%) rotate(53deg);
  }
}

.word:nth-child(2) {
  
  top: -10%;
  bottom: -10%;
  .letter {
    align-items: flex-end;
  }
  
  .letter:nth-child(1) {
    transform: translateX(-50%) rotate(27deg);
  }
  .letter:nth-child(2) {
    transform: translateX(-50%) rotate(9deg);
  }
  .letter:nth-child(3) {
    transform: translateX(-50%) rotate(-9deg);
  }
  .letter:nth-child(4) {
    transform: translateX(-50%) rotate(-27deg);
  }
}

.toilet-paper {
  position: absolute;
  width: 40%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  &:after {
    content: "";
    display: block;
    padding-bottom: 100%;
  }
}
.roll {
  position: absolute;
  left: 20%;
  width: 60%;
  height: 75%;
  background: $light-accent;
} 

.roll-under{
  
  position: absolute;
  left: 20%;
  top: 45%;
  width: 60%;
  height: 30%;
  background: $stem;

}
.roll-edge {
  position: absolute;
  left: auto;
  right:0;
  height: 75%;
  width: 40%;
}

.roll-edge--left {
  left: 0;
}

.roll-outer {
  background: $light-accent;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  
}

.roll-outer--right:before {
  
  position: absolute;
    top: -1%;
    content: "";
    background-image: linear-gradient(to right, #212022, #212022 50%, transparent 50%, transparent 100%);
    width: 102%;
    height: 102%;
    left: -1.5%;
    border-radius: 0;
    border-bottom-left-radius: 50%;
    border-top-left-radius: 50%;
  transform: translateZ(-1px);
}
.roll-inner {
  width: 25%;
  height: 30%;
  background: $dark-accent;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sheet {
  position: absolute;
  left: 0%;
  top: 37.5%;
  width: 60%;
  height: 62%;
  background: $light-accent;
}

.sheet-border {
  position: absolute;
  top: 30%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  .circle {
    width: calc(100% / 18);
    background: $letters;
    border-radius: 50%;
    
    &:after {
      content: "";
      display: block;
      padding-bottom: 100%;
    }
  }
}

@mixin twinkles($time) {
  -webkit-animation: twinkle $time infinite;
  -moz-animation:    twinkle $time infinite;
  -o-animation:      twinkle $time infinite;
  animation:         twinkle $time infinite;
}

.star.twinkle:nth-child(1) {
  @include twinkles(2.5s);
}
.star.twinkle:nth-child(2) {
  @include twinkles(5s);
}
.star.twinkle:nth-child(3) {
  @include twinkles(4s);
}
.star.twinkle:nth-child(4) {
  @include twinkles(6s);
}
.moon.twinkle {
  @include twinkles(5.6s);
}
.dot.twinkle:nth-child(1) {
  @include twinkles(3.7s);
}
.dot.twinkle:nth-child(2) {
  @include twinkles(4.8s);
}

@-webkit-keyframes twinkle {
  0%   { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}
@-moz-keyframes twinkle {
  0%   { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}
@-o-keyframes twinkle {
  0%   { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes twinkle {
  0%   { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.link {
  position: absolute;
  bottom: 5px;
  right: 5px;
  color: $letters;
  font-size: 14px;
}
              
            
!

JS

              
                
              
            
!
999px

Console