主頁 > 資料庫 > 更改后不執行HTML/CSS中的影片

更改后不執行HTML/CSS中的影片

2022-01-05 12:38:26 資料庫

我基本上想將 JPEG 簽名轉換為 SVG。我只想使用以下代碼并將其更改為輸出 JPEG 中顯示的簽名。

為此,我使用了在線簽名板,將其匯出到 svg,然后從記事本中提取資料。但是,我面臨一些問題。請參閱下文。

這是代碼:

// Select all <path> elements.
const paths = document.querySelectorAll('path');

/**
 * Loop over each path,
 * calculate the length of a path,
 * set a CSS variable with the length so CSS can read the length.
 */
for (const path of paths) {
  const length = path.getTotalLength();
  path.style.setProperty('--path-stroke-length', length);
}
.container {
  max-width: 400px;
  margin: 0 auto;
}

.signature {
  position: relative;
  overflow: auto;
  width: 100%;
  height: 0;
  padding-bottom: 55.30973%;
}

.signature svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.signature svg path {
  stroke-dasharray: var(--path-stroke-length);
  animation: draw 1.5s 1.5s ease-in-out both;
}

@keyframes draw {
  from {
    stroke-dashoffset: var(--path-stroke-length);
  }
  to {
    stroke-dashoffset: 0;
  }
}
<div class="container">
  <div class="signature">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="34.924 351.353 548.489 159.86">
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M51.494,355.859c-0.361,6.059-0.928,154.471,0.112,139.244"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M78.591,407.725c1.312,22.307-22.823,30.685-40.917,38.995v0.438c28.433,6.559,63.44,14.872,83.997,37.178"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M107.581,428.161c-10.663-3.553-25.783,30.933-12.163,31.759c9.906,0.412,10.873-18.834,13.134-26.911 c-5.65,11.058,3.828,48.292,20.075,6.995c-11.509,10.832,17.602,55.514,27.12-39.959c-2.612,27.794-5.091,45.328,6.053,56.885 c9.493,9.906,24.097,5.309,26.899-6.503c9.349-39.39,2.886-89.151-4.863-88.502c-7.76,0.648-12.929,44.588-4.217,79.835 c2.759,11.161,9.906,22.289,23.114,24.354c14.859,2.475,13.208-12.385,17.335-21.466c1.238,5.367,1.238,11.971,7.842,12.795 c7.429,1.238,9.492-9.906,14.446-9.906c2.063,0,4.127,4.129,6.192,4.541c3.302,1.238,3.715-0.412,7.017-1.651 c19.812-6.19,17.879-0.059,38.517-0.059"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M137.931,434.742c14.447-2.475,28.894-3.714,43.753-4.128"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M323.739,390.271c7.861-15.198-23.06-13.102-28.826-1.571c-13.101,26.204,37.734,46.643,44.023,68.653 c9.435,33.017-49.264,34.063-67.605,21.487c-11.53-8.386-2.096-13.626,8.385-16.771"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M355.25,448.722c-5.261,16.234,3.377,51.195,12.721,59.741c0,0,0.649-26.498-10.497-40.877"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M366.466,462.687c6.728,0.814,33.816,1.509,39.618-16.217c5.733-17.524-34.122-12.104-46.724-6.919 c-4.088,1.683-12.966,5.606-12.708,12.208c0.535,13.62,37.153,12.974,56.324,8.02s23.665-9.646,25.908-14.53 c-4.859,0.813-5.232,10.987-1.495,14.243c4.86,4.069,6.729-2.442,9.718-6.104c0.747,3.256,1.494,6.104,2.989,8.952 c3.738-2.848,5.608-10.173,10.841-9.766c4.485,0,3.991,5.186,8.477,5.594c4.111,0.408,8.078-11.094,22.939-10.447 c-8.399-1.615-24.232,8.725-13.569,12.278c11.309,2.907,13.178-9.46,14.674-14.343c1.494-5.29,6.729-39.826,0.748-43.896 c-4.485-2.849-5.232,5.696-5.607,9.359c-1.12,11.395,2.617,32.093,10.093,40.64c7.476,8.952,26.537,12.207,32.892-1.628 c4.861-10.986-8.597-17.498-10.091-5.289c-2.99,23.195,22.56,15.073,30.566,7.922c13.571-12.116,11.147-86.235,2.259-86.761 c-8.071-0.478-24.718,94.514,36.346,102.269"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M432.622,431.008c0.373-0.407,0.373-1.222,0.373-2.035"/>
      <path fill="none" stroke="#020202" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" d="M130.66,421.731c0.373-0.407,0.373-1.221,0.373-2.035"/>
    </svg>
  </div>
