svg+css实现球形动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现球形动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body,html{ width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; } body{ background-color: #E0E8EA; display: flex; justify-content: center; align-items: center; } svg{ height: 80%; width: 80%; max-height: 512px; max-width: 512px; } </style> </head> <body > <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 640 640" style="enable-background:new 0 0 640 640;" xml:space="preserve"> <use href="#circles"/> <defs> <g id="circles"> <path> <animate attributeName="d" dur="1s" repeatCount="indefinite" calcMode="spline" keyTimes="0;1" keySplines="0.56 0.11 0.56 0.92" values="M165.1,516.2c8.8,72.9,300.4,77.9,309.9-2.2C472.6,438.2,166.8,433.5,165.1,516.2z; M357,527c1.4,14.1-61.3,17.7-72.4,3.8C268.9,510.9,357.3,508.8,357,527z"/> <animate attributeName="fill" dur="1s" repeatCount="indefinite" values="#c6c8de;#e8ecf7"/> </path> <path> <animate attributeName="d" dur="1s" repeatCount="indefinite" calcMode="spline" keyTimes="0;1" keySplines="0.56 0.11 0.56 0.92" values="M106.1,461.3C117.9,569.7,521.4,575,534,459C528.4,347.4,111.1,342.6,106.1,461.3z; M165.1,516.2c8.8,72.9,300.4,77.9,309.9-2.2C472.6,438.2,166.8,433.5,165.1,516.2z"/> <animate attributeName="fill" dur="1s" repeatCount="indefinite" values="#c3abd1;#c6c8de"/> </path> <path> <animate attributeName="d" dur="1s" repeatCount="indefinite" calcMode="spline" keyTimes="0;1" keySplines="0.56 0.11 0.56 0.92" values="M76.1,402.1c12.9,115.2,474,120.5,487.9-2.1C557.5,281.8,82.4,277,76.1,402.1z; M106.1,461.3C117.9,569.7,521.4,575,534,459C528.4,347.4,111.1,342.6,106.1,461.3z"/> <animate attributeName="fill" dur="1s" repeatCount="indefinite" values="#908bbf;#c3abd1"/> </path> <path> <animate attributeName="d" dur="1s" repeatCount="indefinite" calcMode="spline" keyTimes="0;1" keySplines="0.56 0.11 0.56 0.92" values="M58.1,322.2C72.2,454.6,567.2,459.8,582,320C574.2,184.5,65.4,179.8,58.1,322.2z; M76.1,402.1c12.9,115.2,474,120.5,487.9-2.1C557.5,281.8,82.4,277,76.1,402.1z"/> <animate attributeName="fill" dur="1s" repeatCount="indefinite" values="#4b6eb0;#908bbf"/> </path> <path> <animate att.........完整代码请登录后点击上方下载按钮下载查看
网友评论0