Steps to halt webkit animation within a div located inside a circle:

I have a series of nested circle divs, and I want to give them a pulse animation. The issue is that the text container is within one of these circles, causing the animation to apply to the text as well. I am unable to move the text container due to potential complications it may cause. Unfortunately, I cannot share the actual project example due to copyright restrictions. Is there a way to resolve this without adjusting the position of the text?

I attempted the following solution but was unsuccessful in manipulating the inner circle's animation:

.myText{ animation-play-state: paused;}
#first-circle{border-radius:50%;width:643px;height:643px;position:absolute;top:0;left:0;border:1px solid #000;-webkit-animation: pulsate 1s ease-out;-webkit-animation-iteration-count: infinite;}
#second-circle{position:absolute;border-radius:50%;border:1px solid #000;width:508px;height:508px;top:50%;left:50%;margin:-254px 0 0 -254px}
#third-circle{position:absolute;width:382px;height:382px; border:1px solid #000;border-radius:50%;top:50%;left:50%;margin:-191px 0 0 -191px}
#fourth-circle{position:absolute;width:254px;height:254px;border:1px solid #000;border-radius:50%;top:50%;left:50%;margin:-127px 0 0 -127px}
#fifth-circle{position:absolute;font-size:14px;width:128px;height:128px;text-align:center;border:1px solid #000;border-radius:50%;top:50%;left:50%;margin:-64px 0 0 -64px}
.myText{
margin-top:55px;
}
@-webkit-keyframes pulsate {
    0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
    50% {opacity: 1.0;}
    100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;}
}
 <div id="first-circle" >      
        <div id="second-circle" >
          <div id="third-circle" >
            <div id="fourth-circle" >
              <div id="fifth-circle" >
                <div class="myText">
                My Text
                </div>
               </div>
              </div>
            </div>
          </div>
        </div>
     

Answer №1

Revamp it with fewer components.

