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 id="rocket">
	
<svg version="1.1" id="rocket-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="552 -551.8 1167.8 1167.8" style="enable-background:new 552 -551.8 1167.8 1167.8;" xml:space="preserve">
<g id="dot3">
	
		<circle cx="1138.8" cy="370.1" r="10.1"/>
	
</g>
<g id="dot2">
	
		<circle cx="1138.8" cy="407.1" r="10.1"/>
	
</g>
<g id="dot1">
	
		<circle cx="1138.8" cy="442.1" r="10.1"/>
	
</g>
<g id="dot-top">
	
		<circle cx="1140.1" cy="14" r="13.7"/>
	
</g>
<g id="circle">
	
		<path d="M1140.1-169c-11.4,0-22.1,4.4-30.2,12.5s-12.5,18.8-12.5,30.2c0,23.6,19.2,42.7,42.7,42.7c11.8,0,22.5-4.8,30.2-12.5
			c7.7-7.7,12.5-18.4,12.5-30.2C1182.8-149.8,1163.7-169,1140.1-169z M1162.7-126.3c0,12.5-10.2,22.7-22.7,22.7
			s-22.7-10.2-22.7-22.7c0-6.1,2.4-11.7,6.6-16c4.3-4.3,10-6.6,16-6.6C1152.6-148.9,1162.7-138.8,1162.7-126.3z"/>
	
</g>
<g id="fire">
	
		<path d="M1155.5,231.6c-5.3,1.8-8.1,7.5-6.3,12.7l8.5,25.4c3.7,11.1,1.2,23.4-6.4,32.2l-9.2,10.5c-1.6,1.8-3.5,2-4.5,2
			s-2.9-0.3-4.5-2l-9.2-10.5c-7.7-8.8-10.1-21.1-6.4-32.2l8.5-25.4c1.8-5.3-1.1-10.9-6.3-12.7c-5.3-1.8-10.9,1.1-12.7,6.3l-8.5,25.4
			c-6,17.8-2,37.6,10.3,51.8l9.2,10.5c4.9,5.7,12.1,8.9,19.6,8.9c6.9,0,13.5-2.8,18.4-7.6c0.4-0.4,0.8-0.9,1.2-1.3l9.2-10.5
			c12.3-14.1,16.3-34,10.3-51.8l-8.5-25.4C1166.4,232.6,1160.7,229.8,1155.5,231.6z"/>
	
</g>
<g id="rocket-body">
	
		<path d="M1138.8-322.1c-6.6,0-12.9,2.9-17.3,7.9l-6.2,7c-55.5,63.1-82.3,147.1-73.7,230.7l6.1,59.9l14.8,142.6l0.8,8
			c0.4,4,3.2,7.4,7.1,8.6c3.9,1.2,7.9,2.2,11.9,3.2l3.9,45.8c0.3,3.9,2.9,7.3,6.6,8.6c14.2,5.1,29,7.7,43.8,7.8
			c15.2,0.1,30.3-2.5,44.9-7.8c1.4-0.5,2.7-1.3,3.7-2.4c1.6-1.6,2.6-3.7,2.9-6.1c0.9-8.2,1.7-17.7,2.5-26.9
			c0.6-6.6,1.2-13.3,1.8-19.6c3.3-0.8,6.5-1.7,9.8-2.7c1.6-0.5,3.1-1.4,4.3-2.5c1.5-1.5,2.6-3.6,2.9-5.8l1.1-8.6l24.7-195.8
			c11-87.6-16.6-175.3-75.9-240.7l-3.3-3.6C1151.7-319.3,1145.4-322.1,1138.8-322.1z M1170.9,163c-0.6,6.8-1.2,13.8-1.9,20.2
			c-10.5,3.1-21.3,4.7-32.1,4.6c-10.5,0-20.9-1.6-31.1-4.6l-2.9-33.5c10.9,1.6,21.8,2.4,32.8,2.4l0,0l0,0l0,0
			c12.2,0,24.3-0.9,36.3-2.7C1171.7,153.9,1171.3,158.5,1170.9,163z M1144.6-297.3c55.3,61,81.2,142.9,70.9,224.7l-24.9,197.7
			c-14.6,3.8-26.2,6.1-41.3,6.7V57.1c0-5-3.6-9.5-8.6-10.2c-6.2-0.9-11.5,3.9-11.5,9.9v75c-14.5-0.7-32.3-2.9-46.4-6.6l-21.2-203.7
			c-8.1-78,17-156.5,68.8-215.3l6.2-7c0.8-0.9,1.8-1.1,2.4-1.1c0.5,0,1.5,0.1,2.4,1L1144.6-297.3z"/>
	
