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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              .phone
  .screen
    .notification Give it up man, she's πŸ‘»ing you
    .header Future Wife
    .texts
      .blocker
      .text I had a good time the other day!
      .text Been thinking about you 😝
      .text How was your day?
      .text 🐧
      .text Wanna get dinner?
      .text Lunch?
      .text Breakfast?
      .text Coffee?
      .text 🐧
      .text How was work?
      .text I saw a pretty cloud today!
      .text You're prettier...
      .text Phone dead?
      .text 🐧
      .text Miss u
    .keyboard
      .input
      .row qwertyuiop
      .row asdfghjkl
      .row zxcvbnm
      .row
.victim
  .head
    .eyes
      .eye
      .eye
        .tear
    .mouth
  .body
    .arm.left
    .arm.right
    .mobile
    .foot.left
    .foot.right
            
          
!
            
              $white: #fff;
$black: #272526;
$lightgray: #EFEFEF;
$lightpurple: #948FB3;
$purple: #6F58D1;
$darkpurple: #2B2067;
$lightpink: #FFBEFA;
$pink: #F2389C;
$orange: #FE8771;
$blue: #1CA1F2;

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: $lightpink;
  font-family: 'Lato', sans-serif;
}

.phone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: $black;
  width: 250px;
  height: 420px;
  border-radius: 20px;
  &::after {
    display: block;
    content: '';
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    border: 3px solid #fff;
    border-radius: 50%;
  }
  .screen {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 40px auto 0;
    background: $white;
    width: 220px;
    height: 340px;
    border-radius: 5px;
    .notification {
      position: absolute;
      left: 50%;
      transform: translate(-50%, 3px);
      padding: 10px;
      width: 86%;
      height: 60px;
      background: rgba(255, 255, 255, .95);
      border: 1px solid $lightgray;
      border-radius: 5px;
      box-shadow: 0 5px 5px -5px $purple;
      box-sizing: border-box;
      font-size: 14px;
      opacity: 0;
      z-index: 20;
      animation: new-notification 10s;
      animation-delay: 15s;
      &::before {
        display: block;
        content: 'Buddy';
        font-weight: bold;
      }
    }
    .header {
      width: 100%;
      height: 45px;
      padding: 12px;
      background: linear-gradient(135deg, $purple 55%, $purple 55%, $darkpurple 160%);
      box-sizing: border-box;
      color: $white;
      font-weight: bold;
      text-align: center;
    }
    .texts {
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 5px;
      width: 100%;
      height: 170px;
      background: linear-gradient(to bottom, $white 0%, $white 75%, $lightgray 120%);
      box-sizing: border-box;
      overflow: hidden;
      .blocker {
        width: 100%;
        height: 150px;
        background: transparent;
      }
      .text {
        visibility: visible;
        opacity: 1;
        align-self: flex-end;
        margin: 3px 3px 0;
        padding: 5px;
        max-width: 80%;
        background: $pink;
        border-top-left-radius: 8px;
        border-bottom-left-radius: 8px;
        box-sizing: border-box;
        box-shadow: 0 3px 5px -3px $pink;
        color: $white;
        animation: text-bubble 10s cubic-bezier(.5, 0, .5, 1) backwards;
        &:first-child {
          border-top-right-radius: 8px;
        }
        &:last-child {
          border-bottom-right-radius: 8px;
        }
      }
      // ------------
      @for $i from 2 through 16 {
        .text {
          &:nth-child(#{$i}) {
            animation-delay: ($i * 2) - 2s;
          }
        }
       }
      // ------------
    }
    .keyboard {
      height: 125px;
      background: $darkpurple;
      color: $white;
      font-size: 16px;
      .input {
        display: flex;
        align-items: center;
        justify-content: space-around;
        width: 100%;
        height: 35px;
        background: white;
        &::before, &::after {
          display: block;
        }
        &::before {
          content: 'Refresh to watch again!';
          width: 180px;
          height: 20px;
          padding: 0 5px;
          border: 2px solid $lightgray;
          border-radius: 20px;
          box-sizing: border-box;
          color: $black;
          font-size: 12px;
          animation: type-refresh 4s backwards;
          animation-delay: 36s;
        }
        &::after {
          content: '⬆';
          width: 20px;
          height: 20px;
          padding: 0px 4.5px;
          background: $pink;
          border-radius: 50%;
          box-sizing: border-box;
          font-size: 12px;
          text-align: center;
        }
      }
      .row {
        position: relative;
        width: 100%;
        margin-left: 6px;
        letter-spacing: 12px;
        text-align: center;
        &:last-child {
          position: relative;
          margin: 5px auto;
          width: 90px;
          height: 22px;
          background: $lightpurple;
          border-radius: 2px;
          font-size: 12px;
          &::before, &::after {
            display: inline-block;
            position: relative;
            margin-top: 2px;
            color: $lightpurple;
            letter-spacing: 0;
          }
          &::before {
            content: '123';
            left: -60px;
          }
          &::after {
            content: 'return';
            right: -65px;
          }
        }
      }
    }
  }
}

