I noticed a spontaneous appearance of a circle within my CSS animation

Could someone please help me understand why there is a little blue circle appearing on the bottom right edge of the white circle at the end of my animation? I have tried resetting the animation from 100% to 0% but it hasn't helped.

The code is written in SCSS and you can find it on this CodePen link: Code Pen

SCSS:

*{box-sizing: border-box;}

.content-wrapper{
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.box{
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #fff;
    position: absolute;
}

.ping{
    border-radius: 50%;
    position: absolute;
    z-index: -1;
    animation: ping 1.6s ease-out infinite;
}

@keyframes ping{
    0% {
        width: 60%;
        height: 60%;
        left: 20%;
        top: 20%;
        border: 80px solid rgba(102, 217, 255, .5);
    }

    80% {
        width: 160%;
        height: 160%;
        left: -30%;
        top: -30%;
        border: 4px solid rgba(102, 217, 255, 1);
    }

    99% {
        opacity: 0;
    }

    100% {
        border: 0px solid rgba(102, 217, 255, 1);
        width: 0%;
        height: 0%;
        left: 0%;
        top: 0%;
    }
}

HTML:

<div class="content-wrapper">
    <div class="box">
        <div class="ping"></div>
    </div>
</div>

Answer №1

By adjusting the animation duration to 16s rather than 1.6s and applying an outline to the .ping element, you can observe the issue regarding how the element moves.


It is recommended to utilize the transform property to center a resizing element instead of animating the left and top properties.

*{box-sizing: border-box;}

.content-wrapper{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}

.box{
width: 200px;
height: 200px;
border-radius: 50%;
background-color: rgba(255,255,255,1);
position: absolute;
}

.ping{
border-radius: 50%;
position: absolute;
z-index: -1;
animation: ping 1.6s ease-out infinite;

transform:translate(-50%, -50%);
left:50%;
top:50%;
}

@keyframes ping{
0% {
width: 60%;
height: 60%;
border: 80px solid rgba(102, 217, 255, .5);
}

80% {
width: 160%;
height: 160%;
border: 4px solid rgba(102, 217, 255, 1);
}

99% {
opacity: 0;
}

100% {
border: 0px solid rgba(102, 217, 255, 1);
width: 0%;
height: 0%;
}
}
<div class="content-wrapper">
<div class="box">
<div class="ping"></div>
</div>
</div>

Answer №2

The source of the animation lies within the ping keyframes:

@keyframes ping {
  border: 80px solid rgba(102, 217, 255, .5);
}

These keyframes are then referenced in the animation property for the .ping class:

animation: ping 1.6s ease-out infinite;

The specific shade of blue displayed is represented by rgba(102, 217, 255, .5).

To eliminate this effect, you should delete any instances of border within the @keyframes ping declaration.

I hope this explanation clarifies things for you!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display toolbar title on small screens in separate lines

Recently, I encountered an issue while using v-toolbar in my vue app. Despite my efforts, I couldn't find a way to split the title into multiple lines on small screens. Currently, it displays as "Secti...." on smaller devices. Can anyone assist me wit ...

What steps should I take to prevent my <mat-card> from expanding whenever messages are shown in Angular 9?

I have a <mat-card> containing a login form on my page. However, when error messages are displayed, the vertical size of the <mat-card> changes and I need it to remain the same. Is there a way to prevent this from happening? Below, you will ...

What is preventing this code from setting the background color of the main content all the way to the bottom of the

I designed this webpage using HTML and CSS. ... #contents { margin: 0px; padding: 0px; width: 100%; background-color: white; color: black; border-top: 3px solid black; background-image: url(img/CloverImage.png); background ...

Customize your radio buttons to display as stylish boxes with Bootstrap

Check out my Fiddle here... The radio buttons are displaying correctly in the fiddle. <div class="element-radio" title="Do you want to float the text to the left, right, or not at all?"><h4 class="title" style="font-weight: bold;">Float (left ...

Design a logo to serve as the main button on the navigation bar of the

I've been experimenting with adding a logo instead of the 'Home' text in my navigation bar, but I'm not sure where to implement it. Should I add it within #nav or separately? Also, I want the nav bar to stay fixed without overlapping on ...

What is the best way to customize the styles of a reusable component in Angular2?

I am working with a reusable component called "two-column-layout-wrapper" that has its styles defined in the main .css file. In another module, I need to use this component but customize the width of two classes. How can I override these styles? import ...

"Enhance your website with a dynamic carousel feature using Twitter Bootstrap's JavaScript

After researching various examples, I noticed that most of them only display one Item at a time. I want to have multiple active items displayed using thumbnails, but the examples I found show that the Item itself contains multiple thumbnails inside of it. ...

"Creating a link to a button with the type of 'submit' in HTML - a step-by-step

Found the solution on this interesting page: In a list, there's a button: <form> <ul> <li> <a href="account.html" class="button"> <button type="submit">Submit</button> ...

The alignment of columns in the fixed header table is off since it does not contain the necessary <thead> and <tbody> elements

On my page, I have three tables, with one of them containing a large amount of data. To make it easier to read, I decided to have a fixed header for the table. However, I am facing an issue where the columns in the thead (header) and tbody (body) are not a ...

Achieving full screen height at 100% with the CSS property of display: table along with table-cell tag

I'm facing an issue with the layout of my page. In this example (http://jsfiddle.net/RR2Xc/2/), the footer is not positioned at the bottom as desired. If I force the footer to be at the bottom, it creates a gap between the sidebar and footer where the ...

Span element not displaying as a clickable hyperlink

The magnifying glass icon inside the orange search bar at the top of this page is not appearing as a link, so when hovered over there is no pointer.. Any thoughts on why this might be? Below is the CSS: .searchGlass { background-image: url(/images/search ...

Are conditional comments truly the best approach? What is their functionality and operation like?

A previous question addressing a div positioning issue in Internet Explorer received multiple suggestions advising the use of conditional commenting Why is this relatively positioned div displaying differently in IE? How does one implement conditional co ...

Creating a customized conditional overflow style in _document.js for Next.js

Is there a way to dynamically change the overflow style for the html and body elements based on the page being viewed? For instance, on the about page, I want to hide overflow for html but not for body, whereas on the contact page, I want to hide overflow ...

Incorporating a Bootstrap form within a form group

Can a select element be inserted inside a horizontal form in Bootstrap? I am trying to add a form with a select element inside a form group. Check out the code on Bootply. Note: Copy the code below as Bootply sometimes removes certain form tags. The is ...

Weird Chrome behaviors with CSS3 animations

I have been working on a CSS3 animation that involves rotating a div with an image in the background. My goal is to have the same animation play at a different speed when the user hovers over the element. Here is the code snippet I have been using: .roc ...

Connecting the dots between the price and the menu item

I am currently working on creating a menu with a list of dishes, and I need to include dots to separate the price from the description. I want it to look something like this: https://i.sstatic.net/h7PO4.png If the description is too long, it should look l ...

Customize the bootstrap carousel to show multiple slides at the same time

I am looking to customize the bootstrap 3 carousel in order to show multiple slides at once. I understand that I could place several thumbnails in a single slide (div .item), but the issue is that the carousel will progress through them all at once, moving ...

What are the steps to create a login form that is responsive by utilizing the Bootstrap grid system

.custom-border { border: 2px groove #000 !important; padding: 0px 5.4em 1.4em 6.4em !important; margin: 0 0 1.5em 0 !important; box-shadow: 0px 0px 0px 0px #000; margin-top: 30px !important; } .custom-legend { font-size: 1.2em !important; te ...

Make the height of the CSS div fill the remaining space and allow scrolling once the maximum height of the screen is reached

I've scoured the internet high and low for a solution to my problem, but I just can't seem to find anything that fits my needs perfectly. The answers I have come across are either outdated or not quite what I'm looking for. I'm really h ...

Padding-left may cause text to not wrap correctly

Every link in the left menu has a padding-left: 15px;. This is done to accommodate a background image (the blue arrow). However, when text wraps (like in "Paintings, prints, and watercolours"), it seems to ignore the padding. I've searched extensive ...