CSS animation is supported on most browsers with the exception of Safari

I'm facing an issue with my animation that works fine on all browsers except Safari. I've tried using the autoprefix extension in VSCode to automatically add CSS vendor prefixes, but the animation still isn't functioning correctly.

Here's a screenshot of the error

You can view the demo on CodePen: https://codepen.io/mnr39pro/pen/PoNJmEQ

HTML code:

.img-rs{
    height: auto; 
    max-width: 100%; 
}

.mystack{
  margin-top: 10rem;
    display: flex;
    flex-wrap: wrap ;
    justify-content: center;
    align-items: center;
}

.dbox{
    position: relative;
    width: 6rem;
    height: 6rem;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    animation: animate3d 20s linear infinite;
    -webkit-animation: animate3d 20s linear infinite;
    
}

@-webkit-keyframes animate3d{
    0%{
        transform: perspective(62.5rem) rotateX(0deg) rotateY(35deg);
    }

    100%{
        transform: perspective(62.5rem) rotateX(360deg) rotateY(35deg);
    }
}

@keyframes animate3d{
    0%{
        transform: perspective(62.5rem) rotateX(0deg) rotateY(35deg);
    }

    100%{
        transform: perspective(62.5rem) rotateX(360deg) rotateY(35deg);
    }
}

.dbox span{
    position: absolute;
    top: 0;
    left:0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    -webkit-transform-origin: center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateX(calc(var(--i) * 51.5deg)) translateZ(6.5rem);
    -webkit-transform: rotateX(calc(var(--i) * 51.5deg)) translateZ(6.5rem);

}

.dbox span img{
    position: absolute;
    top: 0;
    left:0;
    width: 100%;
    height: 100%;
}
<div class="my-stack">
            <div class="mystack">
            <div class="dbox">
                <span style="--i:1;"><img class="img-rs" src="https://bestyphone.com/img/html5.png" alt="HTML5"></span>
                <span style="--i:2;"><img class="img-rs" src="https://bestyphone.com/img/css3.png" alt="CSS3"></span>
                <span style="--i:3;"><img class="img-rs" src="https://bestyphone.com/img/javascript.png" alt="Javascript"></span>
                <span style="--i:4;"><img class="img-rs" src="https://bestyphone.com/img/wordpress.png" alt="Wordpress"></span>
                <span style="--i:5;"><img class="img-rs" src="https://bestyphone.com/img/bootstrap.png" alt="Bootstrap"></span>
                <span style="--i:6;"><img class="img-rs" src="https://bestyphone.com/img/jquery.png" alt="jquery"></span>
                <span style="--i:7;"><img class="img-rs" src="https://bestyphone.com/img/python.png" alt="python"></span>
            </div>
        </div>
        </div>

If anyone has a solution, please share.

Thank you in advance

Answer №1

Ensure compatibility with browsers for the parent <div> mystack class and include support for @-webkit-keyframes.

 .mystack{
      margin-top: 10rem;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap ;
            flex-wrap: wrap ;
        -webkit-box-pack: center;
            -ms-flex-pack: center;
                justify-content: center;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
    }

@-webkit-keyframes animate3d{
        0%{
            -webkit-transform: perspective(62.5rem) rotateX(0deg) rotateY(35deg);
                    transform: perspective(62.5rem) rotateX(0deg) rotateY(35deg);
        }
    
        100%{
            -webkit-transform: perspective(62.5rem) rotateX(360deg) rotateY(35deg);
                    transform: perspective(62.5rem) rotateX(360deg) rotateY(35deg);
        }
    }

Answer №2

The issue was fixed by removing the "perspective(62.5rem)" from the animation.

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

Issue with CSS3 calc() validation: Invalid value provided for width, resulting in a parse error

Can you help me validate a CSS3 file that contains the following code snippet? width:calc(96.3% - 312px) When I try to validate it, I get this error message: Value Error : width Parse Error - 312px) My solution might be to implement a JavaScript func ...

Is it possible to have a hidden div box within a WordPress post that is only visible to the author of the

How can I create a div box with "id=secret" inside a post that is only visible to the author of the post? I initially made it for the admin, but now I want the id to be visible exclusively to the post's author. For instance: If the author is curren ...

Transmitting video through a local area network

I am seeking a solution to stream video content to a local network with potentially over 1000 viewers. The streaming will need to be accessible via web browsers such as Internet Explorer, Chrome, and Firefox, as not all users have internet access due to co ...

