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

              
                <form class="container">
        <h2 class="heading">Sign Up</h2>
        <div class="steps-container">
            <hr>
            <hr class="active">
            <div class="steps"><i class="fa-solid fa-user"></i></div>
            <div class="steps"><i class="fa-solid fa-envelope"></i></div>
            <div class="steps"><i class="fa-solid fa-key"></i></div>
            <div class="steps"><i class="fa-solid fa-trophy"></i></div>
        </div>
        
        <div class="input-slide-contianer">
            <scroller>
                <div class="input-slide">
                <h3>User Name</h3>
                <p><i>Username is your online identity</i></p>
                <ul class="rules">

                    <li>Your username should only contain letters, numbers, underscores or hyphens. </li><li>No spaces or special characters allowed.</li>
                    <li>Your username should not be offensive or contain profanity.</li>
                </ul>
                <input type="text" placeholder="Type your username Here" name="username" class="username">
                <div class="full-name"><input type="text" placeholder="First Name" name="firstname">
                    <input type="text" name="lastname" class="lastname" placeholder="Last Name"></div>
                <button class="button-nex" onclick="NextSlide(1)">Next</button>
            </div>
            <div class="input-slide user-detail">
                <h3>Email</h3>
                <p><i>Email is the gateway to your digital life</i></p>
                <ul class="rules">
                    <li>Please enter valid email in the format "example@example.com".</li>
                    <li>we value your privacy and will never use your email for any unauthorized purposes.</li>
                    <li>Please don't use email that belong to someone else.</li>
                    <li>Please don't use email that includes personal information.</li>
                </ul>
                <input type="email" name="email" class="email" placeholder="Email">
 
                
                <button class="button-nex" onclick="NextSlide(2)">Next</button>
            </div>
            <div class="input-slide password-slide">
                <h3>Password</h3>
                <p><i>Secure your account with a strong password</i></p>
                <ul class="rules">
                    <li>Include a mix of uppercase and lowercase letters, numbers, and special characters.</li>
                    <li>Avoid using common or easily guessable passwords.</li>
                    <li>Do not use personal information.</li>
                </ul>
                <input type="password" name="password" class="password" placeholder="Password">
                <input type="password" name="confirm-password" class="confirm-password" placeholder="Confirm Your Password">
                <button class="button-nex" onclick="NextSlide(3)">Next</button>
            </div>
            <div class="input-slide finish-slide">
                <h3>Congratulations!</h3>
                <p><i>You have completed all the steps required for registration.</i></p>
                <ul class="rules">
                <li>Before submitting your information, please take a moment to ensure that all the details provided are correct. </li>
                <li> We take the privacy and security of our users very seriously, and it is important that all the information provided is accurate and up-to-date.</li> 
                <li>Once you have confirmed that everything is in order, simply click the 'Submit' button.</li>
                </ul> 
              
                <button type="submit" class="button-nex" disabled>Sumbit</button>
            </div>
        </scroller> 
        </div>
      <button class="GoBack" onclick="GoBack()"><i class="fa-solid fa-arrow-left"></i></button> 
    </form>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Exo:wght@100;200;300;400;500;600;700;800;900&display=swap');
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    height:100vh;
    background-color: #343a40;
    display: flex;
}
.container{
    width:500px;
    height:500px;
    margin:auto;
    border-radius: 5px;
    border:1px solid #ced4da;
    font-family: Exo;
    color:white;
    background-color: #212529;
    display: flex;
    flex-direction: column;
    padding:10px;
    position: relative;
    overflow: hidden;
}

.heading{
    padding:20px;
    font-weight: 900;
    text-align: center;
    font-size: 2em;
}
.steps-container{
    position: relative;
    display: flex;
    height: 50px;;
    margin:10px;
    width:calc(100% - 20px)
}
.steps-container>hr{
    width:100%;
    height:5px;
    background-color: white;
    border-radius: 20px;
    margin-top:25px;
    position: absolute;
    z-index:0;
    border:none;    
}


.steps-container>.active{
    background:#80ed99;
    width:0%;
}
.steps-container>.steps{
    width:45px;
    height:45px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color:#212529;
    font-size: 1.4em;
    display: flex;
    border:5px solid #212529;
    margin:auto;
    position: relative;
    box-sizing: content-box;
    z-index: 1;
    overflow: hidden;
    
}
.steps-container>.steps::after{
    content:'';
    position: absolute;
    width:0%;
    height: 45px;
    background-color: #80ed99;
    border-radius: 50%;
    z-index: 2;
}
.steps-container>.steps>i{
    margin:auto;
    z-index: 3;
}