@keyframes text-bubble {
  0% {
    visibility: hidden;
    opacity: 0;
    max-height: 0px;
    margin: 0;
    padding: 0;
    transform: scale(0.6);
  }
  9% {
    padding: 5px;
    margin: 3px;
    visibility: visible;
  }
  10% {
    opacity: 1;
    max-height: 170px;
    transform: scale(1);
  }
  100% { 
    opacity: 1;
    max-height: 170px;
    transform: scale(1);
  }
}
@keyframes new-notification {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  5% {
    opacity: 1;
    transform: translate(-50%, 3px);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 3px);
  }
  55% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}
@keyframes type-refresh {
  0% {
    content: '';
  }
  1% {
    content: 'R';
  }
  2% {
    content: 'Re';
  }
  3% {
    content: 'Ref';
  }
  4% {
    content: 'Refr';
  }
  5% {
    content: 'Refre';
  }
  6% {
    content: 'Refres';
  }
  7% {
    content: 'Refresh';
  }
  8% {
    content: 'Refresh t';
  }
  9% {
    content: 'Refresh to';
  }
  10% {
    content: 'Refresh to w';
  }
  11% {
    content: 'Refresh to wa';
  }
  12% {
    content: 'Refresh to wat';
  }
  13% {
    content: 'Refresh to watc';
  }
  14% {
    content: 'Refresh to watch';
  }
  15% {
    content: 'Refresh to watch a';
  }
  16% {
    content: 'Refresh to watch ag';
  }
  17% {
    content: 'Refresh to watch aga';
  }
  18% {
    content: 'Refresh to watch agai';
  }
  19% {
    content: 'Refresh to watch again';
  }
  20% {
    content: 'Refresh to watch again!';
  }
}


////////// ---- Victim ---- //////////