Encountered a MySQL error while attempting to insert an image into the database

I have a task to work on a website where users can upload product images that will be stored in a MySQL database. The code for my HTML form is: <FORM action="testimage1.php" ENCTYPE="multipart/form-data" method="post"> <div st ...

Exploring the inner workings of AngularJS SEO in HTML5 mode: Seeking a deeper understanding of this hidden functionality

There are plenty of resources available for incorporating SEO-friendly AngularJS applications, but despite going through them multiple times, I still have some confusion, especially regarding the difference between hashbang and HTML5 mode: In hashbang (# ...

Problem with translating a variable into a selector in JQuery

When attempting to make my Jquery code more flexible, I decided to extract the selector and access it through a variable. However, despite creating variables for both selectors, neither of them seem to be functioning properly. I am confident that the issue ...

Tips for utilizing the font-family style to span multiple columns

I recently discovered that you can set the background color across table columns using the <colgroup> tag. table { border: 2px solid; border-collapse: collapse; } td { border: 2px solid; } <ta ...

Restrict Scrolling on Login Page

I am experiencing an issue where my login screen does not scroll on PC, but when accessed on mobile, it starts to scroll. I have tried implementing various solutions recommended in other threads on this platform, but unfortunately, nothing seems to be work ...

Exploring the Differences in CSS Styling between Web and Mobile Platforms

Recently, I launched my new website and encountered a peculiar issue. Upon clicking on Pickup Date & Time, a bootstrap datepicker pops up like it should. However, the problem arises when viewing the website on mobile devices - the datepicker appears offsc ...

Customized link routing / Deep linking

I need some help. I am managing a standard website and I want to redirect custom URLs to specific pages when visitors access the site. For instance: - index.html should point to custom_index.cfm?custom_id=1&page_id=1&inc=index - about.html shou ...

Is there a way to customize my visual studio code to automatically insert an indented space between curly brackets in CSS when I press enter?

Whenever I try to open curly brackets in CSS and press enter, it simply moves to the next line without adding an indentation as shown below: body { } Despite going through the settings and experimenting with different options, I haven't been able to ...

Excessive content and the upper limit of height

I'm in the process of creating a scrolling table with a maximum height, and here's what I've done so far: <table> <tbody style="height: 300px; overflow:auto;"> //php for loop to populate table with <tr>s/<td>s </t ...

Is it possible to adjust the ul width to match its parent's width using CSS?

Whenever I type in a search, a list is displayed. The issue arises on small devices where the width of the list exceeds that of the search input or its parent container, which should not happen. On small devices, it should always look like this: Example L ...

Different ways to modify the color and thickness of a variable in HTML5 with either JavaScript or CSS

I am currently working with a JavaScript file where I have a variable defined as follows: var nombre = document.getElementById('nombre').value; The 'nombre' variable corresponds to an element in an HTML file: Nombre: <input type=" ...

Header with a stable background image that adjusts responsively

While attempting to convert a PSD to HTML, I encountered a small issue. Please refer to the image below: https://i.sstatic.net/5KoIV.jpg As indicated by the red arrow, there is a blue background image in the header of the template! How can I add this bac ...

Active Tab Indicator - Make Your Current Tab Stand Out

I currently have a set of 3 tabs, with the first tab initially highlighted. I attempted to use some JQuery code in order to highlight a selected or active tab, but for some reason it is not working as expected. Any assistance would be greatly appreciated. ...

What is the most effective way to utilize bootstrap classes and their associated functions exclusively for mobile devices by using media queries?

I am encountering an issue with a table in my application that causes the UI to break when the screen width is reduced to less than 600px. To address this, I would like to implement the following bootstrap classes to add a scroll to the application: .tabl ...

Calculate the number of rows in a table that contain identical values

I have a puzzling issue that has been on my mind. I currently have an SQL statement that selects specific rows from my database and displays them in an HTML table, which is functioning properly. However, I now need to determine how many rows have the same ...

What is the best way to align text in the vertical center?

Trying to design a promotion layout with an image on the left and text on the right. How can I center the text vertically to appear in the middle of the picture? Attempts using margin and vertical-align have not been successful. Also, why does the text di ...

Utilizing personalized CSS for specific ioslides

If I decide to stick with the default data and presentation of a new ioslides, changing only the second slide (## R Markdown) without affecting the entire item, how can I do this by setting up the css document accordingly? My goal is to simply adjust the f ...