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

              
                <body>
<section class="banner">

        
            <div class="container one">
                <div class="upper cont">
                    <div class="hang"></div>
                </div>
                    <div class="letter cont"><h1>H</h1></div>
            </div>
            <div class="container two">
                <div class="upper cont">
                    <div class="hang"></div>
                </div>
                    <div class="letter cont"><h1>E</h1></div>
            </div>
            <div class="container three">
                <div class="upper cont">
                    <div class="hang"></div>
                </div>
                    <div class="letter cont"><h1>L</h1></div>
            </div>
            <div class="container four">
                <div class="upper cont">
                    <div class="hang"></div>
                </div>
                    <div class="letter cont"><h1>L</h1></div>
            </div>
            <div class="container five">
                <div class="upper cont">
                    <div class="hang"></div>
                </div>
                    <div class="letter cont"><h1>0</h1></div>
            </div>
            
                   
    </section>
<!-- GSAP -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.4.2/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.4.2/CSSRulePlugin.min.js"></script>
  </body>
              
            
!

CSS

              
                /* === Small CSS Reset === */
*{
    margin: 0;
    padding: 0;
}
*, *::after, *::before{
    box-sizing: border-box;
}
body{
    background-color: #f0eee9;
    font-family: sofia-pro, sans-serif;
    font-weight: 400;
    font-style: normal;
    line-height: 18px;
    
}

h1{
    color: #75551c;
    font-weight: 500;
}

.banner{
    height: 100vh;
    width: 100%;
    overflow: hidden;
    --radius: 40vh; 
    --top-position: 40vh;
    display: flex;
    justify-content: center;
}


.container{
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    transform-origin: center top;
  transform

}


.hang{
    position: relative;
    background-color: rgb(36, 35, 35);
    margin-top: -200px;
    margin-bottom: 20px;
    width: 10px;
}

.hang:nth-child(3){
    position: relative;
    margin-bottom: -20px;
    z-index: 2;
}

.cont{
    position: relative;
    width: 20vh;
    text-align: center;
    height: 80%;
    display: flex;
    justify-content: center;
    z-index: 1;
    font-size: 12vh;
}

.upper{
    height: 45%;
}

.letter{
    height: 55%;
    z-index: 1;
}
              
            
!

JS

              
                const swingTL = gsap.timeline({repeat: 2, yoyo:true, })

const swingRadius = gsap.getProperty(".banner", "--radius"); // gets the radius var from CSS... useful for this example's flexability. 

const transformOriginValue = '50% -' + swingRadius + 'vh'; 

gsap.from('.container', {duration: 15, rotation: '-20deg', transformOrigin: transformOriginValue, ease: 'elastic.out( 3, 0.1)', repeat: -1, delay: 2})




var swing1 = gsap.from('.letter', {duration: 100, rotationY: '-25deg', ease: 'elastic.out( 2, 0.1)', repeat: -10, delay: 0})
var swing2 = gsap.from('.letter', {duration: 30, rotationY: '-20deg', ease: 'elastic.out( 2, 0.1)', repeat: -10, delay: 16})
              
            
!
999px

Console