</g>
<path id="wing-right" d="M1255,10L1255,10c28.5,28.5,44.2,66.4,44.2,106.7v60.8l-85.8-77.5l-3.1,24.3l92.2,83.2
	c2.9,2.7,7.2,3.3,10.8,1.7c1.1-0.5,2.2-1.2,3-2.1c1.8-1.8,2.9-4.4,2.9-7.1v-83.4c0-45.3-18-88.8-50.1-120.9l-37.8-37.8l-3.2,25.2
	L1255,10z"/>
<path id="wing-left" d="M1048.7-16.9l-3.2-25.2l-37.8,37.8c-32.1,32.1-50.1,75.6-50.1,120.9V200c0,2.7,1.1,5.3,2.9,7.1
	c0.8,0.9,1.9,1.6,3,2.1c3.6,1.6,7.9,1,10.8-1.7l92.2-83.2l-3.1-24.3l-85.8,77.5v-60.8c0-40.3,15.7-78.2,44.2-106.7l0,0L1048.7-16.9z
	"/>
</svg>




</div>

              
            
!

CSS

              
                body, html {
	background: #3b3b3a;
}

body {
	display: flex;
	height: 100vh;
	align-items: center;
	justify-content: center;
}


#rocket-svg {
	width: 256px;
	cursor: pointer;
}

#rocket-svg path {
	fill: #14f7c1;
}

#rocket-svg circle {
	fill: #14f7c1;
}

#menu-icon #circle {
	stroke: #14f7c1;
	opacity: 0;
	fill: none;
	stroke-width: 3px;
}

              
            
!

JS

              
                var rocket = $('#rocket');
var rocketSVG = $('#rocket-svg')
var rocketBody = $('#rocket-body');
var wingL = $('#wing-left');
var wingR = $('#wing-right');
var fire = $('#fire');
var dotTop = $('#dot-top');
var dot1 = $('#dot1');
var circle = $('#circle');
var distance = 75;
var wingsDistance = 50;

var tl = new TimelineLite({
	paused:true,
	onComplete: function() {
		tlLaunch.play();
		tlLaunch.restart();
	}
});

var tlLaunch = new TimelineLite({
	paused:true,
	onComplete: function() {
		tl.reverse();
		$('#rocket').removeClass('moving');
	}
});
 

TweenLite.defaultEase = Back.easeOut; // Change the default easing



$("body").on({
    mouseenter: function() {
      TweenLite.to(circle, 0.5, {
			scale: 3,
			transformOrigin: "50% 50%",
		});
    },
    mouseleave: function() {
      TweenLite.to(circle, 0.5, {
			scale: 1,
			transformOrigin: "50% 50%",
		});
    },
    click: function() {
			tl.play();
			$(this).addClass('moving');
    }
}, "#rocket:not(.moving)");



tlLaunch

	.to(rocketSVG, 1.5, {
		ease: Circ.easeInOut,
		y: -450,
		})

	.fromTo(rocketSVG, 1.7, {
		ease: Expo.easeOut,
		y: 450,
		immediateRender:false,
		},
		{ 
		ease: Expo.easeOut,
		y: 0,
		});


tl

	.fromTo(rocketBody, 0.3, {
		y: distance * -1,
		scale: 0,
		transformOrigin: "50% 50%",
		},{
		y: 0,
		scale: 1
		}, 0.05) 

	.fromTo(wingL, 0.4, {
		transformOrigin: "50% 50%",
		x: wingsDistance,
		opacity:0,
		rotation: -20,
		},{
		x: 0,
		rotation: 0,
		opacity: 1,
		}, 0.1)

	.fromTo(wingR, 0.4, {
		transformOrigin: "50% 50%",
		x: wingsDistance * -1,
		opacity:0,
		rotation: 20,
		},{
		x: 0,
		opacity: 1,
		rotation: 0,
		}, 0.1)

	.fromTo(fire, 0.6, {
		opacity: 0,
		y: distance,
		},{
		opacity:1,
		y: 0,
		}, 0.4)

	.fromTo(circle, 0.5, {
		y: 40,
		// scale: 3,
		transformOrigin: "50% 50%"
		},{
		y: 0,
		scale: 1,
		transformOrigin: "50% 50%",
		}, 0)

	.fromTo(dotTop, 0.5, {
		scale: 2.5,
		y: -100,
		transformOrigin: "50% 50%"
		},{
		scale: 1,
		y: 0,
		ease: Bounce.easeOut,
		transformOrigin: "50% 50%"
		}, 0.1)

	.fromTo(dot3, 0.3, {
		scale: 0,
		transformOrigin: "50% 50%"
		},{
		scale: 1,
		transformOrigin: "50% 50%"
		}, 0.5)

	.fromTo(dot2, 0.3, {
		scale: 0,
		transformOrigin: "50% 50%"
		},{
		scale: 1,
		transformOrigin: "50% 50%"
		}, 0.7)

	.fromTo(dot1, 0.3, {
		scale: 0,
		transformOrigin: "50% 50%"
		},{
		scale: 1,
		transformOrigin: "50% 50%"
		}, 0.9)




              
            
!
999px

Console