</div>

我想要相同的影片,但有這個簽名:

更改后不執行 HTML/CSS 中的影片

這是svg我使用在線記事本繪制簽名,匯出到svg,并使用記事本提取svg元素后得到的。換句話說,這是svg上述簽名的:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 664 373" width="664" height="373"><path d="M 126.000,276.500 C 122.687,278.906 123.500,277.000 121.000,277.500" stroke-width="5.348" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 121.000,277.500 C 117.679,271.876 116.687,273.906 114.000,266.500" stroke-width="4.324" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 114.000,266.500 C 110.467,262.818 111.179,262.376 108.000,258.500" stroke-width="3.745" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 108.000,258.500 C 105.098,251.953 104.467,252.318 102.000,245.500" stroke-width="3.232" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 102.000,245.500 C 98.793,239.595 99.098,239.453 96.000,233.500" stroke-width="3.109" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 96.000,233.500 C 93.050,227.649 93.293,227.595 91.000,221.500" stroke-width="3.164" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 91.000,221.500 C 89.500,215.500 89.050,215.649 88.000,209.500" stroke-width="3.228" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 88.000,209.500 C 85.829,203.583 86.500,203.500 85.000,197.500" stroke-width="3.189" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 85.000,197.500 C 85.000,192.500 84.329,192.583 85.000,187.500" stroke-width="3.428" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 85.000,187.500 C 85.000,183.500 85.000,183.500 85.000,179.500" stroke-width="3.697" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 85.000,179.500 C 84.402,175.385 85.000,175.500 85.000,171.500" stroke-width="3.786" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 85.000,171.500 C 85.600,168.775 85.402,168.885 87.000,166.500" stroke-width="4.072" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 87.000,166.500 C 89.824,162.356 89.600,162.275 93.000,158.500" stroke-width="3.686" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 93.000,158.500 C 96.751,153.749 96.824,153.856 101.000,149.500" stroke-width="3.339" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 101.000,149.500 C 104.855,145.816 104.751,145.749 109.000,142.500" stroke-width="3.423" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 109.000,142.500 C 112.621,140.155 112.355,139.816 116.000,137.500" stroke-width="3.584" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 116.000,137.500 C 119.084,133.609 119.621,134.655 123.000,131.500" stroke-width="3.628" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 123.000,131.500 C 125.979,130.752 125.584,130.109 129.000,130.500" stroke-width="4.359" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 129.000,130.500 C 132.094,129.919 131.979,130.252 135.000,130.500" stroke-width="4.168" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 135.000,130.500 C 139.651,131.636 139.594,131.419 144.000,133.500" stroke-width="3.761" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 144.000,133.500 C 150.545,135.705 150.151,136.136 156.000,139.500" stroke-width="3.307" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 156.000,139.500 C 162.237,143.896 162.045,143.705 167.000,149.500" stroke-width="3.023" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 167.000,149.500 C 170.399,154.298 170.737,153.896 173.000,159.500" stroke-width="3.236" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 173.000,159.500 C 177.104,165.231 175.899,165.298 178.000,171.500" stroke-width="3.142" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 178.000,171.500 C 179.271,180.120 179.104,179.231 177.000,187.500" stroke-width="2.965" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 177.000,187.500 C 173.865,192.806 175.271,193.120 170.000,197.500" stroke-width="3.175" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 170.000,197.500 C 166.500,201.000 166.865,201.306 163.000,204.500" stroke-width="3.432" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 163.000,204.500 C 159.823,208.394 159.500,208.000 156.000,211.500" stroke-width="3.462" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 156.000,211.500 C 151.838,215.384 151.823,214.894 147.000,217.500" stroke-width="3.445" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 147.000,217.500 C 143.406,217.648 143.838,218.884 140.000,218.500" stroke-width="3.798" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 140.000,218.500 C 137.594,220.284 137.406,219.148 135.000,220.500" stroke-width="4.076" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 135.000,220.500 C 130.443,221.536 131.594,220.784 128.000,219.500" stroke-width="4.637" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 128.000,219.500 C 123.244,215.143 124.443,216.536 123.000,210.500" stroke-width="4.387" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 123.000,210.500 C 124.081,204.717 122.744,205.643 127.000,200.500" stroke-width="4.306" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 127.000,200.500 C 129.258,198.283 128.581,198.217 132.000,197.500" stroke-width="4.223" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 132.000,197.500 C 136.487,196.765 136.258,196.283 141.000,196.500" stroke-width="3.761" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 141.000,196.500 C 145.000,196.500 144.987,196.265 149.000,196.500" stroke-width="3.805" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 149.000,196.500 C 152.000,196.500 152.000,196.500 155.000,196.500" stroke-width="4.001" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 155.000,196.500 C 158.866,195.455 158.500,196.500 162.000,196.500" stroke-width="3.989" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 162.000,196.500 C 164.750,198.250 164.866,197.455 167.000,200.500" stroke-width="4.100" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 167.000,200.500 C 169.590,202.679 169.250,202.750 171.000,205.500" stroke-width="4.042" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 171.000,205.500 C 173.781,209.899 173.090,209.679 174.000,214.500" stroke-width="3.730" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 174.000,214.500 C 173.386,220.608 174.281,220.399 172.000,226.500" stroke-width="3.988" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 172.000,226.500 C 171.463,229.305 171.386,229.108 170.000,231.500" stroke-width="4.140" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 170.000,231.500 C 166.679,236.689 168.463,233.805 166.000,235.500" stroke-width="4.582" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 166.000,235.500 C 164.945,229.776 164.679,233.189 166.000,224.500" stroke-width="4.849" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 166.000,224.500 C 167.519,219.718 166.945,219.776 170.000,215.500" stroke-width="3.870" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 170.000,215.500 C 173.232,211.652 172.519,211.218 176.000,207.500" stroke-width="3.575" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 176.000,207.500 C 177.302,203.198 178.232,204.152 180.000,200.500" stroke-width="3.740" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 180.000,200.500 C 183.075,197.538 181.802,198.698 185.000,198.500" stroke-width="4.586" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 185.000,198.500 C 188.098,201.696 188.075,200.038 190.000,205.500" stroke-width="4.498" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 190.000,205.500 C 191.919,209.905 192.098,209.696 193.000,214.500" stroke-width="3.838" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 193.000,214.500 C 193.749,218.484 193.919,218.405 194.000,222.500" stroke-width="3.822" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 194.000,222.500 C 194.000,226.500 194.249,226.484 194.000,230.500" stroke-width="3.771" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 194.000,230.500 C 195.606,234.493 194.000,233.500 194.000,236.500" stroke-width="4.034" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 194.000,236.500 C 189.847,240.953 191.606,239.493 186.000,240.500" stroke-width="4.642" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 186.000,240.500 C 181.135,237.946 181.347,239.953 177.000,234.500" stroke-width="3.728" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 177.000,234.500 C 172.774,229.677 172.135,230.446 168.000,225.500" stroke-width="3.290" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 168.000,225.500 C 161.272,222.948 164.774,222.677 161.000,220.500" stroke-width="3.589" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 161.000,220.500 C 163.651,216.872 160.772,218.448 167.000,216.500" stroke-width="4.667" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 167.000,216.500 C 173.010,217.443 172.651,215.872 179.000,218.500" stroke-width="3.600" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 179.000,218.500 C 181.492,219.044 181.510,218.943 184.000,219.500" stroke-width="4.080" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 184.000,219.500 C 187.712,218.899 186.992,220.044 190.000,220.500" stroke-width="4.924" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 190.000,220.500 C 191.403,224.139 192.712,222.399 194.000,226.500" stroke-width="4.918" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 194.000,226.500 C 197.322,228.924 196.903,229.139 201.000,230.500" stroke-width="4.652" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 201.000,230.500 C 204.431,231.990 204.322,231.924 208.000,232.500" stroke-width="4.639" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 208.000,232.500 C 212.934,234.337 211.431,232.990 215.000,232.500" stroke-width="4.842" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 215.000,232.500 C 217.593,228.059 217.434,230.337 217.000,224.500" stroke-width="4.957" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 217.000,224.500 C 214.315,222.867 216.593,222.059 213.000,220.500" stroke-width="4.862" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 213.000,220.500 C 210.553,216.404 211.815,218.367 212.000,215.500" stroke-width="5.126" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 212.000,215.500 C 216.500,215.500 214.553,213.904 221.000,215.500" stroke-width="4.610" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 221.000,215.500 C 226.672,213.877 226.000,215.500 231.000,215.500" stroke-width="4.422" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 231.000,215.500 C 235.438,221.188 234.672,216.877 237.000,221.500" stroke-width="4.459" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 237.000,221.500 C 236.933,218.833 237.938,221.688 236.000,216.500" stroke-width="5.093" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 236.000,216.500 C 234.777,213.784 234.933,213.833 233.000,211.500" stroke-width="4.424" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 233.000,211.500 C 231.367,208.815 231.277,209.284 229.000,207.500" stroke-width="4.280" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 229.000,207.500 C 225.368,205.360 226.867,206.315 224.000,206.500" stroke-width="4.837" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 224.000,206.500 C 223.232,209.478 222.368,207.860 223.000,212.500" stroke-width="4.953" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 223.000,212.500 C 221.489,216.695 222.732,215.978 223.000,219.500" stroke-width="4.747" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 223.000,219.500 C 226.107,223.164 224.989,223.195 230.000,225.500" stroke-width="4.738" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 230.000,225.500 C 233.929,227.247 233.607,227.664 238.000,228.500" stroke-width="4.525" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 238.000,228.500 C 243.000,228.770 240.429,229.247 243.000,229.500" stroke-width="4.927" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 243.000,229.500 C 240.601,231.027 243.000,230.270 238.000,231.500" stroke-width="5.190" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 238.000,231.500 C 235.000,231.500 235.101,232.027 232.000,231.500" stroke-width="4.421" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 232.000,231.500 C 227.500,231.500 227.500,231.500 223.000,231.500" stroke-width="3.812" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 223.000,231.500 C 216.774,231.952 220.000,231.500 217.000,231.500" stroke-width="4.003" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 217.000,231.500 C 220.427,229.976 217.274,230.952 224.000,229.500" stroke-width="4.805" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 224.000,229.500 C 228.000,229.500 227.927,228.976 232.000,229.500" stroke-width="4.074" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 232.000,229.500 C 235.000,229.500 235.000,229.500 238.000,229.500" stroke-width="4.086" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 238.000,229.500 C 243.359,231.017 242.500,229.500 247.000,229.500" stroke-width="4.333" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 247.000,229.500 C 249.368,227.240 249.359,228.517 250.000,224.500" stroke-width="5.007" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 250.000,224.500 C 248.611,219.833 250.868,220.740 250.000,216.500" stroke-width="4.661" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 250.000,216.500 C 252.149,212.690 251.111,213.833 255.000,212.500" stroke-width="4.978" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 255.000,212.500 C 260.340,213.307 259.649,212.190 265.000,215.500" stroke-width="4.463" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 265.000,215.500 C 271.372,219.244 268.840,217.307 272.000,220.500" stroke-width="4.693" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 272.000,220.500 C 269.172,220.685 272.372,221.244 267.000,219.500" stroke-width="5.161" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 267.000,219.500 C 264.022,216.973 263.672,217.685 261.000,214.500" stroke-width="4.171" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 261.000,214.500 C 258.094,210.238 258.522,212.473 256.000,210.500" stroke-width="4.535" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 256.000,210.500 C 252.746,213.216 254.094,210.738 253.000,215.500" stroke-width="5.022" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 253.000,215.500 C 254.610,218.106 253.246,217.716 257.000,219.500" stroke-width="4.866" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 257.000,219.500 C 260.950,221.150 260.610,221.606 265.000,222.500" stroke-width="4.822" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 265.000,222.500 C 268.500,223.500 268.450,223.650 272.000,224.500" stroke-width="4.883" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 272.000,224.500 C 279.234,225.562 275.500,225.500 279.000,226.500" stroke-width="4.669" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 279.000,226.500 C 275.064,228.022 278.734,227.562 271.000,228.500" stroke-width="5.018" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 271.000,228.500 C 262.900,228.500 266.564,229.022 262.000,228.500" stroke-width="3.933" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 262.000,228.500 C 265.000,228.500 261.400,228.500 268.000,228.500" stroke-width="4.865" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 268.000,228.500 C 271.727,229.318 271.500,228.500 275.000,228.500" stroke-width="4.739" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 275.000,228.500 C 277.332,226.612 277.727,227.818 280.000,225.500" stroke-width="5.175" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 280.000,225.500 C 283.471,224.382 283.332,224.112 287.000,223.500" stroke-width="4.977" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 287.000,223.500 C 289.473,222.730 289.471,222.882 292.000,222.500" stroke-width="4.917" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 292.000,222.500 C 295.021,222.252 294.973,222.230 298.000,222.500" stroke-width="4.308" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 298.000,222.500 C 301.702,221.968 301.021,222.752 304.000,223.500" stroke-width="4.636" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 304.000,223.500 C 307.734,227.032 306.202,224.968 307.000,228.500" stroke-width="5.000" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 307.000,228.500 C 304.024,229.284 306.234,230.032 301.000,229.500" stroke-width="5.011" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 301.000,229.500 C 296.984,229.749 297.024,229.784 293.000,229.500" stroke-width="4.682" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 293.000,229.500 C 287.802,230.461 288.984,229.249 285.000,228.500" stroke-width="4.568" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 285.000,228.500 C 282.029,224.684 282.802,226.961 283.000,222.500" stroke-width="4.673" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 283.000,222.500 C 285.791,219.669 284.029,220.184 289.000,219.500" stroke-width="4.982" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 289.000,219.500 C 295.764,219.768 295.291,219.169 302.000,221.500" stroke-width="4.269" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 302.000,221.500 C 304.397,223.198 304.764,222.268 307.000,224.500" stroke-width="4.165" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 307.000,224.500 C 311.670,226.191 311.397,226.698 316.000,228.500" stroke-width="3.724" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 316.000,228.500 C 319.198,230.258 319.170,230.191 322.000,232.500" stroke-width="4.336" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 322.000,232.500 C 324.277,236.746 324.198,234.258 326.000,236.500" stroke-width="4.652" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 326.000,236.500 C 328.261,234.211 327.777,236.246 329.000,231.500" stroke-width="5.154" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 329.000,231.500 C 327.791,225.984 329.761,228.711 329.000,225.500" stroke-width="5.304" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 329.000,225.500 C 331.611,227.376 330.291,224.984 334.000,229.500" stroke-width="5.179" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 334.000,229.500 C 336.399,233.957 336.111,231.376 338.000,233.500" stroke-width="5.283" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 338.000,233.500 C 338.658,228.202 339.899,232.957 341.000,227.500" stroke-width="5.316" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 341.000,227.500 C 344.844,228.492 343.658,226.702 348.000,230.500" stroke-width="4.994" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 348.000,230.500 C 349.784,234.254 350.344,231.992 352.000,234.500" stroke-width="4.426" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 352.000,234.500 C 354.541,231.276 354.284,234.754 357.000,231.500" stroke-width="5.112" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 357.000,231.500 C 360.198,233.258 360.041,231.776 363.000,235.500" stroke-width="4.773" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 363.000,235.500 C 368.353,238.598 365.198,237.258 367.000,239.500" stroke-width="5.214" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 367.000,239.500 C 360.536,240.977 363.853,241.598 354.000,241.500" stroke-width="4.643" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 354.000,241.500 C 347.941,240.863 348.036,241.977 342.000,241.500" stroke-width="3.611" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 342.000,241.500 C 334.067,243.551 333.941,242.363 326.000,244.500" stroke-width="3.061" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 218.000,263.500 C 223.981,260.952 224.000,261.000 230.000,258.500" stroke-width="4.994" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 230.000,258.500 C 237.328,254.988 237.481,255.452 245.000,252.500" stroke-width="3.303" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 245.000,252.500 C 256.172,250.031 255.828,248.988 267.000,246.500" stroke-width="2.616" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 267.000,246.500 C 278.940,241.829 279.172,242.531 291.000,237.500" stroke-width="2.281" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 291.000,237.500 C 298.591,235.244 298.440,234.829 306.000,232.500" stroke-width="2.690" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 306.000,232.500 C 311.895,229.655 312.091,230.244 318.000,227.500" stroke-width="3.020" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 241.000,266.500 C 244.728,267.641 244.500,266.500 248.000,266.500" stroke-width="5.157" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 248.000,266.500 C 265.982,258.956 266.228,260.141 284.000,251.500" stroke-width="2.058" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 284.000,251.500 C 295.229,247.491 294.982,246.956 306.000,242.500" stroke-width="2.197" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 306.000,242.500 C 315.401,237.299 315.729,237.991 325.000,232.500" stroke-width="2.391" stroke="black" fill="none" stroke-linecap="round"></path><path d="M 325.000,232.500 C 331.460,229.407 331.401,229.299 338.000,226.500" stroke-width="2.819" stroke="black" fill="none" stroke-linecap="round"></path></svg>

