Poor quality border rotation

I am working with a circle element that has half a border, and I want the border to animate and cover the entire circle when hovered over.

However, I am facing an issue where the border appears pixelated and of poor quality. Is there a way to fix this?

Here's the JSFIDDLE link for reference.

I achieved this effect using CSS, here is the code snippet:

.circle {
    border-radius: 50%;
    position: relative;
    -webkit-box-shadow: 3px 2px 5px 0px rgba(50, 50, 50, 0.69);
    -moz-box-shadow:    3px 2px 5px 0px rgba(50, 50, 50, 0.69);
    box-shadow:         3px 2px 5px 0px rgba(50, 50, 50, 0.69);
    height: 180px;
    width: 180px;
    margin: 9px auto;
    cursor: pointer;
}

.arc_q {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border-width: 7px;
    border-style: solid;
    border-image: none;

    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    transform: rotate(-45deg);

}

.arc_q_2 {
    -webkit-transform: rotate(-135deg);
    -moz-transform: rotate(-135deg);
    transform: rotate(-135deg);

}
.arc_q_3 {
    -webkit-transition: all 400ms;
    -moz-transition: all 400ms;
    transition: all 400ms;
    -webkit-transform: rotate(-135deg);
    -moz-transform: rotate(-135deg);
    transform: rotate(-135deg);
}
.arc_q_4 {
    -webkit-transition: all 400ms;
    -moz-transition: all 400ms;
    transition: all 400ms;
    -webkit-transform: rotate(-135deg);
    -moz-transform: rotate(-135deg);
    transform: rotate(-135deg);
}


.circle:hover .arc_q_3 {
    -webkit-transform: rotate(-225deg);
    -moz-transform: rotate(-225deg);
    transform: rotate(-225deg);


}
.circle:hover .arc_q_4 {
    -webkit-transform: rotate(-315deg);
    -moz-transform: rotate(-315deg);
    transform: rotate(-315deg);

}

#circle_1 .arc_q {
    border-color: #e01f25 transparent transparent transparent;
}

#circle_1 .circle {
    background-image: url('images/adegamae_logo.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-color: #fff;
    background-size: 80px;
}

Answer №1

AlexG has simplified the fiddle even more by dividing the circle into two halves with just two arc divs and an additional one to conceal elements. You can try this CSS code:

border-color: #e01f25 transparent transparent #e01f25;

instead of

border-color: #e01f25 transparent transparent transparent;

Check out the following fiddle for a demonstration: https://jsfiddle.net/38d47ag0/

It is important to mention that only the transform property is being transitioned, as it is the only one being modified.

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

Instructions on implementing getJSON in this code

I recently set up a chained select box with JSON data to populate options, using this Fiddle. While the data is hardcoded for now, I am looking to load it using the $.getJSON() method. However, despite my efforts, I haven't been able to get the code r ...

Set the CSS table to have a width of 100% and ensure that the table data cells have hidden

My table has a 100% width, and some of the td elements have overflow hidden. I want to make their text appear as ellipsis when it's too long. I can achieve this with fixed td sizes, but I need them to be relative to the content. This question was fi ...

Repeatedly triggering the Jquery Dialog Event

When I open a calendar plugin in jquery dialog, I encounter a recurring issue. Every time I close and reopen the dialog, my calendar event onDayClick triggers multiple times – twice, thrice, and so on. <div id="show_calendar"> <div class="c ...

Modify the colors of the chartist fill and stroke using JavaScript

Struggling to dynamically set colors in a chartist graph using JavaScript. How can custom colors be applied through JS? The attempted method below is not successfully changing the color for the showArea in the chartist graph. <!doctype html> <htm ...

Is there a way to enclose a mention within a unique span tag after highlighting it? Similar to how tags are implemented on platforms such

Currently utilizing an AngularJS plugin called ment.io for incorporating mentions. However, I am having difficulty figuring out how to customize the appearance of the selected mention. For example, in Stackoverflow: https://i.sstatic.net/bZrkh.png Or i ...

