BottomMenuSvg.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div class="test">
  3. <svg id="svgBox" @click="changeShowBottomMenusStatus()" width="300" height="180" viewBox="0 0 410 314" version="1.1" xmlns="http://www.w3.org/2000/svg">
  4. <!-- 内阴影定义 -->
  5. <filter id="innershadow" x="0" y="0">
  6. <feComponentTransfer in="SourceAlpha">
  7. <feFuncA type="table" tableValues="1 0" />
  8. </feComponentTransfer>
  9. <feGaussianBlur stdDeviation="5" />
  10. <feOffset dx="0" dy="0" result="offsetblur" />
  11. <feFlood floodColor="#000000" floodOpacity="1" result="color" />
  12. <feComposite in2="offsetblur" operator="in" />
  13. <feComposite in2="SourceAlpha" operator="in" />
  14. <feMerge>
  15. <feMergeNode in="SourceGraphic" />
  16. <feMergeNode />
  17. </feMerge>
  18. </filter>
  19. <!-- 正常边框渐变定义 -->
  20. <defs>
  21. <!-- 内容透明定义 -->
  22. <linearGradient id="grad1" x1="0%" y1="100%" x2="100%" y2="100%">
  23. <stop offset="0%" style="stop-color: #27ffff; stop-opacity: 0" />
  24. <stop offset="100%" style="stop-color: #27ffff; stop-opacity: 0.5" />
  25. </linearGradient>
  26. <!-- 内容渐变定义 -->
  27. <linearGradient id="grad2" x1="0%" y1="0%" x2="0%" y2="100%">
  28. <stop offset="0%" style="stop-color: #27cdff; stop-opacity: 0" />
  29. <stop offset="100%" style="stop-color: #27cdff; stop-opacity: 0.5" />
  30. </linearGradient>
  31. <!-- 第二层中部定义 -->
  32. <linearGradient id="grad2-2" x1="0%" y1="0%" x2="0%" y2="100%">
  33. <stop offset="0%" style="stop-color: #27cdffaa; stop-opacity: 1" />
  34. <stop offset="100%" style="stop-color: #27cdffaa; stop-opacity: 1" />
  35. </linearGradient>
  36. <!-- 左深右浅 -->
  37. <linearGradient id="grad2-3" x1="100%" y1="0%" x2="0%" y2="100%">
  38. <stop offset="0%" style="stop-color: #74ffff; stop-opacity: 1" />
  39. <stop offset="100%" style="stop-color: #0037ff; stop-opacity: 1" />
  40. </linearGradient>
  41. <linearGradient id="grad2-4" x1="100%" y1="100%" x2="100%" y2="0%">
  42. <stop offset="0%" style="stop-color: #27ffffaa; stop-opacity: 1" />
  43. <stop offset="100%" style="stop-color: #27cdff; stop-opacity: 0" />
  44. </linearGradient>
  45. <linearGradient id="grad2-5" x1="100%" y1="100%" x2="100%" y2="0%">
  46. <stop offset="0%" style="stop-color: #27ffff; stop-opacity: 1" />
  47. <stop offset="100%" style="stop-color: #27cdff; stop-opacity: 0" />
  48. </linearGradient>
  49. <!-- 浅色圆环 -->
  50. <linearGradient id="grad3" x1="0%" y1="0%" x2="0%" y2="100%">
  51. <stop offset="0%" style="stop-color: #74ffff64; stop-opacity: 0.5" />
  52. <stop offset="100%" style="stop-color: #74ffff; stop-opacity: 1" />
  53. </linearGradient>
  54. <!-- 深色圆环 -->
  55. <linearGradient id="grad4" x1="0%" y1="0%" x2="0%" y2="100%">
  56. <stop offset="0%" style="stop-color: #00aaff64; stop-opacity: 0.1" />
  57. <stop offset="100%" style="stop-color: #00244d; stop-opacity: 1" />
  58. </linearGradient>
  59. <!-- 圆盘面渐变颜色 -->
  60. <linearGradient id="shipGrad1" x1="100%" y1="0%" x2="0%" y2="0%">
  61. <stop offset="0%" style="stop-color: #5dd8d8; stop-opacity: 1" />
  62. <stop offset="100%" style="stop-color: #0037ff; stop-opacity: 1" />
  63. </linearGradient>
  64. <!-- ship内环背景渐变定义 -->
  65. <radialGradient id="coludFill" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
  66. <stop offset="80%" style="stop-color: #00000000; stop-opacity: 0" />
  67. <stop offset="100%" style="stop-color: #27cdff; stop-opacity: 1" />
  68. </radialGradient>
  69. </defs>
  70. <symbol>
  71. <g id="Upath1">
  72. <path d="M 0 0 L 100 0 L 100 50 Q 100,60 50,62 Q 0,60 0,50 L 0 50 z " fill="url(#grad2-4)" />
  73. <path d="M 38 25 L 62 25 L 62 50 Q 62,53 50,53 Q 38,53 38,50 L 38 50 z " fill="url(#grad2-5)" />
  74. <path class="svgPath index1" d="M 5 0 L 7 0 L 7 10 L 5 10 z" fill="url(#grad2-5)" />
  75. <path class="svgPath index2" d="M 15 0 L 17 0 L 17 10 L 15 10 z" fill="url(#grad2-5)" />
  76. <path class="svgPath index3" d="M 25 0 L 27 0 L 27 10 L 25 10 z" fill="url(#grad2-5)" />
  77. <path class="svgPath index4" d="M 35 0 L 37 0 L 37 10 L 35 10 z" fill="url(#grad2-5)" />
  78. <path class="svgPath index5" d="M 45 0 L 47 0 L 47 10 L 45 10 z" fill="url(#grad2-5)" />
  79. <path class="svgPath index6" d="M 55 0 L 57 0 L 57 10 L 55 10 z" fill="url(#grad2-5)" />
  80. <path class="svgPath index7" d="M 65 0 L 67 0 L 67 10 L 65 10 z" fill="url(#grad2-5)" />
  81. <path class="svgPath index8" d="M 40 10 L 42 10 L 42 15 L 40 15 z" fill="url(#grad2-5)" />
  82. <path class="svgPath index9" d="M 50 10 L 52 10 L 52 15 L 50 15 z" fill="url(#grad2-5)" />
  83. <path class="svgPath index10" d="M 60 10 L 62 10 L 62 15 L 60 15 z" fill="url(#grad2-5)" />
  84. <path class="svgPath index11" d="M 75 0 L 77 0 L 77 10 L 75 10 z" fill="url(#grad2-5)" />
  85. <path class="svgPath index12" d="M 85 0 L 87 0 L 87 10 L 85 10 z" fill="url(#grad2-5)" />
  86. <path class="svgPath index13" d="M 95 0 L 97 0 L 97 10 L 95 10 z" fill="url(#grad2-5)" />
  87. </g>
  88. </symbol>
  89. <!-- 底部圆饼外环 -->
  90. <ellipse cx="210" cy="268" rx="180" ry="45" stroke="url(#grad3)" fill="url(#grad1)" style="stroke-width: 4" />
  91. <!-- 底部圆饼中环 -->
  92. <ellipse
  93. class="strokeDashoffset2"
  94. cx="210"
  95. cy="268"
  96. rx="157"
  97. ry="40"
  98. stroke="url(#grad3)"
  99. stroke-dasharray="50,5"
  100. style="fill: #00000000; stroke-width: 2"
  101. />
  102. <!-- 底部圆饼内环 -->
  103. <ellipse
  104. class="strokeDashoffset2"
  105. cx="210"
  106. cy="258"
  107. rx="117"
  108. ry="30"
  109. stroke="url(#grad3)"
  110. stroke-dasharray="5,5"
  111. style="fill: #00000000; stroke-width: 2"
  112. />
  113. <!-- 第二层底部台座 -->
  114. <ellipse cx="210" cy="250" rx="90.6" ry="22.4" stroke="url(#grad3)" style="fill: #00244d; stroke-width: 10" />
  115. <!-- 第二层底部外环 -->
  116. <ellipse cx="210" cy="248" rx="93.6" ry="23.4" stroke="url(#grad4)" fill="url(#shipGrad1)" style="stroke-width: 2" />
  117. <!-- 第二层底部中环 -->
  118. <ellipse
  119. class="strokeDashoffset3"
  120. cx="210"
  121. cy="247"
  122. rx="80"
  123. ry="20"
  124. stroke="url(#grad3)"
  125. style="fill: #00000000; stroke-width: 2"
  126. />
  127. <!-- 第二层底部中内环 -->
  128. <ellipse
  129. class="strokeDashoffset2"
  130. cx="210"
  131. cy="247"
  132. rx="75"
  133. ry="18"
  134. stroke="url(#grad3)"
  135. style="fill: #00000000; stroke-width: 1"
  136. />
  137. <!-- 第二层底部内环 -->
  138. <ellipse cx="210" cy="246" rx="45" ry="10" stroke="url(#grad3)" fill="url(#grad2-2)" style="stroke-width: 0" />
  139. <!-- 第二层内环外圆饼 -->
  140. <ellipse cx="210" cy="246" rx="50" ry="12" stroke="url(#grad3)" fill="url(#grad2-2)" style="stroke-width: 0" />
  141. <!-- 第二层内环内圆饼 -->
  142. <ellipse cx="210" cy="246" rx="28" ry="7" stroke="url(#grad3)" fill="url(#grad2-3)" style="stroke-width: 0" />
  143. <ellipse cx="210" cy="246" rx="25" ry="6" stroke="url(#grad3)" fill="url(#shipGrad1)" style="stroke-width: 0" />
  144. <ellipse cx="210" cy="246" rx="15" ry="4" stroke="url(#grad3)" fill="url(#grad2-3)" style="stroke-width: 0" />
  145. <ellipse cx="210" cy="246" rx="12" ry="3" stroke="url(#grad3)" fill="#74ffff" style="stroke-width: 0" />
  146. <!-- 方形聚光效果 -->
  147. <use x="160" y="196" width="100" height="50" xlink:href="#Upath1" />
  148. </svg>
  149. </div>
  150. </template>
  151. <script>
  152. export default {
  153. name: "BottomMenuSvg",
  154. components: {},
  155. data() {
  156. return {};
  157. },
  158. mounted() {},
  159. /**
  160. * data.type: 布局方式【lr:左右布局;other:上下布局】,默认为lr(非必填)
  161. * data.title: 标题(必填)
  162. * data.value: 值(必填)
  163. * data.unit: 单位
  164. */
  165. props: ["data"],
  166. methods: {
  167. changeShowBottomMenusStatus(){
  168. this.$emit('changeShowBottomMenusStatus');
  169. }
  170. },
  171. watch: {}
  172. };
  173. </script>
  174. <style>
  175. .test {
  176. display: flex;
  177. position: relative;
  178. justify-content: center;
  179. }
  180. #svgBox {
  181. cursor: pointer;
  182. position: absolute;
  183. bottom: 0px;
  184. }
  185. svg .strokeDashoffset2 {
  186. stroke-dasharray: 10;
  187. stroke-dashoffset: 0;
  188. animation: dash 5s linear infinite;
  189. }
  190. svg .strokeDashoffset3 {
  191. stroke-dasharray: 8;
  192. stroke-dashoffset: 0;
  193. animation: dash2 3s linear infinite;
  194. }
  195. svg .svgPath {
  196. transform: rotate(-90deg);
  197. offset-path: path("M0 0 L0 40");
  198. offset-distance: 0%;
  199. opacity: 0;
  200. }
  201. svg .index1 {
  202. animation: ball 2.2s linear 0s infinite;
  203. }
  204. svg .index2 {
  205. animation: ball 0.7s linear 0.3s infinite;
  206. }
  207. svg .index3 {
  208. animation: ball 1.8s linear 0.9s infinite;
  209. }
  210. svg .index4 {
  211. animation: ball 2.2s linear 1.1s infinite;
  212. }
  213. svg .index5 {
  214. animation: ball 2.5s linear 1.7s infinite;
  215. }
  216. svg .index6 {
  217. animation: ball 2s linear 1.9s infinite;
  218. }
  219. svg .index7 {
  220. animation: ball 0.4s linear 0.1s infinite;
  221. }
  222. svg .index8 {
  223. animation: ball 0.5s linear 0.2s infinite;
  224. }
  225. svg .index9 {
  226. animation: ball 1.4s linear 0.7s infinite;
  227. }
  228. svg .index10 {
  229. animation: ball 1.6s linear 0.8s infinite;
  230. }
  231. svg .index11 {
  232. animation: ball 1s linear 0.5s infinite;
  233. }
  234. svg .index12 {
  235. animation: ball 1.5s linear 0.7s infinite;
  236. }
  237. svg .index13 {
  238. animation: ball 2s linear 1.3s infinite;
  239. }
  240. @keyframes dash {
  241. from {
  242. stroke-dashoffset: 100;
  243. }
  244. to {
  245. stroke-dashoffset: 0;
  246. }
  247. }
  248. @keyframes dash2 {
  249. from {
  250. stroke-dashoffset: 0;
  251. }
  252. to {
  253. stroke-dashoffset: 100;
  254. }
  255. }
  256. @keyframes ball {
  257. 0% {
  258. offset-distance: 0%;
  259. opacity: 0;
  260. }
  261. 50% {
  262. offset-distance: 50%;
  263. opacity: 1;
  264. }
  265. 100% {
  266. offset-distance: 100%;
  267. opacity: 0;
  268. }
  269. }
  270. </style>