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="image-indicators">
        <input type="checkbox" class="point" id="point-1" name="point" value="1">
        <input type="checkbox" class="point" id="point-2" name="point" value="2">
        <input type="checkbox" class="point" id="point-3" name="point" value="3">
        <input type="checkbox" class="point" id="point-4" name="point" value="4">
        <label for="point-1" id="label-1" >
            <span>
                <span></span>
            </span>
        </label>
        <label for="point-2" id="label-2" >
            <span>
                <span></span>
            </span>
        </label>
        <label for="point-3" id="label-3">
            <span>
                <span></span>
            </span>
        </label>
        <label for="point-4" id="label-4">
            <span>
                <span></span>
            </span>
        </label>
        <img src="https://web.archive.org/web/20240101194720if_/https://www.musee-histoire-marseille-voie-historique.fr/sites/default/files/frontpage_intro_slides/file/m0918-2006.1.1.jpg">
        <div class="description">
            <div>
                <p>La peste à la Tourette représentant le chevalier Roze et les échevins, huile sur toile, 1755, collection Musée d'Histoire de Marseille.</p>
            </div>
            <div>
                <p>Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil</p>
                <p>impedit quo minus id quod maxime placeat facere possimus.</p>
            </div>
            <div>
                <p>Proin nunc sem, pretium vehicula erat vitae, pulvinar faucibus lectus.</p>
                <p>Curabitur ullamcorper elementum augue, ac tristique lacus commodo.</p>
            </div>
            <div>
                <p>Aliquam euismod, leo nec efficitur aliquet, neque nulla volutpat mi </p>
                <p>eget pretium mauris ligula vel semper.</p>
            </div>
            <div>
                <p>Mauris posuere, mauris in ultricies, neque nulla volutpat mi </p>
                <p>eget pretium mauris ligula vel semper.</p>
            </div>
        </div>
    </div>
              
            
!

CSS

              
                :root {
    --point-1-top: 220px;
    --point-1-left: 120px;

    --point-2-top: 20px;
    --point-2-left: 220px;

    --point-3-top: 130px;
    --point-3-left: 10px;

    --point-4-top: 155px;
    --point-4-left: 260px;

    --point-width: 15px;
    --point-height: 15px;

    --point-1-scale: 5;
    --point-2-scale: 3;
    --point-3-scale: 5;
    --point-4-scale: 4;
}

.description p { 
    margin: 0;
    font-size: 12px;
    z-index: -1;
    color: #ffffff;
}

.image-indicators img {
    width: 100%;
    border-radius: 10px;
    transition: width 0.4s ease, transform 0.4s ease;
}

.image-indicators {
    position: relative;
    width: 400px;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0;
    margin: auto;
}

.image-indicators label {
    display: flex;
    position: absolute;
    cursor: pointer;
    transition-property: opacity;
    transition-duration: 300ms;
    transition: opacity 0.3s ease-out .5s;
    z-index: 1;
}

.image-indicators>label>span {
    background-color: #2196f3;
    width: 10px;
    height: 10px;
    border-radius: 60px;
    transform: scale(1);
}

.image-indicators>label>span>span {
    display: inline-block;
    vertical-align: 20px;
    background-color: rgba(33, 150, 243, 1);
    width: 10px;
    height: 10px;
    transform: scale(0);
    border-radius: 60px;
    animation: scaleGrow 3s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    animation-play-state: running;
}

@keyframes scaleGrow {
    from {
        transform: scale(0);
        background-color: rgba(33, 150, 243, 1);
    }
    to {
        transform: scale(3);
        opacity: 0;
        
    }
}

@keyframes scaleDecreases {
    from {
        transform: scale(1);
    }

    50% {
        transform: scale(0.9);
    }

    to {
        transform: scale(1);
    }
}

.point {
    position: absolute;
    width: 10px;
    height: 10px;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    transition-property: width, height, left, top;
    transition-delay: 650ms;
}

.point:checked {
    top: -50% !important;
    left: -50% !important;
    width: 200%;
    height: 200%;
    z-index: 9;
}

.point:checked ~ label {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s ease-out 0s;
} 


.description {
    position: relative;
    height: 45px;
    overflow: hidden;
    border-radius: 10px;
    padding: 10px 20px;
    margin: 1px 10px 10px;
    color: black;
    z-index: 1;
}

.description div {
    display: none;
}

.description div:first-child {
    display: block;
    opacity: 1;
    transition-property: opacity;
    transition-duration: 300ms;
    transition: opacity 0.3s ease-out .5s;
}

.description div:first-child p {
    color: #000000;
}

.description p {
    line-height: 18px;
}

.point:checked ~ .description {
    background: rgb(191 191 191 / 30%);
    backdrop-filter: blur( 15px );
    -webkit-backdrop-filter: blur( 15.0px );
    border: 1px solid rgba( 255, 255, 255, 0.18 );
}

@for $i from 1 through 4 {
    $value: $i + 1;

    #label-#{$i} {
        top: var(--point-#{$i}-top);
        left: var(--point-#{$i}-left);
    }
    
    #point-#{$i} {
        left:var(--point-#{$i}-left);
        top: var(--point-#{$i}-top);
    }

    #point-#{$i}:checked ~ img {
        transform-origin: calc(var(--point-#{$i}-left)) calc(var(--point-#{$i}-top));
        transform: scale(var(--point-#{$i}-scale));
    }
    
    #point-#{$i}:hover ~ img {
        transform-origin: calc(var(--point-#{$i}-left)) calc(var(--point-#{$i}-top));
    }

    #point-#{$i}:checked ~ .description div:first-child {
        height: 0;
        opacity: 0;
        transition: opacity 0s ease-out 0s;
    }
    #point-#{$i}:checked ~ .description div:nth-child(#{$value}) {
        display: block;
    }
    
    #point-#{$i}:checked ~ .description div:nth-child(#{$value}) p:first-child {
        width: 0;
        opacity: 0;
        white-space: nowrap;
        overflow: hidden;
        -webkit-animation: type2 2s steps(40, end);
        animation: type2 2s steps(40, end);
        -webkit-animation-fill-mode: forwards;
        animation-fill-mode: forwards;
        animation-play-state: paused;
        -webkit-animation-delay: .5s;
        animation-delay: .5s;
        animation-play-state: running;
    }
    
    #point-#{$i}:checked ~ .description div:nth-child(#{$value}) p:nth-child(2) {
        width: 0;
        opacity: 0;
        white-space: nowrap;
        overflow: hidden;
        -webkit-animation: type2 2s steps(40, end);
        animation: type2 2s steps(40, end);
        -webkit-animation-fill-mode: forwards;
        animation-fill-mode: forwards;
        animation-play-state: paused;
        -webkit-animation-delay: 2.5s;
        animation-delay: 2.5s;
        animation-play-state: running;
    }
}

@-webkit-keyframes type2 {
  0% {
    width: 0;
  }
  1% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    width: 100%;
    border: none;
  }
}


// layout
body {
    display: flex;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    background-color: #ececec;
}
              
            
!

JS

              
                
              
            
!
999px

Console