問題是,如果我只將 粘貼<path>到上面的代碼中,代碼就不會執行。我該如何解決?

uj5u.com熱心網友回復:

如果將 粘貼到SVGdiv 中,影片將起作用。它看起來與其他影片不同的原因是您的簽名被分解成很多小路徑。

我建議您使用Figma使用鋼筆工具創建您的簽名。您將能夠創建您實際想要設定影片的路徑,并將匯出一個小得多的svg.


更新

您應該能夠使用此 SVG 并對其進行一些修改,但這是基本思想。

// Select all <path> elements.
const paths = document.querySelectorAll('path');

/**
 * Loop over each path,
 * calculate the length of a path,
 * set a CSS variable with the length so CSS can read the length.
 */
for (const path of paths) {
  const length = path.getTotalLength();
  path.style.setProperty('--path-stroke-length', length);
}
.container {
  max-width: 400px;
  margin: 0 auto;
}

.signature {
  position: relative;
  overflow: auto;
  width: 100%;
  height: 0;
  padding-bottom: 55.30973%;
}

.signature svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.signature svg path {
  stroke-dasharray: var(--path-stroke-length);
  animation: draw 1.5s 1.5s ease-in-out both;
}

@keyframes draw {
  from {
    stroke-dashoffset: var(--path-stroke-length);
  }
  to {
    stroke-dashoffset: 0;
  }
}
<div class="container">
  <div class="signature">
    <svg xmlns="http://www.w3.org/2000/svg" width="999" height="622" viewBox="0 0 999 622" fill="none">