.box {
  margin:150px;
  display:inline-block;
  position:relative;
}
.box:before {
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:500%;
  padding-top:500%;
  border:2px solid; /* 1 circle here */
  border-radius:50%;
  /* 3 circles here */
  background:
    radial-gradient(farthest-side,transparent 75%,#000 calc(75% + 1px) calc(75% + 2px),transparent calc(75% + 3px)),
    radial-gradient(farthest-side,transparent 50%,#000 calc(40% + 1px) calc(50% + 2px),transparent calc(50% + 3px)),
    radial-gradient(farthest-side,transparent 25%,#000 calc(25% + 1px) calc(25% + 2px),transparent calc(25% + 3px))
    /* to add another circle
    radial-gradient(farthest-side,transparent X%,#000 calc(X% + 1px) calc(X% + 2px),transparent calc(X% + 3px))*/;
  animation:pulsate 1s linear infinite; 
}

@keyframes pulsate {
  0% {
    transform: translate(-50%,-50%) scale(0.1);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%,-50%) scale(1.2);
    opacity: 0;
  }
}
<div class="box">
  some text
</div>

By reducing the number of nested elements, you'll avoid the outer element's scale effect impacting the inner elements which cannot be disabled in your current situation.

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

Step-by-step guide on utilizing User scripts with the $window.open function in AngularJS

I am looking to initiate the following action - (for example: Upon clicking a button, it should direct to this , similar to how payment gateways function) and then, I need to input the user script below: getRealData('{"mailing":{"postalCode":"1 ...

Hovering over overlapping spans without moving them

For the text formatting, I attempted to use the following code: <style> #items { width:400px; padding: 10px; } .esp { float: left; background-color: yellow; position:relative; z-index:0; } .le { float: left; position:rela ...

Tips for utilizing bootstrap.css to position a web design form in the center of the page and place the copyright at the bottom

I have spent several hours trying to figure out how to achieve this, but still haven't found the solution. I have a form that I believe doesn't look very good: So, I attempted to center the form on the page and place the footer.php at the botto ...

Transferring the link value to an AJAX function when the onclick event is triggered

I have a link containing some data. For example: <li><a href="" onclick="getcategory(this);"><?php echo $result22['category']; ?></a></li> I need this link to pass the value of $result22['category']; to ...

Integrating individual script into HTML

Imagine you have a file named public/index.html. Additionally, there is another html file called otherScript, which contains only <script> tags with a script inside. How can you include these scripts into your public/index.html file? You intend to ...

Show small information box when hovering over custom toggle button

I have developed a unique custom toggle switch feature When I hover my mouse over the switch, it should display a tooltip message as YES if the switch is in the ON position and NO if it's in the OFF position. Is there a way to implement this functio ...

How can I ensure a header is displayed on each page by utilizing CSS or JavaScript/jQuery?

On a lengthy page with approximately 15 pages of text, I would like to insert a header at the beginning of each page when the document is printed by the user. Can this functionality be achieved using CSS or JavaScript/jQuery? ...

Navigate to a new page when a dialog button is clicked using JQuery UI

$(".btn").click(function(){ $('<div></div>').appendTo('body') .html('<div> Select </div>') .dialog({ modal: true, title: 'Select', zIndex: 10000,autoOpen:true, ...

HTML and CSS link conflict

As a beginner in CSS, I am experimenting with creating a simple website using HTML and CSS. However, I have encountered an issue where the links on the left side of my page are being interfered with by a paragraph in the middle section. This causes some of ...

Need help creating perfect round buttons with bootstrap 4?

After incorporating this fiddle into my code, the goal was to design a circular button. View Fiddle Here The code provided is for bootstrap 3. However, when using it with bootstrap 4, the button ends up being square instead of circular. See example here: ...

Verification is required for additional elements within the div block once a single checkbox has been selected

Currently, I am working in PHP using the CodeIgniter framework. I have a question regarding implementing a functionality with checkboxes and validation using jQuery. Here is the scenario I want to achieve: There are four checkboxes, and when one checkbox ...

Eliminate the see-through effect from a logo positioned in a fading container

I created a div with image fading functionality using JavaScript and placed a static SVG logo on top of it. The issue I'm facing is that the logo appears somewhat transparent, allowing the image in the div to show through. Despite adjusting the z-inde ...

Changing the value of an object in Angular can be achieved by utilizing the two

I have a service with the following methods: getLastStatus(id): Observable<string> { let url_detail = this.apiurl + `/${id}`; return this.http.get<any>(url_detail, this.httpOptions).pipe( map(data => { ...

Why do my padding and font size fail to match the height of my container?

When setting the height of my boxes to match the height of my <nav>, I encountered overflow issues. Despite using a 10rem height for the nav and a 2.25rem font, calculating the padding as 10-2.25/2 didn't result in the desired outcome. Can someo ...

Passing an ID in Next.js without showing it in the URL

I am looking to transfer the product id from the category page to the product page without showing it in the URL Category.js <h2> <Link href={{ pathname: `/product/car/${title}`, query: { id: Item.id, }, }} as={`/p ...

Increase the lag time for the execution of the on('data') function in Node.js

In my current function, it searches data from a database and performs an action with it. For the purpose of this demonstration, it simply increments a counter. exports.fullThreads = function(){ return new Promise((resolve, reject) => { MongoClien ...

Problem with Loading Images in JSP

When trying to display an image on my jsp page using the code < img src="C:/NetBeanProject/images.jpg" alt="abc" width="42" height="42"/>, the image does not appear. Is there something incorrect with this code? ...

Retrieve the ID from either a search query or an insertion operation in MongoDB

I find myself frequently using this particular pattern. It feels a bit cumbersome to make two MongoDB calls for the task, and I am curious if there is a more efficient way to achieve this. My goal is to obtain the ID of an existing document, or.. create ...

AngularJS: Implementing a toggle click function for a list of items within an iframe

Here's the workflow I'm dealing with: I have a collection of items, each having an ng-click event that triggers the display of an iframe below the clicked item. The process works like this: When clicking an item, a hidden div tag beneath it ap ...

Retrieve a specific HTML using the returned jQuery AJAX POST request

$('#form-register').change(function() { var i_username = $('input#input-username').val(); var i_password = $('input#input-password').val(); var i_company = $('input#input-company').val(); var i_phone ...