.input-slide-contianer{
    width: 100%;
    flex:1;
    display:flex;
    overflow: hidden;
}
scroller{
    width:fit-content;
    display: flex;
    margin-left:0px;
    transition-duration: 0.5s;
}
.input-slide-contianer>scroller>.input-slide{
    width:478px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.input-slide>h3{
    text-align: center;
}
.input-slide>.rules{
    list-style-type: disc;
    display: flex;
    flex-direction: column;
    margin:auto;
    padding-left:20px;
    
}
.input-slide>.rules>li{
padding:5px 0;
}

.input-slide input{
    width:calc(100% - 20px);
    padding:10px;
    background-color: #6c757d;
    outline:none;
    border-radius:10px;
    border:none;
    /* box-shadow:1px 1px 15px 0.5px rgba(0, 0, 0, 0.5); */
    margin:auto 10px;
    font-size: 1.01em;
    color:white;
    box-sizing: border-box;
    transition-duration: 0.3s;
    position: relative;

}
.input-slide input::placeholder{
color:white !important;
font-size: 1.01em;
}
.input-slide input:focus{
    border: 1px solid lime;
}

.button-nex{
    padding:8px 20px;
    border-radius: 20px;
    color:white;
    font-weight: 800;
    outline:none;
    border:none;
    margin:auto;
    margin-right:10px;
    font-family:Exo;
    font-size: 1em;
    cursor:pointer;
    background-color: #52b788;
}
.button-nex:hover{
    background-color: #40916c;
}
.full-name{
    display: flex;
}
.user-detail>input{
    align-items: start;
    margin:10px;
}
.user-detail>button{
    margin:10px;
    margin-left:auto;
}


.user-detail>.email{
    width:calc(100% - 20px)
    }

.input-slide p{
    font-size: 0.8em;
    text-align: center;
    
}
.finish-slide{
    line-height:1.4em
}
:root{
    --BarStartWidth:0%;
    --BarEndWidth:calc(var(--BarStartWidth) + 25%);
}
.animateStep{
    width:var(--BarEndWidth);
    background-color: black;
    animation: ZerotoHeroWidth 0.5s ease;
    
}
.PassedStep::after{
  
    width:100% !important;
    transition: 1s;

}

.GoBack{
    width:fit-content;
    padding:0px 10px;
    font-size: 1.5em;
    font-weight: 900;
    position: absolute;
    border-radius: 5px;
    background-color: transparent;
    border:none;
    color:white;
    cursor:pointer;
    left:-50px;
}
.GoBack:hover{
    background-color: #40916c;
}
@keyframes ZerotoHeroWidth{
    0%{
        width:0%;
    }
    100%{
        width:100%
    }
}
@keyframes GoBackBtnVisible {
    0%{
        left:-50px;
    }
    100%{
        left:10px;
    }
}
@keyframes GoBackBtnInvisible {
    0%{
        left:10px;
    }
    100%{
        left:-50px;
    }
}
              
            
!

JS

              
                
var GlobalSlideNo;
function NextSlide(SlideNo){
GlobalSlideNo=SlideNo
    event.preventDefault()
    if(SlideNo==1){
        document.querySelector(".GoBack").style.animation="GoBackBtnVisible 0.25s ease"
        document.querySelector(".GoBack").onanimationend=function(){
            this.style.animation=""
            this.style.left="10px"
        }
    }
    
    console.log(parseInt(window.getComputedStyle(document.querySelector("scroller")).getPropertyValue("margin-left"))-478);
    document.querySelector("scroller").style.marginLeft=parseInt(window.getComputedStyle(document.querySelector("scroller")).getPropertyValue("margin-left"))-478+"px";
    MoveIndicationBar(SlideNo)
    }
IndicatorObj={
    startVal:0,
    EndVal:25,
    currentWidth:0
}
function MoveIndicationBar(i){
    
    var step=document.querySelectorAll(".steps")[i-1]
    IndicatorObj.StepNo=i
    console.log(step)
    IndicatorObj.EndVal=i*25
    ZerotoHeroWidth()
    
    
}
function ZerotoHeroWidth(){
    var bar=document.querySelector(".active")
    var step=document.querySelectorAll(".steps")[IndicatorObj.StepNo-1]
    barStyle=parseInt(window.getComputedStyle(bar).width)
    if(IndicatorObj.currentWidth>IndicatorObj.EndVal/2){
        step.classList.add("PassedStep")
        
    }
    if(IndicatorObj.currentWidth<IndicatorObj.EndVal){
        IndicatorObj.currentWidth+=1
        bar.style.width=IndicatorObj.currentWidth+"%"
        window.requestAnimationFrame(ZerotoHeroWidth)
    }
    
}
function GoBack(){
    event.preventDefault()
    console.log(GlobalSlideNo)
    if(GlobalSlideNo<2){
        document.querySelector(".GoBack").style.animation="GoBackBtnInvisible 0.25s ease"
        document.querySelector(".GoBack").onanimationend=function(){
            this.style.animation=""
            this.style.left="-50px"
        }
    }
    GlobalSlideNo-=1
    console.log(parseInt(window.getComputedStyle(document.querySelector("scroller")).getPropertyValue("margin-left"))+478);
    document.querySelector("scroller").style.marginLeft=parseInt(window.getComputedStyle(document.querySelector("scroller")).getPropertyValue("margin-left"))+478+"px";
    document.querySelector(".GoBack").onclick=function(){
        event.preventDefault()
    }
    setTimeout(function(){
        document.querySelector(".GoBack").onclick=GoBack
    },500)
    MoveIndicationBarMinus(GlobalSlideNo)
    
    }
    



    IndicatorObj={
        startVal:25,
        EndVal:0,
        currentWidth:0
    }
    function MoveIndicationBarMinus(i){

        IndicatorObj.StepNo=i
    
        IndicatorObj.EndVal=i*25
        HerotoZeroWidth()
        console.log(IndicatorObj)
        
    }
    function HerotoZeroWidth(){
        var bar=document.querySelector(".active")
        var step=document.querySelectorAll(".steps")[IndicatorObj.StepNo-1]
        barStyle=parseInt(window.getComputedStyle(bar).width)
        if(IndicatorObj.currentWidth>IndicatorObj.EndVal){
            IndicatorObj.currentWidth-=1
            bar.style.width=IndicatorObj.currentWidth+"%"
            window.requestAnimationFrame(HerotoZeroWidth)
        }
        
    }
              
            
!
999px

Console