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.

            
              .box
  .calculator
    .screen 
      p 8675309
    .button-pad
      .buttons.button-7
        .wing.wing-left
        .wing.wing-right
        - for (var s = 1; s<7; s++){
        div(class="dot dot-"+s)
        -}
        .dot.dot-8
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-8
        .wing.wing-left
        .wing.wing-right
        - for (var s = 1; s<8; s++){
        div(class="dot dot-"+s)
        -}
        .dot.dot-9
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-9
        .wing.wing-left
        .wing.wing-right
        - for (var s = 1; s<10; s++){
        div(class="dot dot-"+s)
        -}
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-div
        .wing
          .dots.div-top
          .line.line1
          .dots.div-bot
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-4
        .wing.wing-left
        .wing.wing-right
        .dot.dot-1
        .dot.dot-3
        .dot.dot-7
        .dot.dot-9
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-5
        .wing.wing-left
        .wing.wing-right
        - for (var s = 1; s<10; s+=2){
        div(class="dot dot-"+s)
        -}
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-6
        .wing.wing-left
        .wing.wing-right
        .dot.dot-1
        .dot.dot-3
        .dot.dot-4
        .dot.dot-6
        .dot.dot-7
        .dot.dot-9
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-mult
        .wing
          .line.line1
          .line.line2
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-1
        .wing.wing-left
        .wing.wing-right
        .dot.dot-5
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
          
      .buttons.button-2
        .wing.wing-left
        .wing.wing-right
        .dot.dot-1
        .dot.dot-3
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-3
        .wing.wing-left
        .wing.wing-right
        .dot.dot-1
        .dot.dot-8
        .dot.dot-3
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-sub
        .wing
          .line.line1
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-0
        .wing.wing-left
        .wing.wing-right
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-deci
        .wing.wing-left
        .wing.wing-right
        .decimal
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-eq
        .wing
          .line.equal-top
          .line.equal-bottom
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
      .buttons.button-add
        .wing
          .line.line1
          .line.line2
        .head
          .eyes.eye-left
          .eyes.eye-right
          .middleHead |
            
          
!
            
              // colours
$bg: #8e9e31;
$screen:#c4c2c4;
$buttonPad:#566c4b;

//bugs
$red: #fc4a46;//numbers
$green:#B0EB41;//operators
$blue:#2B9398;//equal
$black: #1d1d1d;
$gold:#f2b35e;

$bug:100px;

$x: red;
$calc:#63775a;
//shapes & sizes
$circle: 50%;
$rounded: 50px;
$size: 100px;
@mixin wh($w, $h) {
    width: $w;
    height: $h;
}
@mixin position($t, $l) {
    top: $t;
    left: $l;
}
@keyframes twitch {
  0% { transform: rotate(15deg); }
  100%{ transform: rotate(-15deg); }
}
@keyframes twitch2 {
  0% { transform: rotate(75deg); }
  100%{ transform: rotate(105deg); }
}
@keyframes twitch3 {
  0% { transform: rotate(30deg); }
  100%{ transform: rotate(60deg); }
}
html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
*, *:before, *:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
  }
body{
  display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
  background: $bg;
}
p{
  font-family: 'Iceberg', cursive;
  font-size: 5rem;
  letter-spacing:0.5rem;
}
.box{
  position: relative;
  width: 450px;
  height: 600px;
  background: none;
  & * {
		position: absolute;
	}
}

