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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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">

  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="600px" height="600px" viewBox="0 0 600 600" enable-background="new 0 0 600 600"
  xml:space="preserve">
    <defs>
      <filter id="flameShake">
        <feTurbulence id="turbulence" baseFrequency="0.3 0.1" type="fractalNoise" stitchTiles="stitch" numOctaves="1" seed="0" />
        <feDisplacementMap in="SourceGraphic" scale="23" />
        <feGaussianblur stdDeviation="1.5">
        </feGaussianblur>
          <feColorMatrix id="flameHue" type="hueRotate" values="0"/>
      </filter>
      <clipPath id="bodyMask">
        <rect id="body" x="260" y="125" width="80" height="450" />
      </clipPath>
      <linearGradient id="bodyGrad" gradientUnits="userSpaceOnUse" x1="260" y1="350" x2="340" y2="350">
        <stop offset="0" style="stop-color:#000000;stop-opacity:0.7" />
        <stop offset="0.081" style="stop-color:#5C5C5C;stop-opacity:0.5" />
        <stop offset="0.4" style="stop-color:#FFFFFF;stop-opacity:0" />
        <stop offset="1" style="stop-color:#000000;stop-opacity:0.7" />
      </linearGradient>
      <radialGradient id="headGrad" cx="299" cy="121" r="40.6885" gradientUnits="userSpaceOnUse">
        <stop offset="0" style="stop-color:#3d3d3d" />
        <stop offset="0.7" style="stop-color:#000000" />
      </radialGradient>
    </defs>
    <g id="speedLineGroup">
      <line fill="none" x1="-134" y1="62.5" x2="586" y2="62.5" />
      <line fill="none" x1="-190" y1="434.5" x2="436" y2="434.5" />
      <line fill="none" x1="-518" y1="105.5" x2="592" y2="105.5" />
      <line fill="none" x1="108" y1="515.5" x2="691" y2="515.5" />
      <line fill="none" x1="-163" y1="375.5" x2="551" y2="375.5" />
      <line fill="none" x1="-63" y1="105.5" x2="251" y2="105.5" />
      <line fill="none" x1="-279" y1="127.5" x2="880" y2="127.5" />
      <line fill="none" x1="-318" y1="306.5" x2="762" y2="306.5" />
      <line fill="none" x1="-218" y1="6.5" x2="962" y2="6.5" />
    </g>
    <g id="missileShake">
      <g id="missileGroup">
        <use xlink:href="#body" fill="#000" />
        <g id="barrelGroup" clip-path="url(#bodyMask)">
          <rect x="260" y="135" fill="#BFBFBF" width="8" height="172" />
          <rect x="278" y="135" fill="#BFBFBF" width="8" height="172" />
          <rect x="242" y="135" fill="#BFBFBF" width="8" height="172" />
          <rect x="296" y="135" fill="#BFBFBF" width="8" height="172" />
          <rect x="314" y="135" fill="#BFBFBF" width="8" height="172" />
          <rect x="332" y="135" fill="#BFBFBF" width="8" height="172" />
        </g>
        <rect id="bandBig" x="260" y="315.8" fill="#BFBFBF" width="80" height="30" />
        <rect id="bandSmall" x="260" y="415.8" fill="#BFBFBF" width="80" height="10" />
        <!--<rect id="bandThin" x="260" y="459.8" fill="#BFBFBF" width="80" height="2"/>-->

        <g id="svgTextGroup" fill="#BFBFBF">
          <path d="M305.9,395.1c0-1.3-0.6-1.7-1.5-1.7c-1.1,0-1.7,0.6-1.8,2.1l-0.6,5c-0.3,2.3-1.6,3.7-4.6,3.7
		c-3.5,0-4.7-1.8-4.7-3.9v-8.3h3.1v8.5c0,1,0.4,1.6,1.5,1.6c0.9,0,1.4-0.4,1.6-2.1l0.6-4.7c0.3-2.4,1.5-4,4.8-4c2.8,0,4.8,1.1,4.8,4
		v9h-3.1V395.1z" />
          <path d="M292.6,372.9l13.2,4.1c2,0.6,3.5,1.5,3.5,3.2s-1.4,2.6-3.5,3.2l-13.2,4.1v-2.4l12.3-3.9
		c0.7-0.2,1.1-0.5,1.1-1.1s-0.4-0.8-1.1-1.1l-12.3-3.9V372.9z" />
          <path d="M300,356.3h9v8.1c0,3.7-2.8,4.9-8.2,4.9c-5.4,0-8.2-1.3-8.2-4.9v-8h3.3v8c0,2.4,1.7,2.7,4.8,2.7
		c3.2,0,4.9-0.3,4.9-2.7v-6H300V356.3z" />
        </g>
        <g id="svgLogoGroup">
          <path fill="#EDEDED" d="M300,455c-1.1,0-2.2-0.3-3-0.8c-1.5-1-1.7-2.5-0.4-3.5v-1.4l-1.6,1c-0.3,1.3-2.1,2.3-4.2,2.3
		c-2.4,0-4.3-1.2-4.3-2.7c0-1.3,1.6-2.5,3.7-2.7l1.6-1h-2.3c-0.7,0.4-1.6,0.5-2.6,0.5c-1.1,0-2.2-0.3-3-0.8c-1.7-1-1.7-2.7,0-3.8
		c0.8-0.5,1.9-0.8,3-0.8c0.9,0,1.8,0.2,2.6,0.5h2.3l-1.6-1c-2.1-0.2-3.7-1.3-3.7-2.7c0-1.5,1.9-2.7,4.3-2.7c2.2,0,3.9,1,4.2,2.3
		l1.6,1v-1.4c-1.3-1-1.1-2.6,0.4-3.5c0.8-0.5,1.9-0.8,3-0.8c1.1,0,2.2,0.3,3,0.8c0.8,0.5,1.3,1.2,1.3,1.9c0,0.6-0.3,1.1-0.9,1.6v1.4
		l1.6-1c0.3-1.3,2.1-2.3,4.2-2.3c2.4,0,4.3,1.2,4.3,2.7c0,1.3-1.6,2.5-3.7,2.7l-1.6,1h2.3c0.7-0.4,1.6-0.5,2.6-0.5
		c1.1,0,2.2,0.3,3,0.8c1.7,1,1.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432.4L300,432.4c-1.5,0-2.9,0.4-4,1c-1,0.6-1.5,1.4-1.6,2.2c-1-0.5-2.3-0.9-3.7-0.9
		c-3.1,0-5.6,1.6-5.6,3.5c0,0.9,0.5,1.7,1.4,2.3c-1.4,0.1-2.6,0.4-3.6,1c-1.1,0.7-1.6,1.5-1.6,2.5s0.6,1.8,1.6,2.5
		c1,0.6,2.2,1,3.6,1c-0.9,0.6-1.4,1.4-1.4,2.3c0,1.9,2.5,3.5,5.6,3.5c1.4,0,2.7-0.3,3.7-0.9c0.1,0.8,0.7,1.6,1.6,2.2
		c1.1,0.7,2.5,1,4,1c1.5,0,2.9-0.4,4-1c1-0.6,1.5-1.4,1.6-2.2c1,0.5,2.3,0.9,3.7,0.9c1.5,0,2.9-0.4,4-1s1.6-1.5,1.6-2.5
		c0-0.9-0.5-1.7-1.4-2.3c1.4-0.1,2.6-0.4,3.6-1c2.2-1.4,2.2-3.6,0-5c-1-0.6-2.2-1-3.6-1c0.9-0.6,1.4-1.4,1.4-2.3
		c0-1.9-2.5-3.5-5.6-3.5c-1.4,0-2.7,0.3-3.7,0.9c-0.1-0.8-0.6-1.6-1.6-2.2C302.9,432.7,301.5,432.4,300,432.4L300,432.4z" />
        </g>
        <use xlink:href="#body" fill="url(#bodyGrad)" />

        <polygon id="finLBehind" fill="#BFBFBF" points="260,562 212,562 212,506.3 260,466.3 " />
        <polygon id="finL" fill="#BFBFBF" points="260,562 212,562 212,506.3 260,466.3 " />
        <polygon id="finR" fill="#BFBFBF" points="340,562 388,562 388,506.3 340,466.3 " />
        <rect id="finMid" x="296" y="466" fill="#BFBFBF" width="8" height="96" />


        <rect id="tip" x="299" y="50" fill="#5d5d5d" width="2" height="52" />

        <!--<path id="head_1_" fill="url(#head_2_)" d="M260,125c0,0,0-44.7,40-44.7c40,0,40,44.7,40,44.7H260z"/>-->
        <polygon id="head_1_" fill="url(#headGrad)" points="260,124 300,80.3 340,124 " />
        <g id="flameGroup" filter="url(#flameShake)">
          <path fill="#D43C01" d="M316.9,581h-9.1h-15.3h-9.5c-29.1,35.7,15.2,65.3,16.6,95.3C302.7,647,347.7,609.3,316.9,581z" />
          <path fill="#FCA97D" d="M318.7,581H307h-13.6h-12c-9.4,27-3.2,51.8,18.4,74.5C321.8,632.7,328.1,608,318.7,581z" />
          <path fill="#FFFFFF" d="M290.4,581.2c-1.4,24.8,1.8,40,9.6,45.7c7.8-5.6,11-20.9,9.6-45.7H290.4z" />

        </g>

      </g>
    </g>
  </svg>

