我有一個有兩個 SMIL 影片的 SVG。我想id="poi_front"通過使用按鈕暫停和運行它們來控制一個路徑(組)的影片,并讓另一個 SVG 路徑(id="poi_back")的影片連續運行。我設法在 svg 中暫停并運行所有四個影片(兩個用于“poi_front”,兩個用于“poi_back”) - 代碼如下所示:
我已經嘗試過document.getElementById("svg").getElementById("poi_front").unpauseAnimations();,但它不起作用。
我讀了這個w3cubDocs ,它談到SVGSVGElement.getElementById()了“SVG 檔案片段”,但我不確定這意味著什么,以及如何在我的腳本中使用它。
document.getElementById("svg").pauseAnimations();
document.getElementById("button").onclick = function() {start()};
function start(){
document.getElementById("svg").unpauseAnimations();
}
document.getElementById("button2").onclick = function() {stop()};
function stop(){
document.getElementById("svg").pauseAnimations();
}
html, body{
height: 100%;
margin: 0%;
padding: 0%;
overflow: hidden;
}
body{
height: 100vh;
display: flex;
background-color: #2a0000;
box-sizing: border-box;
flex-direction: column;
align-items: center;
}
#button{
width: 60px;
height: 30px;
background-color: orange;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
#button2{
width: 60px;
height: 30px;
background-color: yellow;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
<button id="button">START</button>
<button id="button2">STOP</button>
<svg
width="100%"
height="100%"
version="1.1"
viewBox="0 0 300 300"
xmlns="http://www.w3.org/2000/svg"
id="svg">
<!--Begin Bottle -->
<path
d="m166.76 57.45c-13.062-0.0623-26.955 0.73204-46.311 0.0859-2.7685-0.0924-5 2.23-5 5v10.709c-2e-5 2.77 2.23 5 5 5h4.7226v6.209a88.388 88.388 0 0 0 -67.176 85.715 88.388 88.388 0 0 0 88.389 88.389 88.388 88.388 0 0 0 88.389 -88.389 88.388 88.388 0 0 0 -67.176 -85.695v-6.2285h4.7227c2.77 0 5-2.23 5-5v-10.709c0-2.77-2.231-4.9242-5-5-1.8457-0.0506-3.6945-0.077-5.5606-0.0859z"
fill="#1b000c"/>
<path
d="m231.11 170.17c0 46.793-37.933 84.727-84.727 84.727-46.793 0-84.727-37.933-84.727-84.727-1e-6 -40.912 28.997-75.051 67.559-82.986 12.071 2.5421 23.795 1.9463 35.395 0.22531 38.033 8.3382 66.499 42.225 66.499 82.761z"
fill="#270600"/>
<path
d="m122.57 61.1c16.221 0.59986 32.004 0.30589 47.553 0 1.8278-0.036 3.3 1.4718 3.3 3.3v6.2541c0 1.8282-1.4718 3.3-3.3 3.3h-47.553c-1.8282 0-3.3-1.4718-3.3-3.3v-6.2541c0-1.8282 1.473-3.3676 3.3-3.3z"
fill="#270600"/>
<path
d="m129.08 77.57v6.0117c9.8102 2.4161 28.289 2.4275 35 0v-6.0117z"
fill="#270600"/>
<!--End Bottle -->
<!--Begin Poison Back-->
<path
fill="#9bc300"
id="poi_back">
<animate
id="poi_back_1"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z"
begin="0s;poi_back_2.end"
dur="1.5s"
/>
<animate
id="poi_back_2"
attributeName="d"
values="m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z;m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
begin="poi_back_1.end"
dur="1.5s"
/>
</path>
<!--End Poison Back-->
<!--Begin Poison Front-->
<g id="poi_front">
<path
fill="#739a00"
>
<animate
id="poi_front_1"
attributeName="d"
values="m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z; m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
begin="0s;poi_front_2.end"
dur="1.5s"
/>
<animate
id="poi_front_2"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z"
begin="poi_front_1.end "
dur="1.5s"
/>
</path>
</g>
<!--End Poison Front-->
</svg>
uj5u.com熱心網友回復:
您在問題中提出的問題以及您對代碼的處理方式在很多方面都不同。但是由于各種原因,它們中的任何一個都不起作用。
- 如果一個
<animate>元素包含一個values屬性,它必須包含一個對應的keyTimes屬性,并且具有相同數量的分號分隔值(從 0 到 1 升序)。keyTimes如果您使用fromand屬性,則只能省略該 屬性to。
只有第一點需要讓您的影片暫停/取消暫停:
顯示代碼片段
document.getElementById("svg").pauseAnimations();
document.getElementById("button").onclick = start;
function start(){
document.getElementById("svg").unpauseAnimations();
}
document.getElementById("button2").onclick = stop;
function stop(){
document.getElementById("svg").pauseAnimations();
}
html, body{
height: 100%;
margin: 0%;
padding: 0%;
overflow: hidden;
}
body{
height: 100vh;
display: flex;
background-color: #2a0000;
box-sizing: border-box;
flex-direction: column;
align-items: center;
}
#button{
width: 60px;
height: 30px;
background-color: orange;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
#button2{
width: 60px;
height: 30px;
background-color: yellow;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
<button id="button">START</button>
<button id="button2">STOP</button>
<svg
width="100%"
height="100%"
version="1.1"
viewBox="0 0 300 300"
xmlns="http://www.w3.org/2000/svg"
id="svg">
<!--Begin Bottle -->
<path
d="m166.76 57.45c-13.062-0.0623-26.955 0.73204-46.311 0.0859-2.7685-0.0924-5 2.23-5 5v10.709c-2e-5 2.77 2.23 5 5 5h4.7226v6.209a88.388 88.388 0 0 0 -67.176 85.715 88.388 88.388 0 0 0 88.389 88.389 88.388 88.388 0 0 0 88.389 -88.389 88.388 88.388 0 0 0 -67.176 -85.695v-6.2285h4.7227c2.77 0 5-2.23 5-5v-10.709c0-2.77-2.231-4.9242-5-5-1.8457-0.0506-3.6945-0.077-5.5606-0.0859z"
fill="#1b000c"/>
<path
d="m231.11 170.17c0 46.793-37.933 84.727-84.727 84.727-46.793 0-84.727-37.933-84.727-84.727-1e-6 -40.912 28.997-75.051 67.559-82.986 12.071 2.5421 23.795 1.9463 35.395 0.22531 38.033 8.3382 66.499 42.225 66.499 82.761z"
fill="#270600"/>
<path
d="m122.57 61.1c16.221 0.59986 32.004 0.30589 47.553 0 1.8278-0.036 3.3 1.4718 3.3 3.3v6.2541c0 1.8282-1.4718 3.3-3.3 3.3h-47.553c-1.8282 0-3.3-1.4718-3.3-3.3v-6.2541c0-1.8282 1.473-3.3676 3.3-3.3z"
fill="#270600"/>
<path
d="m129.08 77.57v6.0117c9.8102 2.4161 28.289 2.4275 35 0v-6.0117z"
fill="#270600"/>
<!--End Bottle -->
<!--Begin Poison Back-->
<path
fill="#9bc300"
id="poi_back">
<animate
id="poi_back_1"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z"
keyTimes="0;1"
begin="0s;poi_back_2.end"
dur="1.5s"
/>
<animate
id="poi_back_2"
attributeName="d"
values="m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z;m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
keyTimes="0;1"
begin="poi_back_1.end"
dur="1.5s"
/>
</path>
<!--End Poison Back-->
<!--Begin Poison Front-->
<g id="poi_front">
<path
fill="#739a00"
>
<animate
id="poi_front_1"
attributeName="d"
values="m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z; m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
keyTimes="0;1"
begin="0s;poi_front_2.end"
dur="1.5s"
/>
<animate
id="poi_front_2"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z"
keyTimes="0;1"
begin="poi_front_1.end "
dur="1.5s"
/>
</path>
</g>
<!--End Poison Front-->
</svg>
.pauseAnimations()或者.unpauseAnimations()只能在<svg>元素上呼叫,在你的情況下document.getElementById("svg")。他們將立即暫停和取消暫停所有影片子元素。無法選擇單個影片。如果你想定位單個影片,相關的介面是
ElementTimeControl帶有方法.beginElement()和.endElement()的,要在<animate>元素本身上呼叫,如document.getElementById("poi_front_1"). 在中間狀態下暫停和取消暫停影片是不可能的。您在另一個影片結束時開始一個影片的技術使事情變得非常復雜。無論影片是簡單地結束還是以編程方式停止,
endEvent總是會引發并觸發重新啟動。不幸的是,這些事件是不可取消的,所以呼叫Event.preventDefault()不起作用。
將兩個交替的影片合二為一會方便得多。該values串列獲得三個值:"...state1...;...state2...;...state1..."、keyTimes設定為"0;0.5;1"、dur加倍。此外,設定repeatCount="indefinite"影片運行。然后您可以設定begin="0s"為自動運行它或begin="indefinite"以編程方式控制它。
額外提示:如果您希望影片停止后路徑留在螢屏上,請設定fill="freeze".
var poiFront1 = document.getElementById("poi_front_1")
var poiFront2 = document.getElementById("poi_front_2")
document.getElementById("button").onclick = function (){
poiFront1.beginElement();
}
document.getElementById("button2").onclick = function (){
poiFront1.endElement();
}
html, body{
height: 100%;
margin: 0%;
padding: 0%;
overflow: hidden;
}
body{
height: 100vh;
display: flex;
background-color: #2a0000;
box-sizing: border-box;
flex-direction: column;
align-items: center;
}
#button{
width: 60px;
height: 30px;
background-color: orange;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
#button2{
width: 60px;
height: 30px;
background-color: yellow;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
<button id="button">START</button>
<button id="button2">STOP</button>
<svg
width="100%"
height="100%"
version="1.1"
viewBox="0 0 300 300"
xmlns="http://www.w3.org/2000/svg"
id="svg">
<!--Begin Bottle -->
<path
d="m166.76 57.45c-13.062-0.0623-26.955 0.73204-46.311 0.0859-2.7685-0.0924-5 2.23-5 5v10.709c-2e-5 2.77 2.23 5 5 5h4.7226v6.209a88.388 88.388 0 0 0 -67.176 85.715 88.388 88.388 0 0 0 88.389 88.389 88.388 88.388 0 0 0 88.389 -88.389 88.388 88.388 0 0 0 -67.176 -85.695v-6.2285h4.7227c2.77 0 5-2.23 5-5v-10.709c0-2.77-2.231-4.9242-5-5-1.8457-0.0506-3.6945-0.077-5.5606-0.0859z"
fill="#1b000c"/>
<path
d="m231.11 170.17c0 46.793-37.933 84.727-84.727 84.727-46.793 0-84.727-37.933-84.727-84.727-1e-6 -40.912 28.997-75.051 67.559-82.986 12.071 2.5421 23.795 1.9463 35.395 0.22531 38.033 8.3382 66.499 42.225 66.499 82.761z"
fill="#270600"/>
<path
d="m122.57 61.1c16.221 0.59986 32.004 0.30589 47.553 0 1.8278-0.036 3.3 1.4718 3.3 3.3v6.2541c0 1.8282-1.4718 3.3-3.3 3.3h-47.553c-1.8282 0-3.3-1.4718-3.3-3.3v-6.2541c0-1.8282 1.473-3.3676 3.3-3.3z"
fill="#270600"/>
<path
d="m129.08 77.57v6.0117c9.8102 2.4161 28.289 2.4275 35 0v-6.0117z"
fill="#270600"/>
<!--End Bottle -->
<!--Begin Poison Back-->
<path
fill="#9bc300"
id="poi_back">
<animate
id="poi_back_1"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z;m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
keyTimes="0;0.5;1"
begin="0s"
dur="3s"
repeatCount="indefinite"
/>
</path>
<!--End Poison Back-->
<!--Begin Poison Front-->
<g id="poi_front">
<path
fill="#739a00"
>
<animate
id="poi_front_1"
attributeName="d"
values="m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z; m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z"
keyTimes="0;0.5;1"
begin="indefinite"
dur="3s"
repeatCount="indefinite"
/>
</path>
</g>
<!--End Poison Front-->
</svg>
uj5u.com熱心網友回復:
您可以使用SVGAnimationElement介面和beginElement()(and endElement()) 來控制各個影片。
在此示例中,我洗掉了該begin屬性并使用endEvent事件來啟動下一個影片。但這僅在變數running.run為真的情況下。因此,當單擊停止時,當前影片將結束。
var running = {
elm: undefined,
run: false
};
document.getElementById("button").addEventListener('click', e => {
if (running.elm) {
running.elm.beginElement();
} else {
document.getElementById("poi_front_1").beginElement();
running.elm = document.getElementById("poi_front_1");
}
running.run = true;
});
document.getElementById("button2").addEventListener('click', e => {
running.run = false;
});
document.getElementById("poi_front_1").addEventListener('endEvent', e => {
if (running.run) {
document.getElementById("poi_front_2").beginElement();
}
running.elm = document.getElementById("poi_front_2");
});
document.getElementById("poi_front_2").addEventListener('endEvent', e => {
if (running.run) {
document.getElementById("poi_front_1").beginElement();
}
running.elm = document.getElementById("poi_front_1");
});
html,
body {
height: 100%;
margin: 0%;
padding: 0%;
overflow: hidden;
}
body {
height: 100vh;
display: flex;
background-color: #2a0000;
box-sizing: border-box;
flex-direction: column;
align-items: center;
}
#button {
width: 60px;
height: 30px;
background-color: orange;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
#button2 {
width: 60px;
height: 30px;
background-color: yellow;
position: relative;
margin-top: 5px;
margin-bottom: 5px;
}
<button id="button">START</button>
<button id="button2">STOP</button>
<svg width="100%" height="100%" version="1.1" viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg" id="svg">
<!--Begin Bottle -->
<path
d="m166.76 57.45c-13.062-0.0623-26.955 0.73204-46.311 0.0859-2.7685-0.0924-5 2.23-5 5v10.709c-2e-5 2.77 2.23 5 5 5h4.7226v6.209a88.388 88.388 0 0 0 -67.176 85.715 88.388 88.388 0 0 0 88.389 88.389 88.388 88.388 0 0 0 88.389 -88.389 88.388 88.388 0 0 0 -67.176 -85.695v-6.2285h4.7227c2.77 0 5-2.23 5-5v-10.709c0-2.77-2.231-4.9242-5-5-1.8457-0.0506-3.6945-0.077-5.5606-0.0859z"
fill="#1b000c"/>
<path
d="m231.11 170.17c0 46.793-37.933 84.727-84.727 84.727-46.793 0-84.727-37.933-84.727-84.727-1e-6 -40.912 28.997-75.051 67.559-82.986 12.071 2.5421 23.795 1.9463 35.395 0.22531 38.033 8.3382 66.499 42.225 66.499 82.761z"
fill="#270600"/>
<path
d="m122.57 61.1c16.221 0.59986 32.004 0.30589 47.553 0 1.8278-0.036 3.3 1.4718 3.3 3.3v6.2541c0 1.8282-1.4718 3.3-3.3 3.3h-47.553c-1.8282 0-3.3-1.4718-3.3-3.3v-6.2541c0-1.8282 1.473-3.3676 3.3-3.3z"
fill="#270600"/>
<path
d="m129.08 77.57v6.0117c9.8102 2.4161 28.289 2.4275 35 0v-6.0117z"
fill="#270600"/>
<!--End Bottle -->
<!--Begin Poison Back-->
<path
fill="#9bc300"
id="poi_back">
<animate
id="poi_back_1"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z"
begin="0s;poi_back_2.end"
dur="1.5s"
/>
<animate
id="poi_back_2"
attributeName="d"
values="m 62.692,157.03 c 0.858416,-8.12931 -0.379575,2.34105 -1.0332,13.139 -2.827316,46.70751 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -8.28777,2.68817 -30.19905,-24.60832 -80.45959,1.45473 C 92.556926,187.6518 60.557883,163.01304 61.6588,170.169 Z;m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
begin="poi_back_1.end"
dur="1.5s"
/>
</path>
<!--End Poison Back-->
<!--Begin Poison Front-->
<g id="poi_front">
<path
fill="#739a00"
d="m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z"
>
<animate
id="poi_front_1"
attributeName="d"
values="m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z; m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z"
begin=""
dur="1.5s"
fill="freeze"
/>
<animate
id="poi_front_2"
attributeName="d"
values="m 62.692,157.03 c -0.66726,4.2839 -1.0332,8.6677 -1.0332,13.139 2e-6,46.793 37.933,84.727 84.727,84.727 46.793,0 84.727,-37.933 84.727,-84.727 0,-4.4706 -0.36411,-8.8552 -1.0312,-13.139 -14.83662,12.68631 -46.3415,32.04916 -110.09827,6.15172 C 55.89527,130.25689 61.6596,170.1687 62.6926,157.03 Z; m62.692 157.03c-0.66726 4.2839-1.0332 8.6677-1.0332 13.139 2e-6 46.793 37.933 84.727 84.727 84.727 46.793 0 84.727-37.933 84.727-84.727 0-4.4706-0.36411-8.8552-1.0312-13.139-7.1302-16.488-52.947-12.538-86.979 5.0508-31.611 16.066-81.443 8.0879-80.41-5.0508z"
begin=""
dur="1.5s"
fill="freeze"
/>
</path>
</g>
<!--End Poison Front-->
</svg>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/486831.html
標籤:javascript html 动画 svg 微笑
