gpt4 book ai didi

html - 为什么微调器奇怪地移动?

转载 作者:太空宇宙 更新时间:2023-11-04 01:09:46 26 4
gpt4 key购买 nike

我有一个围绕圆圈的微调器,它在闭合的圆圈路径中移动,当悬停在圆圈上时,微调器被触发,它移动不流畅,但它似乎从特定部分左右移动,就像它变宽了来自零件和更小的零件。

.item-circled {
position: relative;
width: 157.5px;
margin: 5% 40px;
display: inline-block;
}

.item-circled .face-container {
position: relative;
width: 157.5px;
height: 157.5px;
z-index: 1;
perspective: 1000px;
}

.item-circled .face-card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
border-radius: 50%;
transition: all .5s linear;
}

.item-circled .face-container:hover .face-card {
transform: rotateY(180deg);
border-radius: 50%;
}

.item-circled .face-1 {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
overflow: hidden;
border-radius: 50%;
}

.item-circled .face-1.front{
background-color: #f7eebe;
width: 100%;
height: 100%
}

.item-circled .face-1.back {
display: block;
box-sizing: border-box;
padding: 35px 13px;
text-align: center;
background-color: #1f4e79;
transform: rotateY(180deg);
border-radius: 50%;
}

.item-circled .dashed-border {
position: absolute;
border-radius: 50%;
border: 2px dashed #18d9ec;
height: 187.5px;
width: 187.5px;
top: -15px;
left: -15px;
}

.item-circled:hover .dashed-border {
animation-duration: 0.5s;
animation-timing-function: linear;
animation-name: spiner;
animation-iteration-count: infinite;
}

@keyframes spiner {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">

<div class="item-circled">
<div class="face-container center-block text-center">
<div class="face-card">
<!-- Front side -->
<div class="face-1 front">
<p>front</p>
</div>
<!-- Back side -->
<div class="face-1 back">
<p>back</p>
</div>
</div>
<!-- Spinner element -->
<div class="dashed-border"></div>
</div> <!-- face-conteiner -->
</div> <!-- item-circled -->

这是一个 fiddle 来查看结果: http://jsfiddle.net/os7bL0pr/12

最佳答案

您所看到的摆动是因为 360 度圆没有 0 度,所以您试图告诉动画返回非点 0 度,然后像往常一样从 1 度开始。将度数从 0 更改为 1

.item-circled {
position: relative;
width: 157.5px;
margin: 5% 40px;
display: inline-block;
}

.item-circled .face-container {
position: relative;
width: 157.5px;
height: 157.5px;
z-index: 1;
perspective: 1000px;
}

.item-circled .face-card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
border-radius: 50%;
transition: all .5s linear;
}

.item-circled .face-container:hover .face-card {
transform: rotateY(180deg);
border-radius: 50%;
}

.item-circled .face-1 {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
overflow: hidden;
border-radius: 50%;
}

.item-circled .face-1.front{
background-color: #f7eebe;
width: 100%;
height: 100%
}

.item-circled .face-1.back {
display: block;
box-sizing: border-box;
padding: 35px 13px;
text-align: center;
background-color: #1f4e79;
transform: rotateY(180deg);
border-radius: 50%;
}

.item-circled .dashed-border {
position: absolute;
border-radius: 50%;
border: 2px dashed #18d9ec;
height: 187.5px;
width: 187.5px;
top: -15px;
left: -15px;
}

.item-circled:hover .dashed-border {
animation-duration: 0.5s;
animation-timing-function: linear;
animation-name: spiner;
animation-iteration-count: infinite;
}

@keyframes spiner {
from {
transform: rotate(1deg);
}
to {
transform: rotate(360deg);
}
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">

<div class="item-circled">
<div class="face-container center-block text-center">
<div class="face-card">
<!-- Front side -->
<div class="face-1 front">
<p>front</p>
</div>
<!-- Back side -->
<div class="face-1 back">
<p>back</p>
</div>
</div>
<!-- Spinner element -->
<div class="dashed-border"></div>
</div> <!-- face-conteiner -->
</div> <!-- item-circled -->

关于html - 为什么微调器奇怪地移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51427485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com