Expand the width of the dynamic arc surrounding the circle

I borrowed an animated circle with a timer. I need to adjust the width of the animated arch within the circle.

Can someone help me do this? I'm having trouble figuring it out on my own.

You can access the jsFiddle here

This is where I have set the width of the animated arch in the CSS:

CSS:

.timer > #slice > .pie {
    border: 5px solid blue;
    position:absolute;
    width:160px; /* 170 - (2 * border width) */
    height:160px; /* 170 - (2 * border width) */
    clip:rect(0em,0.5em,1em,0em);
    -moz-border-radius:0.5em;
    -webkit-border-radius:0.5em; 
    border-radius:0.5em; 
}

JS:

$('div.timer'+instance).html('<div class="percent"></div><div id="slice"'+(percent > 50?' class="gt50"':'')+'><div class="pie"></div>'+(percent > 50?'<div class="pie fill"></div>':'')+'</div>');

Answer №1

Check out this JsFiddle link

To achieve this effect, simply add the following CSS code:

.timer > #slice > .pie {
  border: 10px solid blue;
  position:absolute;
  width:150px; /* 170 - (2 * border width) */
  height:150px; /* 170 - (2 * border width) */
  clip:rect(0em,0.5em,1em,0em);
  -moz-border-radius:0.5em;
  -webkit-border-radius:0.5em; 
  border-radius:0.5em; 
}

Increase the size of the border and then adjust the width and height accordingly.

Answer №2

To see the desired outcome, adjustments need to be made to the width attribute.

Modify the pixel level accordingly for it to function properly.

width:160px; /* 170 - (2 * border size) */

Example:width:190px;

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

How to Retrieve the Name of the Active Element from an Unordered List (<ul>) in ReactJS and Display it in the

I have a project where I am creating a long navbar specifically for mobile devices, and I am structuring it in an accordion style. Initially, the view will show the currently active link name. When the user clicks on this active link name, it expands below ...

Unable to retrieve the length of HTMLCollection

I've been having an issue with accessing all the dynamically created list elements (<li>) on my page using getElementsByTagName. The console keeps showing that the length of my li array is 0. Despite going through documentation and examples rel ...

Designating a class that applies to every Angular template that can be displayed using *ngIf

I have a specific CLASS called section that I want to apply to a DIV for rendering. Surprisingly, it functions as expected. <div *ngIf="decoded; then coordinates"></div> <ng-template #coordinates> <div class="section&q ...

Iterate through every object in a JSON request using either jQuery or JavaScript

Admittedly, I'm fairly new to json/jQuery and JavaScript, so please bear with me if I make any obvious mistakes. Despite looking at similar questions, none of the solutions seemed to work for me. My goal is to retrieve the "image.full" property for e ...

When defining a component decorator in Angular 2, mixing tabs and spaces can lead to an unhandled exception

After refactoring my Angular 2 component code and adding some tabulations, the code suddenly stopped working. Surprisingly, when I removed the tabs (spaces), it started working again. @Component({ templateUrl : './app.component.html', styl ...

I never rely on the browser back button, I prefer to remain on the same page

Being new to Angular, I have come across the following code snippet: HTML template: <a href="" ng-click="goToCategories();">See categories</a> JS File: $scope.goToCategories= function () { CategoriesService.getCateg ...

Identify the month in which there is no data available in the database

The existing query is working perfectly, but the issue is that there is no data for the current month (April), causing it not to list the month with 0 interviews. How can I make it so that the month is listed with 0 interviews? QUERY select distinct from ...

Exclusive Checkbox Update

My code is causing me some trouble. When I click the update button, I want to only display the checked fields from the checkboxes on the redirected page. Below, I will share the code from the initial page, followed by the code from the second page where t ...

Latest Version of Joomla includes Jquery 3.4.3 Files

In my Joomla 3.4.3 setup, while debugging in Firefox using Inspect Element, I noticed a message in the console pointing to http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1.8.21/jquery-ui.min.js. Next to this item, it displays: [HTTP/1.1 404 Not Found ...

Is there a way to organize divs to match the layout shown in the picture?

Can someone show me how to achieve this design? https://i.sstatic.net/xbrJC.png I'm currently using bootstrap 4 and my current layout looks like this https://i.sstatic.net/o78ZN.png This is the code I have so far: <div class="col-2 row align-ite ...

Node.js script to convert server time to a specific local time

I have this code running on my server-side nodejs for timezone conversion. convertNowToTimezone = (localOffset) => { let d = new Date(); let millis = d.getTime() + (d.getTimezoneOffset() * 60000); //converting server local time to UTC milliseconds ...

Tips for effectively creating a fresh array of objects by extracting distinct values from arrays of child elements within a collection of parent objects

We have a requirement to extract data from objects structured like this: [ { "first": { "children" : [{ "name": "abc", "detail":"123"}, { "name": "def", "detail":"456"} ] }}, { "second": { "children" : [{ ...

Vercel and Express.js do not support hosting JavaScript files

I set up an Express.js server on Vercel with NowCLI, and in my index.js file, I configured it to serve all files in my dash/assets folder at assetsDash/ using app.use('/assetsDash', express.static(path.join(__dirname, 'dash', 'asse ...

A recursive approach to iterate through a JSON object

I recently learned a method to recursively iterate through a complex JSON object that contains both objects and arrays. Imagine the object below: { "data":[ { "Name": "Name1", "Id": "Id1", "Prop": { ...

Using the mt-downloader module in a Node application is a straightforward process

Hey there, I'm looking to incorporate the Multi downloader module into my project. I've checked out the GitHub link, but unfortunately, there are no examples provided on how to actually use this module. I came across this example and tried implem ...

What is causing my PHP script to handle NULL values when making an AJAX request?

I am facing an issue where PHP is returning NULL instead of the expected data when interacting with AJAX. Check out the relevant code snippets below: header.php <?php include_once("obtainData.php"); ?> <!DOCTYPE html> <html lang="es"&g ...

The specific page redirect to its corresponding mobile page is not functioning properly

Having some issues with the code below that is causing problems when trying to redirect users to specific mobile pages based on the desktop page. Any assistance would be greatly appreciated. function mon() { if ($('body').is('.mon') ...

Font discrepancies in HTML field types "text" and "textarea" are causing inconsistent font display

Why do the text in my "text" and "textarea" fields show different fonts on my pages' HTML? I attempted to specify the font type in both the background CSS file and within the HTML, but it did not resolve the issue. Just to be transparent...I'm ...

In my current Next.js project, I tried setting up a new [collectionId].jsx file within the pages directory, but I am facing issues with getting

In my current next.js project, I recently created a file named [collectionId].jsx within the pages directory. Interestingly, I noticed that Tailwind CSS does not seem to work properly with this file. However, when I renamed the file to [collectionId].js wi ...

Which one should you begin with: AngularJS or Angular 2?

Interested in learning Angular and curious about the differences between Angular, AngularJS, and Angular 2. Should I focus on educating myself on Angular or go straight to Angular 2, considering it's now in beta version? Is there a significant differ ...