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 includes JSX processing.

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.

HTML

              
                <div class="container" id="app">

  <div class="murk"></div>

  <div class="title">
    <p id="location"><small>achilles gulf</small></p>
    <p id="sea">the trojan sea</p>
    <h4 id="planet">jupiter</h4 id="planet">
  </div>

  <div class="squids">
    <div class="squid-item" v-for="s in 8" :key="s">
      <squid></squid>
    </div>
  </div>

  <div class="main-squid">
    <squid></squid>
  </div>

</div>

<template id="squid">
  <svg viewBox="0 0 400 200" ref="squid">
    <defs>
      <linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
        <stop offset="20%" stop-color="#181D26" stop-opacity="1%" />
        <stop offset="100%" stop-color="#ff0077" stop-opacity="100%" />
      </linearGradient>

      <filter id="glow">
        <fegaussianblur class="blur" result="coloredBlur" stddeviation="1"></fegaussianblur>
        <femerge>
          <femergenode in="coloredBlur"></femergenode>
          <femergenode in="coloredBlur"></femergenode>
          <femergenode in="coloredBlur"></femergenode>
          <femergenode in="SourceGraphic"></femergenode>
        </femerge>
      </filter>

      <radialGradient cx="40%" r="50%" id="pattern">
        <stop offset="6%" stop-color="#FF0077" />
        <stop offset="30%" stop-color="#181D26" />
        <stop offset="100%" stop-color="#FF0077" />
      </radialGradient>

    </defs>
    <g>
      <polyline id="tentacle" ref="tentacle" v-for="t in 6" :key="t" />
      <!-- <polyline id="tentacle" ref="tentacle" />
                <polyline id="tentacle" ref="tentacle" />
                <polyline id="tentacle" ref="tentacle" />
                <polyline id="tentacle" ref="tentacle" />
                <polyline id="tentacle" ref="tentacle" /> -->
    </g>

    <path id="head" d="M0,30C0,20.56,2.52,11.23,16.328,9.4s23.32,4.76,33.047,11.28,9.727,10.68,0,16.8S30.137,48.53,16.328,47.16,0,39.44,0,30Z" transform="translate(285 43) scale(1.5, 1.9)" fill="url(#pattern)" stroke="none" style="filter:url(#glow)" />
  </svg>
</template>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Raleway:wght@300&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  background-color: #181d26;
  background-image: radial-gradient(circle at top right, #2b3342, #181d26 40%);
  font-family: "Raleway", sans-serif;
}

.container {
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

svg {
  width: 400px;
  height: 200px;
}
svg polyline {
  fill: none;
  stroke: url(#linear);
  stroke-width: 4;
  stroke-linecap: round;
}
svg path {
  stroke: #ff0077;
  stroke-width: 1;
}

.squids {
  width: 1000px;
  height: 1600px;
  position: relative;
  transform: rotateZ(-30deg) translate(100px, -300px);
  will-change: transform;
}

.main-squid {
  width: min-content;
  position: absolute;
  top: 30%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -60%) rotateZ(60deg);
  transform-origin: "50% 50%";
  will-change: transform;
}

.title {
  position: absolute;
  bottom: 25%;
  left: 5%;
  z-index: 10;

  text-transform: uppercase;
}
.title p,
.title h4 {
  color: #dadada;
  font-weight: 300;
}
.title p:nth-child(2) {
  color: #ff0077;
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.squid-item {
  width: min-content;
  position: absolute;
  transform: rotateZ(-90deg);
  will-change: transform;
}

.murk {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  background-image: url("https://www.transparenttextures.com/patterns/stardust.png");
  background-size: 300%;
  background-position: bottom;
  opacity: 0.1;
  animation: bkg 80s infinite;
  z-index: 20;
}

@keyframes bkg {
  from {
    background-position: top;
  }
  to {
    background-position: bottom;
  }
}

              
            
!

JS

              
                const Squid = Vue.component("squid", {
  template: "#squid",

  created() {
    gsap.registerPlugin(MorphSVGPlugin);
  },

  mounted() {
    gsap.set("g", { y: 130 / 2 });

    let svg = this.$refs.squid;
    let tentacles = gsap.utils.toArray(this.$refs.tentacle);
    console.log(tentacles.length);

    tentacles.forEach((tentacle) => {
      let width = gsap.utils.random(300, 340);

      let frequency = gsap.utils.random(1, 3);
      let amplitude = gsap.utils.random(30, 50);

      let segments = 40;
      let interval = width / segments;

      for (let i = 0; i < segments; i++) {
        let norm = i / (segments - 1);
        let point = tentacle.points.appendItem(svg.createSVGPoint());

        point.x = i * interval;
        point.y = amplitude / 3;

        gsap
          .to(point, 1.2, {
            y: -point.y,
            repeat: -1,
            yoyo: true,
            ease: "sine.inOut"
          })
          .progress(norm * frequency);
      }
      gsap.set(tentacle, {
        y: gsap.utils.random(10, 50)
      });
    });

    gsap.to("#head", 2, {
      scale: 2,
      yoyo: true,
      repeat: -1,
      ease: "sine.inOut"
    });
  }
});

new Vue({
  el: "#app",
  components: { Squid },

  methods: {
    squidsRising: function () {
      let squids = gsap.utils.toArray(".squid-item");
      let speed = gsap.utils.random(15, 20);

      squids.forEach((squid, i) => {
        gsap.fromTo(
          squid,
          speed,
          {
            y: 1700,
            x: "random(100, 900)",
            scale: "random(0.3, 0.6)",
            opacity: "random(0.2, 0.6)"
          },
          {
            y: 0,
            repeat: -1,
            delay: i * 1.5,
            repeatRefresh: true
          }
        );
      });
    },

    mainSquidAnimation: function () {
      gsap.to(".main-squid", 2, {
        x: 100,
        y: 10,
        yoyo: true,
        repeat: -1,
        ease: "sine.inOut"
      });
    },

    titleAnimation: function () {
      let tl = gsap.timeline({
        defaults: {
          ease: "pow4.out"
        }
      });

      tl.from("#location", 1, { y: 50, opacity: 0, delay: 5 })
        .from("#sea", 1, { y: 50, opacity: 0 }, "-=.5")
        .from("#planet", 0.8, { y: 50, opacity: 0 });
    }
  },

  mounted() {
    this.squidsRising();
    this.mainSquidAnimation();
    this.titleAnimation();
  }
});

              
            
!
999px

Console