Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <section>
		<h2>Regular Tween, smoothOrigin not applied</h2>
		<p>Expected Output: the arrow head is aligned properly with the line, like how it is when the tweens aren't applied.</p>
		<svg class="how-contrails-form-infographic" width="1215" height="585" viewBox="0 0 1215 585"  xmlns="http://www.w3.org/2000/svg" overflow="visible" fill="black">
				<g class="ray__group ray__group--left">
					<path class="ray__arrow ray__arrow--left" d="M289.715 279.672L290.776 294.451H274.938L289.715 279.672Z" fill="white" />
					<path class="ray__line ray__line--left" d="M140.148 144.711L283.226 287.788" stroke="white" stroke-width="3" stroke-miterlimit="10" />
				</g>
				<g class="ray__group ray__group--right">
					<path class="ray__line ray__line--right" d="M358.68,292.053L506.125,144.711" stroke="white" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" />
					<path class="ray__arrow ray__arrow--right-not-smooth" d="M498.555 137.512H513.345V152.277L498.555 137.512Z" fill="white" />
				</g>
		<h2>smoothOrigin: false</h2>
		<p>Expected Output: Based off what I read in teh GSAP docs I would have thought that smoothOrigin: true would fix my result and I dont understand why smoothOrigin: false is what fixes it.</p>
		<svg class="how-contrails-form-infographic" width="1215" height="585" viewBox="0 0 1215 585"  xmlns="http://www.w3.org/2000/svg" overflow="visible" fill="black">
			<g class="ray__group ray__group--left">
				<path class="ray__arrow ray__arrow--left" d="M289.715 279.672L290.776 294.451H274.938L289.715 279.672Z" fill="white" />
				<path class="ray__line ray__line--left" d="M140.148 144.711L283.226 287.788" stroke="white" stroke-width="3" stroke-miterlimit="10" />
			</g>
			<g class="ray__group ray__group--right">
				<path class="ray__line ray__line--right" d="M358.68,292.053L506.125,144.711" stroke="white" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" />
				<path class="ray__arrow ray__arrow--right" d="M498.555 137.512H513.345V152.277L498.555 137.512Z" fill="white" />
			</g>
		</svg>
	
			</svg>
</section>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
	
}
body {
	background: black;
	color: white;
}
svg {
	width: 100%;
	height: auto;
}
h2 {
	color: white;
}
section {
	width: 100vw;
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 50px;
	flex-direction: column;
}
svg {
	border: solid 1px rgba(white, .25);
}
              
            
!

JS

              
                


const tl = gsap.timeline({ repeat: -1, repeatDelay: 2});
tl
	//- Setup - 
	.set('.ray__line', {
		strokeDasharray : (index, target, targets)=> `${target.getTotalLength()} ${target.getTotalLength()}`,
		strokeDashoffset : (index, target, targets)=> target.getTotalLength()
	})
	.set('.ray__arrow', {
		scale: 0
	})

	// - Left Arrow - 
	.to(`.ray__line--left`, {
		strokeDashoffset : 0,
		duration: 1,
		ease: "Linear.easeNone"
	}, 1.5)
	.to(`.ray__arrow--left`, {
		scale: 1,
		transformOrigin: 'top left',
		duration: .35,
		ease: "Linear.easeNone"
	}, '>-.25')

	// - Right Arrow - 
	.to(`.ray__line--right`, {
		strokeDashoffset : 0,
		duration: 1,
		ease: "Linear.easeNone"
	})
	.to(`.ray__arrow--right`, {
		scale: 1,
		transformOrigin: 'bottom left',
		smoothOrigin: false,
		duration: .35,
		ease: "Linear.easeNone"
	}, '>-.25')
	.to(`.ray__arrow--right-not-smooth`, {
		scale: 1,
		transformOrigin: 'bottom left',
		// smoothOrigin: true,
		duration: .35,
		ease: "Linear.easeNone"
	}, '>-.25')






              
            
!
999px

Console