.victim {
  position: absolute;
  bottom: 0;
  right: 10%;

  .head {
    position: relative;
    display: flex;
    width: 140px;
    height: 120px;
    background: $black;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: 5;
    &::before, &::after {
      display: block;
      content: '';
      position: relative;
      top: 25px;
      width: 60%;
      height: 75%;
      background: $white;
      border-radius: 70% 70% 70% 70% / 70% 70% 70% 70%;
    }
    &::before {
      left: 25px;
      transform: rotate(-50deg);
    }
    &::after {
      right: 25px;
      transform: rotate(50deg);
    }
    .eyes {
      display: flex;
      justify-content: space-between;
      position: absolute;
      top: 65px;
      left: 50%;
      transform: translateX(-50%);
      width: 45%;
      z-index: 10;
      .eye {
        position: relative;
        width: 10px;
        height: 6px;
        border: 4px solid $black;
        border-top: 0;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        .tear {
          position: relative;
          top: 3px;
          right: -10px;
          background: $blue;
          width: 6px;
          height: 8px;
          border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
          opacity: 0;
          animation: tear 1s infinite;
          animation-delay: 14s;
        }
      }
    }
    .mouth {
      position: absolute;
      bottom: 30px;
      left: 50%;
      transform: translateX(-50%);
      width: 20px;
      height: 20px;
      background: $orange;
      border-radius: 50% 50% 50% 50% / 30% 30% 60% 60%;
      z-index: 10;
    }
  }

  .body {
    position: relative;
    margin: -70px auto auto;
    width: 120px;
    height: 140px;
    background: $black;
    border-radius: 50% 50% 50% 50% / 60% 60% 20% 20%;
    &::before {
      display: block;
      content: '';
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 80%;
      height: 60%;
      background: $white;
      border-radius: 50% 50% 50% 50% / 60% 60% 20% 20%;
    }
    .arm {
      position: absolute;
      bottom: 50px;
      width: 55px;
      height: 20px;
      background: $black;
      z-index: 15;
      &.left {
        left: 5px;
        border-radius: 50% 80% 80% 50% / 50% 50% 50% 50%;
        transform: rotate(20deg);
        transform-origin: left center;
        animation: left-arm-wiggle 2s infinite;
      }
      &.right {
        right: 5px;
        border-radius: 80% 50% 50% 80% / 50% 50% 50% 50%;
        transform: rotate(-20deg);
        transform-origin: right center;
        animation: right-arm-wiggle 2s infinite;
      }
    }
    .mobile {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      bottom: 30px;
      width: 25px;
      height: 40px;
      background: $black;
      box-shadow: 0 -3px 6px 2px $lightpurple;
      border-radius: 3px;
      z-index: 10;
      animation: phone-wiggle 2s infinite;
      transform-origin: center center;
    }
    .foot {
      position: absolute;
      bottom: 0;
      width: 40px;
      height: 15px;
      background: $orange;
      border-radius: 50px;
      border-bottom-left-radius: 6px;
      border-bottom-right-radius: 6px;
      &.left {
        left: 10px;
      }
      &.right {
        right: 10px;
      }
    }
  }
}

@keyframes tear {
  0% {
    top: 3px;
    left: 5px;
    opacity: 0;
  }
  20% {
    top: 8px;
    left: 5px;
    transform: rotate(-20deg);
  }
  50% {
    left: 10px;
    opacity: 1;
  }
  85% {
    top: 30px;
    left: 8px;
    transform: rotate(20deg);
  }
  100% {
    top: 30px;
    opacity: 0;
  }
}
@keyframes phone-wiggle {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }
  10% {
    transform: translateX(-50%) rotate(2deg);
  }
  20% {
    transform: translateX(-50%) rotate(0deg);
  }
  30% {
    transform: translateX(-50%) rotate(-2deg);
  }
  50% {
    transform: translateX(-50%) rotate(0deg);
  }
  70% {
    transform: translateX(-50%) rotate(2deg);
  }
  80% {
    transform: translateX(-50%) rotate(0deg);
  }
  90% {
    transform: translateX(-50%) rotate(-2deg);
  }
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  
}
@keyframes left-arm-wiggle {
  0% {
    transform: rotate(20deg);
  }
  10% {
    transform: rotate(18deg);
  }
  20% {
    transform: rotate(20deg);
  }
  30% {
    transform: rotate(22deg);
  }
  50% {
    transform: rotate(20deg);
  }
  70% {
    transform: rotate(22deg);
  }
  80% {
    transform: rotate(20deg);
  }
  90% {
    transform: rotate(18deg);
  }
  100% {
    transform: rotate(20deg);
  }
}
@keyframes right-arm-wiggle {
  0% {
    transform: rotate(-20deg);
  }
  10% {
    transform: rotate(-22deg);
  }
  20% {
    transform: rotate(-20deg);
  }
  30% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(-20deg);
  }
  70% {
    transform: rotate(-18deg);
  }
  80% {
    transform: rotate(-20deg);
  }
  90% {
    transform: rotate(-22deg);
  }
  100% {
    transform: rotate(-20deg);
  }
}
            
          
!
999px
πŸ•‘ One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console