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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="wrap">
  <div class="main">
  <div id="A" class="bg1"></div>
  <div id="B"class="bg2"></div>
  <div id="C" class="bg3"></div>
  <div id="D" class="bg4"></div>
  <div class="container">
    <div id="eye">
      <div class="iris"></div>
    </div>
  </div>
</div>
</div>
              
            
!

CSS

              
                // EYE

.container {
  position: relative;
  display: block;
  z-index: 5;
  margin-top: -450px;
  margin-left: 150px;
}

#eye {
  width: 300px;
  height: 300px;
  border-radius: 100%;
  background: radial-gradient(circle at 50% 50%, #FFFFFF, #e0d0d0 10%, #ede4e1 100%, #edd6ce 100%);
  position: relative;
  z-index: 1;
  &:before {
    content: "";
    position: absolute;
    top: 1%;
    left: 5%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 33%, #FFFFFF, #f9f9f9 10%, #efeae3 80%, #000 100%);
    filter: blur(5px);
    z-index: 2;
  }
  &:after {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 60%, red 120%);
    background-position: 0 0;
    border-radius: 100%;
    z-index: 3;
    opacity: .4;
  }
}

.iris {
  position: absolute;
  display: block;
  z-index: 4;
  width: 100px;
  height: 100px;
  border-radius: 100%;
  background: radial-gradient(circle at 50% 50%, #006600 0%, #19A21A 30%, #006600 100%);
  transform: translate(100px, 100px) skew(0,0);
    &:before {
      content: "";
      display: block;
      position: absolute;
      width: 37.5%;
      height: 37.5%;
      border-radius: 50%;
      top: 31.25%;
      left: 31.25%;
      background: black;
    }
    &:after {
      content: "";
      display: block;
      position: absolute;
      width: 31.25%;
      height: 31.25%;
      border-radius: 50%;
      top: 18.75%;
      left: 18.75%;
      background: rgba(255, 255, 255, 0.2);
  }
}

// BACKGROUND

.wrap {
  display: block-inline;
  margin: 100px 200px;
}

.main {
  width: 600px;
  height: 600px;
  display: grid;
  grid-template-columns: 300px 300px;
  grid-template-rows: 300px 300px;
  grid-template-areas: 
    "A B"
    "C D";
    &:before {
    content: '';
    z-index: 6;
    position: absolute;
    width: 280px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    top: 92%;
    left: 360px;
    opacity: .1;
    filter: blur(1px);
  }
}

.bg1 {
  grid-area: A;
}

.bg2 {
  grid-area: B;
}

.bg3 {
  grid-area: C;
}

.bg4 {
  grid-area: D;
}

.bg1, .bg2, .bg3, .bg4 {
  background: transparent;
  width: 100%;
  height: 300px;
  border: none;
  position: relative;
  z-index: 0;
}

// ANIMATION 

.main:before {
  animation: shadow 5s infinite;
}

@keyframes shadow {
  0%, 100% {
    opacity: .1;
    width: 280px;
    left: 360px;
    filter: blur(3px);
  }
  50% {
    opacity: .3;
    width: 250px;
    left: 380px;
    filter: blur(1px);
  }
}

.container {
  animation: float 5s infinite;
}

@keyframes float {
  0%, 100% {
    margin-top: -450px
  }
  50% {
    margin-top: -430px
  }
}

#eye:after {
  transition: background-position 1s, opacity .45s;
}


.iris {
  transition: transform 1s; 
}

.iris:after {
  transition: width 1s, height 1s, background 1.5s;
}

.iris:before {
  transition: width 1.2s, height 1.2s, top 1.1s, left 1.1s;
}

.container {
  #eye {
    transition: background 1s, margin-top .2s, height .2s, filter 1s;
  }
}

// ACTION AREA

// IRIS 
// AREAS

.bg1 {
  &:hover ~ .container #eye .iris {
    transform: translate(50px, 50px) skew(-10deg, -5deg);
  }
}

.bg1 {
  &:hover ~ .container #eye .iris:after {
    width: 38.25%;
    height: 38.25%;
    background: rgba(255, 255, 255, 0.3);
  }
}

.bg2 {
  &:hover ~ .container #eye .iris {
    transform: translate(155px, 50px) skew(15deg, 5deg);
  }
}

.bg2 {
  &:hover ~ .container #eye .iris:after {
    width: 38.25%;
    height: 38.25%;
    background: rgba(255, 255, 255, 0.3);
  }
}

.bg3 {
  &:hover ~ .container #eye .iris {
    transform: translate(60px, 150px) skew(10deg, 5deg);
  }
}

.bg3 {
  &:hover ~ .container #eye .iris:after {
    width: 25.25%;
    height: 25.25%;
    background: rgba(255, 255, 255, 0.1);
  }
}

.bg4 {
  &:hover ~ .container #eye .iris {
    transform: translate(145px, 145px) skew(-10deg, -5deg);
  }
}

.bg4 {
  &:hover ~ .container #eye .iris:after {
    width: 25.25%;
    height: 25.25%;
    background: rgba(255, 255, 255, 0.1);
  }
}

.bg1, .bg2, .bg3, .bg4 {
  &:hover ~ .container #eye .iris:before {
      width: 30.5%;
      height: 30.5%;
  }
}

//CENTER 

.iris {
  &:hover:before {
      width: 47.5%;
      height: 47.5%;
      top: 26.25%;
      left: 26.25%;
  }
}

// SCLERA 
// CENTER 
.container {
  &:active #eye {
    background: #e25656;
    margin-top: -10px;
    height: 290px;
    filter:sepia(10%);
  }
  &:active #eye .iris:before {
    width: 27.5%;
    height: 27.5%;
      top: 36.25%;
      left: 36.25%;
  }
}

//AREAS
.bg1 {
  &:hover ~ .container #eye:after {
    background-position: -10px -10px;
    opacity: .6;
  }
}

.bg2 {
  &:hover ~ .container #eye:after {
    background-position: 10px -10px;
    opacity: .6;
  }
}

.bg3 {
  &:hover ~ .container #eye:after {
    background-position: -10px 10px;
    opacity: .6;
  }
}

.bg4 {
  &:hover ~ .container #eye:after {
    background-position: 10px 10px;
    opacity: .6;
  }
}

              
            
!

JS

              
                // Colours to remember - WHITE
// background: radial-gradient(circle at 30% 33%, #FFFFFF, #f9f3e8 10%, #e8dcc7 80%, #c17272 100%);

// Colours to remember - RED
// background: radial-gradient(circle at 50% 50%, #f9f3e8, #f9f3e8 10%, #db9292 100%, #c17272 100%);
              
            
!
999px

Console