<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          OlaJavaScript 實(shí)時(shí)數(shù)據(jù)插入平滑動(dòng)畫(huà)庫(kù)

          聯(lián)合創(chuàng)作 · 2023-09-22 02:25

          Ola 是一個(gè)簡(jiǎn)單的 JavaScript 庫(kù),實(shí)時(shí)插入/插入(inbetweening / interpolating )數(shù)字的平滑動(dòng)畫(huà)庫(kù)。

          // Start tracking the value
          const pos = Ola({ y: 0 });
          // Set the value to update async
          pos.set({ y: 100 });
          // Read the evolution over time
          setInterval(() => graph(pos.y), 5);
          

          支持多值和多維度

          const pos = Ola({ x: 0, y: 0 });
          window.addEventListener('click', e => {
          pos.set({ x: e.pageX, y: e.pageY });
          });
          setInterval(() => {
          ball.style.left = `${pos.x}px`;
          ball.style.top = `${pos.y}px`;
          }, 10);
          

          支持很多獨(dú)立的實(shí)例

          // Generates 1000 instances seamlessly
          const dots = Ola(Array(1000).fill(0));
          // Everything updates every 600ms
          setInterval(() => dots.forEach((dot, i) => {
          dots[i] = Math.random();
          }), 600);
          // ... read + paint screen here
          

          快速開(kāi)始

          使用 npm 安裝

          npm install ola
          

          導(dǎo)入并使用

          import Ola from "ola";
          const pos = Ola({ x: 0 });
          console.log(pos.x); // 0

          可通過(guò) CDN 方式使用

          <script src="https://cdn.jsdelivr.net/npm/ola"></script>
          <script type="text/javascript">
            const pos = Ola({ x: 0 });
            console.log(pos.x); // 0
          </script>
          瀏覽 14
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  小电影在线观看黄.999 | 4438全国最大无码视频 | 国产精品操逼视频 | 99热在线观看精品免费 | 国产大奶一区二区 |