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

              
                <svg xmlns='http://www.w3.org/2000/svg'>
    <defs>
        <filter id='noise'>
            <feTurbulence type='fractalNoise' baseFrequency='0.8' />
            <feColorMatrix type="saturate" values="0"/>
        </filter>
    </defs>
</svg>

<div class="stage"></div>

<div class="icon">
    <div class="eq">
        <div class="eq__bars-l">
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
        </div>
        <div class="eq__bars-r">
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
            <div class="eq__bar"></div>
        </div>
    </div>
    <div class="prog">
        <div class="prog__bar"></div>
        <div class="prog__ball prog__ball--top"></div>
        <div class="prog__ball prog__ball--btm"></div>
    </div>
</div>

<div class="noise"></div>

<!-- <div class="image"></div> -->
              
            
!

CSS

              
                :root {
    --scaleVal: 80vmin;
    --maxSize: 794px;
    // --scaleVal: 794px;
}

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: black;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

svg {
    display: none;
}

.stage {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            40% 50% at 50% 10%,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0)
        ),
        radial-gradient(
            676px 335px at 50% 10%,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0)
        ),
        linear-gradient(197deg, #484D6C 2%, #3E4360 97%);
        
}

.icon {
	position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
	width: var(--scaleVal);
    max-width: var(--maxSize);
	height: var(--scaleVal);
    max-height: var(--maxSize);
	visibility: hidden;
    font-size: 1vmin;
    
    background-image: linear-gradient(204deg, #333333 41%, #232323 89%);
    box-shadow: 
        -15px 22px 34px 0 rgba(0,0,0,0.26),
        -110px 72px 264px 0 rgba(0,0,0,0.25),
        -90px 122px 200px -150px rgba(0,0,0,0.7),
        11px 53px 40px 0 rgba(0,0,0,0.12),
        -34px 53px 84px 0 rgba(0,0,0,0.06),
        -110px 92px 4004px 0 rgba(0,0,0,0.07),
        inset 0.1vmin 0.1vmin 0.1vmin 0.15vmin rgba(0,0,0,0.2),
        inset 0 0.35vmin 0.5vmin 0.2vmin rgba(0,0,0,0.50),
        inset 0.2vmin -0.6vmin 0.8vmin 0.8vmin rgba(0,0,0,0.10),
        inset 0 -0.5vmin 1.0vmin 0.0vmin rgba(0,0,0,0.5),
        inset -0.5vmin 0.3vmin 0.5vmin -0.05vmin rgba(255,255,255,0.6);

    border-radius: 25%;
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
    filter: url('#noise');
    opacity: 0.3;
}

// .image {
//     position: absolute;
//     top: 0;
//     left: 0;
//     z-index: 2;
//     width: 100%;
//     height: 100%;
//     background: url("https://assets.codepen.io/61488/Voice+Memos.png") no-repeat center center;
//     opacity: 0.5;
//     transform: translate(20px, 9px);
// }

.prog {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 10.08%;
    height: 80.7%;
    filter: drop-shadow(-0.2vmin 0.7vmin 0.8vmin rgba(0,0,0,0.7));
}

.prog__bar {
    width: 24%;
    height: 76%;
    background: 
        linear-gradient(-15deg, rgba(0,0,0,0) 98%, rgba(0,35,108,0.69) 100%), // small shad top
        linear-gradient(10deg, rgba(0,35,108,0.35)  0%, rgba(0,0,0,0) 1.5%), // small shad btm
        linear-gradient(90deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.1) 60%, rgba(255,255,255,0) 100%), // highlight
        linear-gradient(90deg, #1F56B4 0%, #266CB9 7%, #007FD2 18%, #0095F4 55%, #019CF3 72%, #02A2F3 79%, #0085ED 100%); //main
    
    &:after {
        position: absolute;
        content: '';
        left: 54%;
        width: 3%;
        height: 40%;
        background: linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 100%),;
    }
}

