Transform causes border-radius,overflow:hidden to fail?

the html code is as follows:

<div class="circle2">
                       
    <span class="wave"></span>
 
</div>

the css code is as follows:

.circle2 {
    width: 162px;
    height: 162px;
    border-radius: 50%;
    position: relative;
    top: 18px;
    left: 50%;
    overflow: hidden;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0px 2px 5px 2px -sharp269e89 inset;
    z-index: 1;
}

.wave {
    width: 262px;
    height: 262px;
    position: absolute;
    background: linear-gradient(-sharp2aa192, -sharp2ea790);
    background: -webkit-linear-gradient(-sharp2aa192, -sharp2ea790);
    top: -140px;
    left: -100px;
    filter: opacity(0.5);
    border-radius: 43%;
    animation: drift linear infinite;
    transform-origin: 50% 48%;
    overflow: hidden;
}

  @keyframes drift {
            from {
                transform: rotate(360deg);
            }
        }

        @-webkit-keyframes drift {
            from {
                transform: rotate(360deg);
            }
        }

.wave:nth-of-type(1) {
    animation-duration: 10s;
    -webkit-animation-direction: alternate;
}

under normal circumstances, the figure is as follows:

clipboard.png

:

:

I found that this line of code animation: drift linear infinite; caused it to look normal as soon as it was deleted, and it couldn"t be cut into a circle.

several methods have been tried on the Internet, but to no avail. I would like to ask all kinds of gods for answers here

Jun.25,2021

there may be some compatibility problems with the border-radius,transform,transform-origin attribute, and the browser label must be added.
.circle2 {
  ...
 -ms-border-radius: 50%;
 -moz-border-radius: 50%;
 -webkit-border-radius: 50%;
 -o-border-radius: 50%;
 border-radius: 50%;
 
 -ms-transform: translateX(-50%);
 -moz-transform: translateX(-50%);
 -webkit-transform: translateX(-50%);
 -o-transform: translateX(-50%);
 transform: translateX(-50%);
   
}
I have also encountered the problem of

, which seems to be bug implemented by browsers.
add transform: rotate (0deg to the container of overflow: hidden). Of course, other properties that call GPU also seem to work: https://gist.github.com/ayamf.


I don't have a cell phone next to me to reproduce your bug, but I hope the following articles will be helpful to you

reference link: https://www.zhangxinxu.com/wo.
mentions: no matter it is an overflow container or a nested child element, as long as there is a transform attribute, hidden will overflow the absolute element.

there is no problem with border-radius. The overflow:hidden of the parent node is invalid. Consider removing the transform attribute of the parent node, or embedding another layer of nodes. (no mobile phone test, for reference only)


clip-path try it on the parent element

Menu