मेरे पास यह pen है जो किसी चीज़ के चारों ओर घूमने वाली ऑब्जेक्ट को अनुकरण करने का प्रयास करता है। यह काम करता है, लेकिन यह चिकनी नहीं है। घूमते समय यह बाएं और दाएं किनारों के आसपास रुक जाता है।CSS3 एनीमेशन समारोह?
मैंने सोचा कि यह animation-timing-function
के साथ कुछ था, लेकिन ease-in-out
या linear
या एक कस्टम cubic-bezier
समारोह की तरह में निर्मित कार्यों से किसी के साथ वांछित परिणाम नहीं मिल सकता है।
मैं एनीमेशन को चिकनी महसूस कैसे कर सकता हूं? यदि बेहतर तरीके हैं तो ऐसा कुछ किया जा सकता है, मुझे बताने में संकोच न करें।
.overlay {
background-image: -webkit-repeating-linear-gradient(0deg, transparent, transparent 1%, rgb(255, 255, 255) 2%, rgb(255, 255, 255) 2%);
background-image: repeating-linear-gradient(90deg, transparent, transparent 1%, rgb(255, 255, 255) 2%, rgb(255, 255, 255) 2%);
height: 200px;
position: relative;
width: 40%;
margin: auto;
}
.circle {
width: 100px;
height: 100px;
border-radius: 50%;
background: #888;
position: absolute;
z-index: -1;
left: 0;
display: inline-block;
}
.move {
-webkit-animation: moveAndGlow 2s infinite ease-in-out;
animation: moveAndGlow 2s infinite ease-in-out;
}
@-webkit-keyframes moveAndGlow {
25% {
background: #ccc;
-webkit-transform: scale(.5);
transform: scale(.5);
margin-top: 25px;
}
50% {
left: 100%;
margin-left: -100px;
background: #888;
-webkit-transform: scale(1);
transform: scale(1);
margin-top: 0;
}
75% {
background: #000;
-webkit-transform: scale(1.5);
transform: scale(1.5);
margin-top: 25px;
}
}
@keyframes moveAndGlow {
25% {
background: #ccc;
-webkit-transform: scale(.5);
transform: scale(.5);
margin-top: 25px;
}
50% {
left: 100%;
margin-left: -100px;
background: #888;
-webkit-transform: scale(1);
transform: scale(1);
margin-top: 0;
}
75% {
background: #000;
-webkit-transform: scale(1.5);
transform: scale(1.5);
margin-top: 25px;
}
}
<div class="overlay">
<span class="circle move"></span>
</div>
में अंतरिक्ष में 4 अलग-अलग बिंदुओं पर जा रहा है, परिप्रेक्ष्य के बारे में पढ़ा जाना चाहिए। कुछ छोटे बदलाव और यह सही है। :) –
@TheWarlock खुश आपको यह पसंद है। यह भी देखें [ब्राउज़र समर्थन] (http://caniuse.com/#feat=transforms3d) और उचित विक्रेता उपसर्ग जोड़ें। –