Pen Settings

HTML

CSS

CSS Base

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

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.

Vue

              
                <!---------------------
| Hoverable elements: |
| ---------------------
| 🖱️ Mill blades;     |
| 🖱️ Banner;          |
| 🖱️ Trap door.       |
---------------------->

<template>
  <div id="app">
    <section class="far-hills">
      <div class="cloud cloud_1"></div>
      <div class="cloud cloud_2"></div>
      <div class="cloud cloud_3"></div>
    </section>
    <div class="scene">
      <section class="land">
        <div class="tree tree_pine-1"></div>
        <div class="tree tree_pine-2"></div>
        <div class="tree tree_other-1"></div>
        <div class="tree tree_other-2"></div>
      </section>
      <section class="flying-house">
        <div
          class="red-flag"
          title="Banner"
          :class="[isRedFlagActive ? 'active' : '']"
          @mouseenter="isRedFlagActive = true"
          @mouseleave="isRedFlagActive = false"
        ></div>
        <div
          class="trap-door"
          title="Trap door"
          :class="[isTrapDoorActive ? 'active' : '']"
          @mouseenter="isTrapDoorActive = true"
          @mouseleave="isTrapDoorActive = false"
        ></div>
        <div
          class="mill"
          title="Mill blades"
          :class="[isMillActive ? 'active' : '']"
          @mouseenter="isMillActive = true"
          @mouseleave="isMillActive = false"
        ></div>
        <div class="smoke"></div>
      </section>
    </div>
  </div>
</template>

<script>
export default {
  data: () => ({
    isRedFlagActive: false,
    isTrapDoorActive: false,
    isMillActive: false
  })
};
</script>

<style lang="scss">
// assets based on kenney's tiles:
// 🔗 https://opengameart.org/users/kenney

// -----------------------------------------------
// | Core
// -----------------------------------------------
html {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cursor-default.png),
    default;
}

.scene {
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

// -----------------------------------------------
// | Far Hills
// -----------------------------------------------
.far-hills {
  z-index: 1;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  // gradient from 🔗 https://gradienta.io/faded-sun
  background: radial-gradient(
      ellipse farthest-side at 76% 77%,
      rgba(245, 228, 212, 0.25) 0%,
      rgba(255, 255, 255, 0) 0%
    ),
    radial-gradient(circle at 76% 40%, #fef6ec 4%, rgba(255, 255, 255, 0) 4.18%),
    linear-gradient(135deg, #ff0000 0%, #000036 100%),
    radial-gradient(ellipse at 28% 0%, #ffcfac 0%, rgba(98, 149, 144, 0.5) 100%),
    linear-gradient(180deg, #cd6e8a 0%, #f5eab0 69%, #d6c8a2 70%, #a2758d 100%);
  background-blend-mode: normal, normal, screen, overlay, normal;

  &::after {
    content: "";
    border-radius: 50%;
    background-color: rgba(245, 228, 212, 0.25);
    box-shadow: 0 0 2vmin rgba(245, 228, 212, 0.25);
    width: 8vmax;
    height: 3vmax;
    position: absolute;
    top: 76%;
    left: calc(76% - 4vmax);
  }
}

.cloud {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  left: 0;
  opacity: 0.4;

  &_1 {
    width: 40vmin;
    height: 40vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cloud-1.png);
    top: 2vmin;
    animation: animation_cloud-1 12s linear infinite;
  }

  &_2 {
    width: 24vmin;
    height: 24vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cloud-2.png);
    top: 40vmin;
    animation: animation_cloud-2 8s linear infinite;
  }

  &_3 {
    width: 30vmin;
    height: 30vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cloud-3.png);
    top: 20vmin;
    animation: animation_cloud-3 10s linear infinite;
  }
}

// animations
@keyframes animation_cloud-1 {
  0% {
    transform: translateX(calc(100vw + 40vmin));
  }
  100% {
    transform: translateX(-40vmin);
  }
}

@keyframes animation_cloud-2 {
  0% {
    transform: translateX(calc(100vw + 24vmin));
  }
  100% {
    transform: translateX(-24vmin);
  }
}

@keyframes animation_cloud-3 {
  0% {
    transform: translateX(calc(100vw + 30vmin));
  }
  100% {
    transform: translateX(-30vmin);
  }
}

// -----------------------------------------------
// | Land
// -----------------------------------------------
.land {
  width: 56vmin;
  height: 56vmin;
  min-height: 56vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/land.png);
  position: relative;
  margin-bottom: -14vmin;
  animation: animation_land 2s ease-in-out alternate infinite;
}

.tree {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;

  &_pine-1 {
    width: 12vmin;
    height: 12vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/tree_pine-1.png);
    bottom: 26vmin;
    left: 2vmin;
    animation: animation_tree_pine-1 3s ease-in-out alternate infinite;
  }

  &_pine-2 {
    width: 18vmin;
    height: 18vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/tree_pine-2.png);
    bottom: 28vmin;
    left: 24vmin;
    animation: animation_tree_pine-2 3s ease-in-out alternate infinite;
  }

  &_other-1 {
    width: 12vmin;
    height: 12vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/tree_other-1.png);
    bottom: 36vmin;
    left: 38vmin;
    animation: animation_tree_other-1 3s ease-in-out alternate infinite;
  }

  &_other-2 {
    width: 12vmin;
    height: 12vmin;
    background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/tree_other-2.png);
    bottom: 24vmin;
    left: 24vmin;
    animation: animation_tree_other-2 3s ease-in-out alternate infinite;
  }
}

