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

              
                <div class="container">
    <svg class="animation" xmlns="http://www.w3.org/2000/svg"  viewBox="0 0 716 1008">
        <defs>
            <mask id="main-mask" maskUnits="userSpaceOnUse">
                <rect width="716" height="716" y="292" fill="#fff"/>
            </mask>
            <mask id="heart-mask" maskUnits="userSpaceOnUse">
                <path class="heart" fill="#fff" d="M358,412c122-309,712,10.25.5,588C-354,422,236,103,358,412Z"/>
            </mask>
        </defs>
        <rect class="bg" width="716" height="1008" fill="#000113"/>
        <g class="lines-wrap" mask="url(#main-mask)">
            <g class="bg-lines" fill="#00c5f8">
                <rect width="716" height="10" y="252"/>
                <rect width="716" height="10" y="292"/>
                <rect width="716" height="10" y="332"/>
                <rect width="716" height="10" y="372"/>
                <rect width="716" height="10" y="412"/>
                <rect width="716" height="10" y="452"/>
                <rect width="716" height="10" y="492"/>
                <rect width="716" height="10" y="532"/>
                <rect width="716" height="10" y="572"/>
                <rect width="716" height="10" y="612"/>
                <rect width="716" height="10" y="652"/>
                <rect width="716" height="10" y="692"/>
                <rect width="716" height="10" y="732"/>
                <rect width="716" height="10" y="772"/>
                <rect width="716" height="10" y="812"/>
                <rect width="716" height="10" y="852"/>
                <rect width="716" height="10" y="892"/>
                <rect width="716" height="10" y="932"/>
                <rect width="716" height="10" y="972"/>
            </g>
        </g>
        <g mask="url(#main-mask)">
            <path class="heart-base heart" d="M358,412c122-309,712,10.25.5,588C-354,422,236,103,358,412Z"/>
            <g class="heart-wrap" mask="url(#heart-mask)">
                <g class="heart-lines" fill="#00c5f8">
                    <rect width="716" height="10" y="302"/>
                    <rect width="716" height="10" y="262"/>
                    <rect width="716" height="10" y="222"/>
                    <rect width="716" height="10" y="182"/>
                    <rect width="716" height="10" y="342"/>
                    <rect width="716" height="10" y="382"/>
                    <rect width="716" height="10" y="422"/>
                    <rect width="716" height="10" y="462"/>
                    <rect width="716" height="10" y="502"/>
                    <rect width="716" height="10" y="542"/>
                    <rect width="716" height="10" y="582"/>
                    <rect width="716" height="10" y="622"/>
                    <rect width="716" height="10" y="662"/>
                    <rect width="716" height="10" y="702"/>
                    <rect width="716" height="10" y="742"/>
                    <rect width="716" height="10" y="782"/>
                    <rect width="716" height="10" y="822"/>
                    <rect width="716" height="10" y="862"/>
                    <rect width="716" height="10" y="902"/>
                    <rect width="716" height="10" y="942"/>
                    <rect width="716" height="10" y="982"/>
                    <rect width="716" height="10" y="1022"/>
                </g>
            </g>
            
        </g>
    </svg>
    <div class="content">
        <h1 class="band">the modern lovers</h1>
        <p class="location"><span>at the stone phoenix coffeehouse</span><span>1120 boylston street / boston, massachusetts</span></p>
        <p class="date"><span>friday and saturday</span><span>january 12 & 13 1973 / 9 pm</span></p>
    </div>
<!--     <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/61488/the-modern-lovers.png" alt="" class="trace"> -->
</div>
              
            
!

CSS

              
                html {
	box-sizing: border-box;
}

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

html, body {
	width: 100%;
	height: 100%;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #001823;
    color: #DDE1E0;
	font-family: neue-haas-grotesk-display, "Helvetica Neue", Helvetica, sans-serif;
	font-weight: 600;
	font-style: normal;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-display: block;
}

.container {
	position: relative;
	width: 716px;
    height: 1008px;
	visibility: hidden;
    cursor: pointer;
}

.animation {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: 716px;
    height: 1008px;
}

.content {
    position: relative;
    z-index: 2;
    width: 716px;
    height: 100%;
    overflow: hidden;
    
    p {
        position: absolute;
        top: 23px;
        margin: 0;
        letter-spacing: 0.35px;
        line-height: 1.2;
        perspective: 200px;
    }
    
    span {
        display: block;
        transform-style: preserve-3d;
        backface-visibility: hidden;
    }
}

.band {
    position: absolute;
    left: 22px;
    top: 209px;
    margin: 0;
    font-family: neue-haas-grotesk-display, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 52px;
    font-weight: 600;
    color: #DDE2D6;
    letter-spacing: 0px;
    line-height: 1.3;
    perspective: 200px;
}

.location {
    left: 26px;
}

.date {
    left: 508px;
}

.char {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.trace {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    display: none;
}
              
            
!

JS

              
                console.clear();

select = e => document.querySelector(e);
selectAll = e => document.querySelectorAll(e);

const container = select('.container');
let master = gsap.timeline({ delay: 0.5 });
const bandText = new SplitText('.band', {type:"chars", charsClass:"char", position: "relative" });

function animateHeart() {
    tl = gsap.timeline();
    tl.to('.heart-lines', {
        y: -40,
        duration: 4,
        ease: "none",
        repeat: -1
    }, 0)
    .from('.bg-lines rect', {
        scale: 0,
        duration: 4,
        ease: "expo",
        stagger: {
            each: 0.05,
            from: "center",
            axis: "x",
            ease: "sine.in"
        },
        transformOrigin: "center center"
    }, 0)
    .to('.bg-lines', {
        y: 40,
        duration: 4,
        ease: "none",
        repeat: -1
    }, 0)
    .from('.heart', {
        y: -716,
        duration: 16,
        ease: 'expo', 
        delay: 0.2
    }, 0.5)
    .from('.char', {
        rotationX: 180,
        x: 500,
        opacity: 0,
        duration: 7,
        ease: 'expo',
        stagger: 0.01,
        transformOrigin: "center center -50px"
    }, 0.7)
    .from('.location span', {
        rotationX: 45,
        opacity: 0,
        duration: 7,
        ease: 'expo',
        stagger: -0.5,
        transformOrigin: "center center -50px"
    }, 1.2)
    .from('.date span', {
        rotationX: 45,
        opacity: 0,
        duration: 7,
        ease: 'expo',
        stagger: -0.5,
        transformOrigin: "center center -50px"
    }, 1.2)
    return tl;
}

function resize() {
	let vh = window.innerHeight;
	// let sh = container.offsetHeight;
    let sh = 1008;
	let scaleFactor = vh/sh;
	if(scaleFactor<1) {
		gsap.set(container, { scale: scaleFactor });
	}
    else {
        gsap.set(container, { scale: 1 });
    }
}

function init() {
    resize();
    gsap.set(container, { autoAlpha: 1 });
    master.add(animateHeart());
    container.onclick = () => {
        master.restart();
    }
    
}

window.onresize = resize;

window.onload = () => {
	init();
};
              
            
!
999px

Console