What happens when Google Polymer platform is used without defining _polyfilled?

My attempt at creating a simple example using Google Polymer's platform.js is running into an error message that says: Uncaught TypeError: Cannot read property '_polyfilled' of undefined This is what I'm attempting to achieve: <cur ...

Is it possible to dynamically utilize document.getElementById()?

I am attempting to print an HTML page using window.print after each REST API call updates the content. Is it possible to print continuously for each REST API call? var myPrintContent = document.getElementById("data-box"); var myPrintWindow = wind ...

When an absolute positioned element exceeds the right border of its relative parent, its width will be truncated

When position: absolute; divs are placed inside or around a position: relative; parent, their height and width are based on the size and length of the text they contain. However, if one of these divs extends beyond the right border of the relative parent, ...

Reflection mask feature in Chrome for Android that uses Webkit technology

Chrome Reflection on Desktop Computers By using Chrome on a desktop computer, I am able to create an image reflection with the following CSS code: img { -webkit-box-reflect: below 0 -webkit-gradient( linear, left top, left bottom, from(tran ...

What is the best way to determine the dimensions of thumbnails for photos stored on external servers?

I am currently working on an auction platform using Python/Django. Users have the ability to input URL's for their product images from external sites like Photobucket. My approach involves linking to the external product image when showcasing a speci ...

The alignment of Div elements is off in IE8

I have been struggling to align two divs side by side without any empty spaces on IE 8. Everything looks perfect on Chrome Version 35.0.1916.153 m and Firefox 30.0, but IE 8 seems to be causing some issues. All I want is a main div with two child divs ali ...

What is the proper way to showcase thumbnails in different sizes?

Currently, this is what I have: https://i.sstatic.net/VOC2z.png The display looks optimal with high-resolution landscape photos. This is the HTML and CSS code in use: <div class="upload-thumb ng-scope visible"> <span class="delete-media"&g ...

How to center align SVG with text in a unique way

Having trouble vertical aligning my inline SVG within a label. Any suggestions? This is how I've attempted it: <label for="menu-check-box">More<svg class="more-icon"><use xlink:href="#more-chevron"></use></svg></labe ...

Using jQuery to Implement Car Turn Signals (Blinkers)

Recently, I've been faced with an unusual challenge. I need to incorporate car turning lights functionality into my website. Specifically, I have to create a scenario where clicking either the left or right button triggers the corresponding green arro ...

The PHP file I'm trying to access isn't receiving the GET request from my PHP script

Basically, I want a button on one php page to trigger the printing of a new php page. This feature is working perfectly. The only issue is that I am trying to ensure the user ID gets passed over to the second page and displayed there. Strangely, it seems t ...

The string data needs to be extracted from the HTML page and then saved in the XML file within the respective categories

As part of a project, I am required to extract the value of a specific character ('v') from an HTML page that I have created. Within the HTML page are several links surrounded by irrelevant data: /watch?v=blablabla&list=blablabla&index=7&featu ...

What could be causing this table to exceed its dimensions by 2 pixels?

Why is the height of this table 102px instead of 100px? Is there another CSS attribute that needs to be set besides: table { border-spacing:0; border-collapse:collapse; } For example, check out this example link. ...

I am having trouble with the spacing on my website, even after I have tried declaring it

I'm having trouble formatting the footer to appear at the bottom of the page. I've tried adjusting the CSS code for the .container and .footer classes, but nothing seems to work. As a newbie in website development, any helpful tips or suggestions ...

Checking Twitter follower count using Jquery and JSON

Here is a script that counts twitter followers:. However, it seems to be displaying the list of followers twice. I would like some assistance in getting just the follower count stats for the array elements. Thank you! echo "<div id='twitter'& ...

Discovering the method to retrieve the information of the selected item in AngularJS

My table is using the ng-repeat in the <tr> element to load content dynamically from a JSON file. Each row has a unique ID in the table. I need a way to access the inner HTML of the respective row's ID column when it is clicked. Is there a solut ...