</div>
              
            
!

CSS

              
                body {
background: #000000; 
background: -moz-linear-gradient(top,  #000000 1%, #061a21 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#000000), color-stop(100%,#061a21)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #000000 1%,#061a21 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #000000 1%,#061a21 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #000000 1%,#061a21 100%); /* IE10+ */
background: linear-gradient(to bottom,  #000000 1%,#061a21 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#061a21',GradientType=0 ); /* IE6-8 */

  overflow: hidden;
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.container {
  position: absolute;
  max-width: 100%;
  height: 600px;
}

svg {
  max-width: 100%;
  visibility: hidden;
  overflow: visible;
}

#bg {
  width: 100%;
  overflow: visible;
}
.bgSVG{
  width:100%;
}
              
            
!

JS

              
                MorphSVGPlugin.convertToPath('polygon, rect');

var xmlns = "http://www.w3.org/2000/svg",
  select = function(s) {
    return document.querySelector(s);
  },
  selectAll = function(s) {
    return document.querySelectorAll(s);
  },
  container = select('.container'),
  missileGroup = select('#missileGroup'),
  barrelGroupLines = selectAll('#barrelGroup path'),
  speedLines = selectAll('#speedLineGroup line'),
  speedLineColours = ['#4A1F20', '#4875A0', '#3d3d3d', '#8A5300', '#131E2D']

var isDevice = (/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent.toLowerCase()));

//center the container cos it's pretty an' that
TweenMax.set(container, {
  position: 'absolute',
  top: '50%',
  left: '50%',
  xPercent: -50,
  yPercent: -50
})

TweenMax.set('svg', {
  visibility: 'visible'
})

TweenMax.set(missileGroup, {
  transformOrigin: '50% 50%',
  rotation: 90,
  scaleX: 0.6
})

TweenMax.staggerTo(speedLines, 0, {
  drawSVG: '100% 100%',

  cycle: {
    strokeWidth: [1, 2, 1, 1, 2],
    stroke: speedLineColours,
    alpha: function(i) {
      return 1 - Math.random();
      //return 1;
    }
  }
}, 0)
var reverseTl = new TimelineMax({
  paused: true
});
var tl = new TimelineMax({
  repeat: -1,
  onReverseComplete: function() {
    tl.time(tl.duration());
    tl.reverse();
  }
});
tl.to('#finL', 1, {
    morphSVG: {
      shape: '#finMid'
    },
    ease: Linear.easeNone
  })
  .to('#finMid', 1, {
    morphSVG: {
      shape: '#finR'
    },
    ease: Linear.easeNone
  }, '-=1')
  .to('#finR', 1, {
    //transformOrigin:'0%'
    scaleX: 0,
    fill: '#646464',
    ease: Linear.easeNone
  }, '-=1')
  .from('#finLBehind', 1, {
    transformOrigin: '100% 50%',
    scaleX: 0,
    fill: '#646464',
    ease: Linear.easeNone
  }, '-=1')
  .to(barrelGroupLines, 1, {
    x: 18,
    ease: Linear.easeNone
  }, '-=1')

/*tl.time(tl.duration());
tl.reverse();*/
reverseTl.add(tl, 0);
reverseTl.time(1000);
TweenMax.to(reverseTl, 20, {
  time: reverseTl.time() - 4,
  ease: Back.easeInOut.config(4),
  repeat: -1,
  yoyo: true
})

//tl.timeScale(7)
//console.log(reverseTl.duration())
var upDownTl = new TimelineMax({
  repeat: -1,
  yoyo: true
});
upDownTl.to(missileGroup, 3, {
    y: -100,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 3, {
    y: -60,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 4, {
    y: 23,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 3, {
    y: 2,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 3, {
    y: -43,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 3, {
    y: 0,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 5, {
    y: -220,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })

upDownTl.timeScale(1);

var leftRightTl = new TimelineMax({
  repeat: -1,
  yoyo: true
});
leftRightTl.to(missileGroup, 3, {
    x: -30,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 3, {
    x: -60,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })

.to(missileGroup, 3, {
    x: 0,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })
  .to(missileGroup, 5, {
    x: -120,
    delay: randomBetween(0, 3),
    ease: Anticipate.easeInOut
  })

leftRightTl.timeScale(1);

var allSpeedTl = new TimelineMax();

for (var i = 0; i < speedLines.length; i++) {
  var repeatDelay = randomBetween(10, 30);
  console.log(repeatDelay)
  var speedTl = new TimelineMax({
    repeat: -1,
    repeatDelay: repeatDelay
  });
  var dur = 5; //randomBetween(1, 3);
  var startLen = randomBetween(70, 90);
  var endLen = 100 - startLen;
  speedTl.to(speedLines[i], dur / 4, {
      drawSVG: '100% ' + startLen + '%',
      ease: Linear.easeNone
    })
    .to(speedLines[i], dur, {
      drawSVG: endLen + '% 0%',
      ease: Linear.easeNone
    })
    .to(speedLines[i], dur / 4, {
      drawSVG: '0% 0%',
      ease: Linear.easeNone
    })

  allSpeedTl.add(speedTl, (i + 1) / 6)
}

allSpeedTl.timeScale(26)

TweenMax.to('#turbulence', 4, {
    attr: {
      seed: 1000
    },
    repeat: -1,
    yoyo: true,
    ease: Linear.easeNone
  })
  /*

  */
function shakeMissile() {

  TweenMax.to('#missileShake', 0.024, {
    y: -2,
    repeat: -1,
    //repeatDelay:0.005,
    yoyo: true,
    ease: Linear.easeNone

  })

  TweenMax.to('#missileShake', 0.016, {
    x: 3,
    repeat: -1,
    yoyo: true,
    ease: Linear.easeNone

  })
  //change the flame hue
  TweenMax.to('#flameHue', 16, {
    attr:{
      values:360
    },
    repeat:-1,
    ease:Linear.easeNone
    
  })
}

function randomBetween(min, max) {
    return Math.floor(Math.random() * (max - min + 1) + min);
  }
  //ScrubGSAPTimeline(tl)

if (!isDevice) {
  shakeMissile();
}
              
            
!
999px

Console