.calculator{
  top: 1%;
  left: 1%;
  @include wh($size*5, $size*6);
  background: $calc;
  border-radius: 5px;

}
.screen, .button-pad{
  width: 90%;
  left: 5%;
  border-radius: 10px;
}
.screen{
  background-color: $screen;
  display: flex;
  height: 15%;
  justify-content: flex-end;
  padding-right:1%;
  padding-top:1%;
  top: 2%;
}
.button-pad{
  background-color:$buttonPad;
  width: 90%;
  height: 78%;
  top: 19%;
  padding:1%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  position:relative;
  overflow:hidden;
}
//bug buttons
.buttons {
  position: relative;
  display:flex;
  justify-content: space-around;
  align-items: center;
  @include wh($bug, $bug);
  background-color: $black;
  border-radius: $circle;
  margin: 1%;
  padding:1px;
  &:hover{
    animation: twitch 65ms ease 50ms 5 alternate;
  }
}
.wing{
  position: relative;
  height: $bug/1.1;
  width: $bug/2.3;
}
.wing-left{
  border-bottom-left-radius: $bug * 2;
  border-top-left-radius: $bug * 2;
}
.wing-right{
  border-bottom-right-radius: $bug * 2;
  border-top-right-radius: $bug * 2;
}
@for $i from 0 through 9{
  .#{button}-#{$i}, .button-deci{
    .wing{
      background-color:$red;
    }
  }
}
.button-add, .button-sub, .button-mult, .button-div{
  .wing{
    background-color:$green;
    @include wh($bug, $bug);
    border-radius:$circle;
    border:3px solid $black;
    }
}
.button-eq{
  .wing{
    background-color: $blue;
    @include wh($bug, $bug);
    border-radius:$circle;
    border:3px solid $black;
  }

}

.button-sub, .button-div, .button-eq{
  transform:rotate(90deg);
  &:hover{
    animation: twitch2 65ms ease 50ms 5 alternate;
  }
}
.button-mult{
  transform: rotate(45deg);
  &:hover{
    animation: twitch3 65ms ease 50ms 5 alternate;
  }
}
.head{
  position:absolute;
  top:0%;
  background-color:$black;
  height: $bug;
  width: $bug/1.25;
  margin-top:-75px;
  -webkit-clip-path: ellipse(50% 23% at 50% 100%);
  clip-path: ellipse(50% 23% at 50% 100%);
  z-index:2;
}
.eyes{
  @include wh(15px, 15px);
  border-radius:$circle;
  background-color: $gold;
  bottom:1%;
  
}
.eye-left{
  left:10%;
}
.eye-right{
  right:10%;
}
.middleHead{
  display:flex;
  align-items:center;
  justify-content: center;
  @include wh(35px, 35px);
  border-radius:$circle;
  background-color: $black;
  border: 1px solid $gold;
  bottom:1%;
  left:28%;
  color: $gold;
}
.line{
  background-color: $black;
}
.equal-top{
  top:25%;
  left:30%;
  @include wh(15px, 60px);
}
.equal-bottom{
  top:25%;
  right:30%;
  @include wh(15px, 60px);
}
//lines 1 and 2 are either horiz or ver depending on the transform of hte bug
.line1{
  @include wh(15px, 60px);
  top:25%;
  left:42%;
}
.line2{
  @include wh(60px, 15px);
  top:48%;
  left:19%;
}
.dots{
  @include wh(20px, 20px);
  border-radius:$circle;
  background-color: $black;
}
.div-top{
  top:45%;
  left:15%;
}
.div-bot{
  top:45%;
  right:15%;
}
.dot{
  @include wh(18px, 18px);
  border-radius:$circle;
  background-color: $black;
}
.dot-1{
  @include position(27%, 11%)
}
.dot-2{
  @include position(27%,41%)
}
.dot-3{
  @include position(27%, 70%)
}
.dot-4{
  @include position(50%, 7%)
}
.dot-5{
  @include position(50%, 41%)
}
.dot-6{
  @include position(50%, 74%)
}
.dot-7{
  @include position(72%, 20%)
}
.dot-8{
  @include position(75%, 40%)
}
.dot-9{
  @include position(72%, 60%)
}
.decimal{
  @include wh(25px, 25px);
  border-radius:$circle;
  background-color: $blue;
  top:60%;
}




// @media all and (max-width: 600px) {
//    .box{
//     width: 300px;
//     height: 250px;
//   }
//   .subject{
//     @include wh($size/2, $size/2);
//   }
  
// }
            
          
!
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