Add a circular transition effect to Font Awesome icons

Check out my code snippet on JSFIDDLE: https://jsfiddle.net/8f3vLh0a/14/

I am using font awesome icons and I would like to add a circling effect on hover similar to this demo: http://tympanus.net/Tutorials/ResponsiveRetinaReadyMenu/

How can I implement this circling effect in my JSFIDDLE demo? Below is the HTML code snippet:

    <div class="container">

          <ul class="icon-menu">
                <li class="icon-box home"> <i class="fa fa-home fa-4x"></i>
        <a href="#">
                      <span class="icon home "></span>
                      <h2>Home</h2>
                    </a>
                </li>   


                <li class="icon-box aboutme"> 
        <i class="fa fa-home fa-4x"></i>
                    <a href="#">
            <span class="icon aboutme"></span>
                      <h2>About Me</h2>
                    </a>
                </li>


                <li class="icon-box portfolio"> 
        <i class="fa fa-home fa-4x"></i>
                     <a href="#">
                        <span class="icon portfolio"></span>
                         <h2>Portfolio</h2>
                     </a>
                </li>


                <li class="icon-box blog"> 
          <i class="fa fa-home fa-4x"></i>
                     <a href="#">
                         <span class="icon blog"></span>
                          <h2>Blog</h2>
                     </a>
                </li>


                <li class="icon-box contact"> \
          <i class="fa fa-home fa-4x"></i>
                     <a href="#">
                        <span class="icon contact"></span>
                        <h2>Contact</h2>
                       </a>
                </li>

          </ul>

 </div>

 </div>

Answer №1

Check out the latest version of your fiddle here: https://jsfiddle.net/8f3vLh0a/17/

The section that creates the captivating "circling effect" is below:

.icon-menu i {
    border-radius: 50%;
    box-shadow: 0 0 0 50px transparent;
    padding: 0.2em 0.25em;
    background: rgba(255,255,255,0.1);
    transform: translate3d(0, 0, 0);
    transition: box-shadow .6s ease-in-out;
}

.icon-menu li:hover i,
.icon-menu li:active i,
.icon-menu li:focus i {     
    box-shadow: 0 0 0 0 rgba(255,255,255,0.2);
    transition: box-shadow .4s ease-in-out;
}

In essence, this code snippet ensures that the default state has a hidden box-shadow, and upon interaction, it smoothly transitions between visible and hidden states. The circular background behind the icons can be adjusted by tweaking the padding. Additionally, the coordinates of the icons have been modified for optimum appearance.

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

Creating a dynamic linear gradient background color using Angular 2 binding

Using static values works perfectly <div style="background: linear-gradient(to right, #0000FF 0%, #0000FF 50%, #FFA500 50%, #FFA500 100%);"></div> in my TypeScript file. this.blueColor = '#0000FF'; this.orangColor = '#FFA500&a ...

Optimal techniques for leveraging CSS within Mui and Reactjs

Just starting out with mui, I'm currently working on styling CSS for mui components like so <Typography variant="h5" sx={{ fontWeight: "bold", color: "#1a759f", display: "flex", ...

The data type 'Event' cannot be assigned to the data type 'string' in this context

Recently diving into Angular, I came across a stumbling block while working through the hero tutorial. The error message that popped up was: Type 'Event' is not assignable to type 'string' You can see the error replicated here. ...

Alternate. (individually)

Issue with Running Program I've been struggling to get my program to run correctly. The task at hand is to have the program display only one question at a time. But no matter what I try, clicking on all questions displays all the answers simultaneous ...

Custom Homepage with Integrated Google Web Search and Autocomplete Feature

Is there a way to incorporate the standard Google web search with autocomplete into my own webpage, without using a custom search engine like www.google.com? I have been unable to find any examples or guides on how to accomplish this. All the resources see ...

When buttons are clicked within Angular Material's Card component, it automatically triggers the click event of the card itself

One of the challenges I'm facing is having a mat-card within a component template: <mat-card *ngFor="let p of products" (click)="viewProduct(p)"> <mat-card-actions> <button mat-stroked-button (click)="addProductToCart(p)"&g ...

PHP: Retrieve and store XML data for one-time use within a session

I have implemented Simplexml within a class to load specific nodes from my xml file into html. <?xml version="1.0" encoding="UTF-8"?> <note> <item> <title>Reminder</title> </item> <item> ...

Ways to eliminate spacing from a bullet point in a list?

Is there a way to eliminate indentation from ul? I attempted adjusting margin, padding, and text-indent to 0, but with no success. It appears that setting text-indent to a negative value works - but is this the only solution for removing the indentation? ...

Create a form with a mailto link that includes a subject line containing "XXXX" followed by user input

Need help with customizing the email subject along with the user's name from a form input <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc8f939199939299bc8593898e8f958899d29f9391">[email protec ...

Applying conditional statements to an array's parent elements during iterations in JavaScript

Here is my complete script for relevance. I am currently looping through an array from a JSON object and populating content into an HTML div based on the content's ID. The process works well, but I am facing an issue with the logic related to the par ...

Exploring Django's HTML QuerySet

Is there a way to verify if a student exists in the database class table, given that the student is assigned as a foreign key in the table? I am looking to achieve this without opening another loop. index.html: <ul> {% for student in studentList %} ...

unable to properly display application.html.erb

I am encountering difficulties in rendering my application.html.erb template as I am receiving the following error message: ActionView::SyntaxErrorInTemplate within ApplicationController#home app/views/layouts/application.HTML.erb:10: syntax error, unexpec ...

Modifying the appearance of a text area through the adjustment of a single file

I am in the process of creating a unique code box style that I frequently update to keep it fresh. My goal is to have all the script external so that editing one file will automatically update all code boxes, eliminating the need to edit each one individua ...

Decrease the gap between the ticks on a horizontal bar chart in ChartJS

Currently, I am utilizing the horizontal bar chart feature from chartjs and encountering an issue with the chart appearing too large. In addition, there is a notable gap between the ticks on the xAxis (as shown in the attached image). Does anyone know how ...

"Create a dynamic and user-friendly responsive navbar using Bootstrap with toggle

I need assistance with creating a new project template to convert a WordPress template into a Bootstrap template. Currently, I am working on the navbar and facing issues with responsive design and toggle navigation. On laptop devices, the navbar looks goo ...

How to design a bell curve using CSS styling

Exploring CSS shape design, I am aiming to create a classic bell shape reminiscent of the holiday season. While the top and bottom balls are not essential to my design, here is the basic outline I'm striving for: This is what I have been able to achi ...

I need to condense my layout from three columns to just two columns in HTML

The html code for "Date Accessed" is meant to be in one column as a header, while the actual dates should be in another column, but somehow they are all appearing in a single column. I am having trouble figuring out why. <!DOCTYPE html> {% load stati ...

Guide to showcasing user input using a Javascript function

I need assistance to show the user input via the submit button. Users will enter tool types and the first five inputs will be displayed in list items (li). Once the limit of 5 tools is reached, a message 'Thanks for your suggestions' should appea ...

Using PHP and an HTML form to input multiple data entries into a MySQL database

I am currently working on a project that involves reading and inserting columns and rows from an HTML form into a MySQL database using PHP. When trying to execute the code, I encountered the following error: Undefined index: maintenance on line 28 Undef ...

Tips for shifting the cursor slightly to the right within an Input field

I created a div with an input field inside. I set the input field to autofocus, so when the page loads, the cursor is automatically focused on the input field. However, the cursor is touching the border of the input field, making it hard to see clearly. ...