// animations
@keyframes animation_land {
  0% {
    transform: translateY(0) translateX(1vmin);
  }
  100% {
    transform: translateY(-1vmin) translateX(-1vmin);
  }
}

@keyframes animation_tree_pine-1 {
  0% {
    transform: skewX(10deg);
  }
  100% {
    transform: skewX(-5deg);
  }
}

@keyframes animation_tree_pine-2 {
  0% {
    transform: skewX(6deg);
  }
  100% {
    transform: skewX(-4deg);
  }
}

@keyframes animation_tree_other-1 {
  0% {
    transform: skewX(5deg);
  }
  100% {
    transform: skewX(-2deg);
  }
}

@keyframes animation_tree_other-2 {
  0% {
    transform: skewX(5deg);
  }
  100% {
    transform: skewX(-4deg);
  }
}

// -----------------------------------------------
// | Flying House
// -----------------------------------------------
.flying-house {
  width: 50vmin;
  height: 50vmin;
  min-height: 50vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/flying-house.png);
  position: relative;
  margin-bottom: -14vmin;
  animation: animation_flying-house 2s ease-in-out alternate infinite;
  box-shadow: 8vmin 64vmin 14vmin rgba(0, 0, 0, 0.25);
}

.trap-door {
  z-index: 1;
  width: 7.2vmin;
  height: 7.2vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/trap-door.png);
  position: absolute;
  top: 14.02vmin;
  left: 14.14vmin;
  transition: 0.2s ease-in-out;
  transition-property: transform, filter;
  cursor: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cursor-pointer.png),
    pointer;

  &.active {
    transform: translateY(-4vmin);
    filter: drop-shadow(0 0 2px #000);
  }
}

.red-flag {
  z-index: 2;
  width: 7.2vmin;
  height: 7.2vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/red-flag.png);
  position: absolute;
  top: 22.8vmin;
  left: 4.2vmin;
  transition: filter 0.2s ease-in-out;
  animation: animation_red-flag 2s ease-in-out alternate infinite;
  cursor: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cursor-pointer.png),
    pointer;

  &.active {
    animation-play-state: paused;
    filter: drop-shadow(0 0 2px #000);
  }
}

.mill {
  z-index: 3;
  width: 26vmin;
  height: 26vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/mill.png);
  position: absolute;
  top: 32.6vmin;
  left: 14.4vmin;
  transition: filter 0.2s ease-in-out;
  animation: animation_mill 5s linear infinite;
  cursor: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/cursor-pointer.png),
    pointer;

  &.active {
    animation-play-state: paused;
    filter: drop-shadow(0 0 1px #000);
  }
}

.smoke {
  z-index: 4;
  width: 10vmin;
  height: 10vmin;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(https://raw.githubusercontent.com/elsemeow/cdn/main/img/cdpn/gOwYMNR/smoke.png);
  position: absolute;
  top: 22.4vmin;
  right: 10vmin;
  animation: animation_smoke 3s linear infinite;
}

// animations
@keyframes animation_flying-house {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-3vmin);
  }
}

@keyframes animation_red-flag {
  0% {
    transform: skewX(-15deg);
  }
  100% {
    transform: skewX(10deg);
  }
}

@keyframes animation_mill {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes animation_smoke {
  0% {
    opacity: 0.7;
    transform: translateY(0) skewX(-15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-8vmin) skewX(10deg);
  }
}
</style>

              
            
!
999px

Console