123

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <main class="main">
  <div class="sun"></div>
  <div class="water"></div>
  <div class="cliff">
    <div class="cliff-top"></div>
    <div class="cliff-shadow"></div>
  </div>
  <div class="tree">
    <div class="tree-base"></div>
    <div class="tree-shadow"></div>
  </div>
  <div class="boat">
    <div class="boat-base"></div>
    <div class="boat-mast"></div>
    <div class="boat-sail-1"></div>
    <div class="boat-sail-2"></div>
    <div class="boat-sail-3"></div>
    <div class="boat-shadow"></div>
  </div>
</main>
            
          
!
            
              
@function generateStars ($amount) {
  $starMap: ();
  @for $i from 1 through $amount {
    $starMap: append($starMap, unquote('#{random(550)}px #{random(550)}px #fff'), comma); 
  }

  @return $starMap;

}

body {
  background-color: #234;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.main {
  background-color: #664653;
  width: 550px;
  height: 550px;
  position: relative;
  overflow: hidden;
  box-shadow: 10px 10px 20px 0px rgba(0,0,0,0.3);
  z-index: 1;
  
  &:after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 2px;
    height: 2px;
    background: transparent;
    opacity: 0.4;
    box-shadow: generateStars(400);
  }
}

.water, .sun, .cliff, .cliff-top, .tree, .tree-shadow, .tree-base, .boat  {
  position: absolute;
}

.water {
  background-color: #664653;
  width: 100%;
  height: 60px;
  bottom: 0;
}

.sun {
  background-color: #F8FCFB;
  width: 240px;
  height: 240px;
  left: 80px;
  top: 180px;
  border-radius: 100%;
  box-shadow: 
    0px 0px 50px 10px rgb(255, 166, 132),
    0px 0px 0 90px rgba(218,113,65,0.7),
    0px 0px 0 170px rgba(218,113,65,0.3),
    0px 0px 0 250px rgba(218,113,65,0.2);
}

.cliff {
  width: 380px;
  right: 0;
  bottom: 0;
  height: 200px;
}

.cliff-top {
  border-top: 120px solid #678EC5;
  border-right: 3000px solid transparent;
  border-bottom: 0 solid transparent;
  border-left: 320px solid transparent;
}

.cliff-shadow {
  border-top: 224px solid #111E31;
  border-right: 0 solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 77px solid transparent;
}

.tree {
  right: 65px;
  bottom: 170px;
  width: 200px;
  height: 180px;
  z-index: 1;
}

.tree-base {
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(65deg, #111F03 8%, transparent 8.5%),
    linear-gradient(-65deg, #28420d 8%, transparent 8.5%),
    linear-gradient(65deg, #244408 10%, transparent 10.5%),
    linear-gradient(-65deg, #46612E 10%, transparent 10.5%),
    linear-gradient(65deg, #0a1302 12%, transparent 12.5%),
    linear-gradient(-65deg, #28420d 12%, transparent 12.5%);

  background-position:
    100px 80px,
    100px 80px,
    100px 110px,
    100px 110px,
    100px 140px,
    100px 140px;
}

.tree-base:before,
.tree-shadow:before {
  content: "";
  position: absolute;
  width: 10px;
  height: 60%;
  bottom: 0;
  left: calc(50% - 6px);
  background-color: #654415;
  z-index: -1;
  box-shadow: -5px 0 inset rgba(0,0,0,0.3);
}

.tree-shadow {
  opacity: 0.5;
  top: -2px;
  left: -1px;
  z-index: -1;
  transform-origin: bottom;
  transform: rotate(114deg) skew(7deg, 35deg) scale(0.5, 1.5);
  filter: blur(1px);
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(65deg, #000 8%, transparent 15.5%),
    linear-gradient(-65deg, #000 8%, transparent 15.5%),
    linear-gradient(65deg, #000 10%, transparent 15.5%),
    linear-gradient(-65deg, #000 10%, transparent 15.5%),
    linear-gradient(65deg, #000 12%, transparent 15.5%),
    linear-gradient(-65deg, #000 12%, transparent 15.5%);

  background-position:
    100px 80px,
    100px 80px,
    100px 110px,
    100px 110px,
    100px 140px,
    100px 140px;
}

.tree-shadow:before {
  background-color: #000;
}

.boat {
  width: 100px;
  height: 100px;
  bottom: 60px;
  left: 10px;
}

.boat-base {
  position: absolute;
  border-right: 16px solid transparent;
  border-top: 25px solid #151C30;
  border-left: 6px solid transparent;
  width: 100%;
  bottom: 0;
}


.boat-shadow {
  transform: scale(1, -0.5);
  opacity: 0.4;
  position: absolute;
  border-right: 16px solid transparent;
  border-top: 25px solid #151C30;
  border-left: 6px solid transparent;
  width: 100%;
  bottom: -18px;
  filter: blur(4px);
}

.boat-mast {
  width: 4px;
  height: 30px;
  position: absolute;
  background-color: #151C30;
  top: 45px;
  left: 40px;
  box-shadow: 
    28px 0 0 #151C30,
    52px 0 0 #151C30;
}

.boat-sail-1 {
  width: 0;
  height: 40px;
  border-right: 14px solid transparent;
  border-bottom: 64px solid #151C30;
  border-top: 0 solid transparent;
  border-left: 46px solid transparent;
  position: absolute;
  top: -35px;
  left: 5px;
  transform: rotate(5deg);
} 

.boat-sail-2 {
  width: 0;
  height: 30px;
  border-right: 14px solid transparent;
  border-bottom: 56px solid #151C30;
  border-top: 0 solid transparent;
  border-left: 42px solid transparent;
  position: absolute;
  top: -17px;
  left: 30px;
  transform: rotate(-6deg);
}

.boat-sail-3 {
  width: 0;
  height: 30px;
  border-right: 27px solid transparent;
  border-bottom: 56px solid #151C30;
  border-top: 0 solid transparent;
  border-left: 0px solid transparent;
  position: absolute;
  top: -15px;
  left: 83px;
  transform: rotate(-6deg);
}
            
          
!
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.

Console