.prog__ball {
    position: absolute;
    top: 0;
    width: 100%;
    height: 12.48%;
    background: #00A1FD;
    border-radius: 50%;
    box-shadow: inset 0.8vmin -0.7vmin 1.5vmin 0 rgba(4,54,90,0.7);
    
    &:before,
    &:after {
        position: absolute;
        content: '';
        background: red;
    }
    
    &:before {
        left: 37%;
        top: 30%;
        width: 25%;
        height: 22%;
        background: radial-gradient(100% 80%, rgba(255,255,255,0.25) 10%, rgba(255,255,255,0) 52%);
    }
    
    &:after {
        left: 60%;
        top: 20%;
        width: 35%;
        height: 28%;
        background: radial-gradient(100% 80%, rgba(255,255,255,0.3) 10%, rgba(255,255,255,0) 52%);
        transform: rotate(50deg);
    }
}

.prog__ball--btm {
    top: auto;
    bottom: 0;
}

.eq {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 5.4%;
    width: 89.6%;
    height: 61%;
    filter: drop-shadow(-0.1vmin 0.5vmin 1vmin rgba(0,0,0,0.6));
}

.eq__bars-l,
.eq__bars-r {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eq__bar {
    position: relative;
    width: 7%;
    height: 4.8%;
    overflow: hidden;
    background: white;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    clip-path: inset(0 round 20px);    
    
    .eq__bars-l & {
        background: #FF1739;
    }

}
              
            
!

JS

              
                console.clear();

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

const icon = select('.icon');
const bars = gsap.utils.toArray('.eq__bar').reverse();
const global = gsap.timeline();
const minHeight = 4.8;
const maxHeight = 100;
const delay = 0.05; // aka each
const definedVals = [];
const vals = [];
const progElmsDelay = 1.3;

function weightedRandom(collection, ease) {
	return gsap.utils.pipe(
		Math.random,            //random number between 0 and 1
		gsap.parseEase(ease),   //apply the ease
		gsap.utils.mapRange(0, 1, -0.5, collection.length-0.5), //map to the index range of the array, stretched by 0.5 each direction because we'll round and want to keep distribution (otherwise linear distribution would be center-weighted slightly)
		gsap.utils.snap(1),     //snap to the closest integer
		i => collection[i]      //return that element from the array
	);
}

function createVals() {
    // create possible values in an array from min 4.8 to 100 max
    let diff = maxHeight - minHeight;

    for(let i = 0; i < diff; i++) {
        definedVals.push(Math.ceil(minHeight+i));
    }
}

function setVals() {
    let arbValue = 200;
    // create an array of ease weighted values from possible values
    for(let i = 0; i < arbValue; i++) {
        vals.push(weightedRandom(definedVals, "power1.in")());
    }
}

function intro() {
    let tl = gsap.timeline({
        delay: 0.5
    });
    
    tl.from('.icon', {
        opacity: 0,
        duration: 1,
        ease: 'none'
    })
    .from('.icon', { // a null animation to control the onComplete timing
        duration: 1.85,
        ease: 'none',
        onComplete: addWaves
    }, 0)
    .from(bars, {
        y: "500%",
        opacity: 0,
        duration: 2,
        ease: 'elastic(2, 0.7)',
        stagger: 0.04
    }, 0.8)
    .from('.prog__ball', {
        scale: 0,
        duration: 1.2,
        ease: 'elastic(1, 0.75)',
        transformOrigin: 'center center'        
    }, progElmsDelay)
    .from('.prog__ball--top', {
        y:'350%',
        duration: 2,
        ease: 'elastic(1, 0.75)',
        transformOrigin: 'center center'
    }, progElmsDelay)
    .from('.prog__ball--btm', {
        y:'-350%',
        duration: 2,
        ease: 'elastic(1, 0.75)',
        transformOrigin: 'center center'
    }, progElmsDelay)
    .from('.prog__bar', {
        scaleY: 0,
        duration: 2,
        ease: 'elastic(1.1, 0.9)'
    }, progElmsDelay)    
    
    return tl;
}

function addWaves() {
    bars.forEach((bar, i) => {
       const tl = gsap.timeline({
           repeat: -1,
           delay: delay * i
       });
       vals.forEach((val) => {
           tl.to(bar, {
               height: `${val}%`,
               duration: 0.25,
               ease: 'sine.inOut'
           })
       });
    });
}

function init() {
    createVals();
    setVals();
    // Set initial states
    gsap.set('.eq__bar', { height: `${minHeight}%` });
    gsap.set(icon, { autoAlpha: 1 });
    global.add(intro()).timeScale();
}

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

Console