<path d="M9 300.5C53.9664 263.275 78.4994 241.966 120 202.5C166.845 161.224 190.864 137.434 228.5 93.4999C268.281 48.0683 299.802 25.4041 331 12C362.198 -1.40413 392.082 42.7628 401 76.9999C409.918 111.237 384.678 178.5 370 211C355.322 243.5 339.5 255.5 258 325C176.5 394.5 157 384 157 384C157.169 361.808 164.353 349.685 198 329C264.54 282.892 278.027 278.548 293 279C323.052 280.376 328.446 282.758 331 288C346.097 303 333.715 325.644 319 361C304.009 391.294 291.48 402.027 271 424" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M370 328.5C370 367.5 342.392 399.14 336.5 441.5M386.5 394.5C374.332 420.851 374.523 433.154 395 448C410.813 459.688 438.817 434.738 488 391.5C467.953 399.833 455.382 401.84 427.5 394.5C450.782 412.123 491.076 425.723 500.5 441.5C509.924 457.277 441.308 454.23 444.5 455.5" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M301.5 369C305.026 379.077 312.566 385.384 363 401" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M560.5 412.5C543.503 405.865 534.124 402.484 526 416C528.367 425.276 525.471 429.235 572 451.5C576.265 461.546 566.717 463.259 533.5 461" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M665.5 425C653.546 446.2 645.147 455.813 620.5 460C603.392 456.418 600.659 454.042 601.5 449.5C605.587 419.784 611.129 420.488 620.5 419C645.804 416.165 650.461 418.964 656.5 425C655.121 437.207 655.982 443.17 665.5 449.5C670.836 455.749 674.741 457.481 682 460" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M714.5 382C736.684 377.781 749.833 375.834 807.5 392.5C815.173 403.089 802.279 414.61 769 438.5C769.523 451.598 784.552 455.127 840 454C840.888 464.136 830.5 471.5 807.5 463" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M720 453.5C713.174 438.927 712.517 429 720 406.5" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M755.5 291.5C756.179 291.065 759.099 289.934 765.5 287.5C765.5 287.5 772 287.5 765.5 298C759 308.5 761.562 304.559 755.5 302C752.193 298.729 752.486 296.357 755.5 291.5Z" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M551.5 253C557.85 236.659 553 239.325 576.5 224.5C600 209.675 619.5 220.187 627.5 224.5C635.5 228.813 659.036 279.692 668.5 296.5C677.964 313.307 689 318 689 318C702.917 321.702 706.005 317.282 710.5 308" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M989.5 508.5C746.513 510.932 625.213 498.488 314 564" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M471.5 612.5C642.412 577.017 741.308 566.1 924.5 566.5" stroke="#0563BB" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
  </div>
</div>

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/403794.html

標籤:

上一篇:我需要pygame視窗的中心x和y位置

下一篇:如何在jQuery中恢復css屬性

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more