Computer >> कंप्यूटर >  >> प्रोग्रामिंग >> CSS

CSS के साथ बाउंस एनिमेशन प्रभाव


बाउंस एनिमेशन इफेक्ट का उपयोग तत्व को हिट करने के बाद सतह से जल्दी ऊपर, पीछे या दूर ले जाने के लिए किया जाता है।

उदाहरण

आप बाउंस एनिमेशन प्रभाव को लागू करने के लिए निम्न कोड को चलाने का प्रयास कर सकते हैं -

<html>
   <head>
      <style>

         .animated {
            background-image: url(/css/images/logo.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top:95px;
            margin-bottom:60px;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
         }

         @-webkit-keyframes bounce {
            0%, 20%, 50%, 80%, 100% {-webkit-transform: translateY(0);}
            40% {-webkit-transform: translateY(-30px);}
            60% {-webkit-transform: translateY(-15px);}
         }

         @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
            40% {transform: translateY(-30px);}
            60% {transform: translateY(-15px);}
         }

         .bounce {
            -webkit-animation-name: bounce;
            animation-name: bounce;
         }
      </style>

   </head>
   <body>

      <div id="animated-example" class="animated bounce"></div>
      <button onclick="myFunction()">Reload page</button>

      <script>
         function myFunction() {
            location.reload();
         }
      </script>
   </body>
</html>

  1. सीएसएस के साथ एनिमेशन प्रभाव को हिलाएं

    एक तत्व के लिए शेक एनीमेशन प्रभाव (एक वस्तु) ऊपर और नीचे या एक तरफ से दूसरी तरफ ले जाता है। उदाहरण <html>    <head>       <style>          .animated {             background-image: url(/css/images/logo

  1. सीएसएस के साथ वॉबल एनिमेशन प्रभाव

    CSS के साथ वॉबल एनिमेशन प्रभाव बनाने के लिए, आप निम्न कोड को चलाने का प्रयास कर सकते हैं - उदाहरण <html>    <head>       <style>          .animated {             background-image: url(/css/images/logo.p

  1. सीएसएस के साथ टाडा एनिमेशन प्रभाव

    सीएसएस के साथ टाडा एनीमेशन प्रभाव बनाने के लिए, आप निम्नलिखित कोड को चलाने का प्रयास कर सकते हैं: उदाहरण <html>    <head>       <style>          .animated {             background-image: url(/css/images