{"id":4480,"date":"2014-12-14T01:35:18","date_gmt":"2014-12-13T17:35:18","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4480"},"modified":"2018-06-16T00:06:01","modified_gmt":"2018-06-15T16:06:01","slug":"github-svg-morpheus-shape-path-free-transform","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2014\/12\/github-svg-morpheus-shape-path-free-transform\/","title":{"rendered":"SVG-Morpheus\u5b9e\u73b0SVG\u56fe\u6807\u56fe\u5f62\u95f4\u7684\u8865\u5f62\u52a8\u753b"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/\">http:\/\/www.zhangxinxu.com<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4480\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=4480<\/a><\/p>\n<h3>\u4e00\u3001\u5173\u4e8e\u77e2\u91cf\u56fe\u5f62\u95f4\u7684\u8865\u5f62\u52a8\u753b<\/h3>\n<p>\u65f6\u5149\u5189\u5189\uff0c\u8fd8\u4f9d\u7a00\u8bb0\u5f97\u5b66\u751f\u65f6\u4ee3\u6298\u817eflash\u52a8\u753b\u90a3\u4f1a\u513f\uff0c\u53ea\u8981\u5efa\u524d\u540e\u4e24\u4e2a\u5173\u952e\u5e27\uff0c\u524d\u9762\u753b\u4e2a\u65b9\u6846\uff0c\u540e\u9762\u753b\u4e2a\u5708\u5708\uff0c\u7136\u540e\u5efa\u7acb\u4e2a\u8865\u5f62\u52a8\u753b\uff0c\u5c31\u6709\u4e86\u4ece\u65b9\u6846\u5230\u5706\u7684\u53d8\u5316\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201412\/2014-12-13_204732.png\" width=\"503\" height=\"356\" alt=\"flash\u4e2d\u8865\u5f62\u52a8\u753b\u9762\u677f\u793a\u610f\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u6700\u540e\u6548\u679c\u53c2\u89c1\u4e0bflash\u52a8\u753b\uff08\u7531\u4e8e\u6ca1\u6709\u5ef6\u8fdf\uff0c\u6240\u4ee5\u6709\u4e9b\u62bd\u98ce<img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/20.gif\" align=\"absmiddle\">\uff09\uff1a<\/p>\n<p><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"350\" height=\"200\"><param name=\"movie\" value=\"\/\/image.zhangxinxu.com\/flash\/blog\/201412\/rect-2-circle.swf\"><param name=\"quality\" value=\"high\"><param name=\"swfversion\" value=\"9.0.45.0\"><param name=\"FlashVars\" value=\"name=zhangxinxu\"><embed width=\"350\" height=\"200\" src=\"\/\/image.zhangxinxu.com\/flash\/blog\/201412\/rect-2-circle.swf\" type=\"application\/x-shockwave-flash\"><\/object><\/p>\n<p>\u7136\u540e\uff0c\u4e00\u6643\uff0c\u597d\u591a\u5e74\u8fc7\u53bb\u4e86\uff0c\u968f\u7740CSS3\u7684\u8d8a\u53d1\u5f3a\u52b2\uff0c\u7a7f\u82b1\u620f\u8776\u3001\u95f2\u4e91\u4fe1\u6b65\u95f4\uff0c\u6211\u4eec\u603b\u4f1a\u770b\u5230\u4e00\u4e9b\u5c0f\u800c\u7f8e\u7684\u56fe\u6807\u52a8\u753b\u6548\u679c\u3002\u4f8b\u5982\uff0ccheckbox\u9009\u4e2d\u65f6\u5019\uff0c\u90a3\u4e2a\u94a9\u94a9\u8c03\u76ae\u5730\u52fe\u4e00\u4e0b\uff1b\u6216\u8005\u79fb\u52a8\u7aef\u4e09\u6a2a\u83dc\u5355\u56fe\u6807\u5728\u5c55\u5f00\u5f0f\u53d8\u6210\u53c9\u53c9\u7b49\u7b49\u3002\u751a\u81f3Google\u5728\u5176\u8bbe\u8ba1\u7684\u5b98\u65b9\u6587\u6863\u4e2d\u4e13\u95e8\u53e6\u8d77\u4e00\u4e2a\u680f\u76ee<a href=\"http:\/\/www.google.com\/design\/spec\/animation\/delightful-details.html\">delightful details<\/a>, \u63a8\u8350\u591a\u4e00\u4e9b\u8fd9\u79cd\u5c0f\u800c\u7f8e\u7684\u56fe\u6807\u95f4\u7684\u8865\u5f62\u8fc7\u6e21\u52a8\u753b\uff0c\u8fd9\u79cd\u7ec6\u817b\u7684\u5904\u7406\u4f1a\u8ba9\u4f60\u7684\u4ea7\u54c1\u903c\u683c\u7acb\u5373\u4e0a\u53bb\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ww1.sinaimg.cn\/bmiddle\/72552fdbjw1en4k0xdfneg209s09x48n.gif\" width=\"352\" height=\"357\" alt=\"\u5c0f\u800c\u7f8e\u7684\u56fe\u6807\u8865\u5f62\u52a8\u753b\u6548\u679c\" onerror=\"this.src='\/\/image.zhangxinxu.com\/image\/blog\/201412\/shape-ani-s.gif';this.width=180;this.height=182;\" \/><\/p>\n<p>\u4f46\u662f\uff0c\u6ce8\u610f\uff01\u4f46\u662f\uff0c\u4e3a\u4f55\u6211\u4eec\u5374\u9c9c\u89c1\u8fd9\u7c7b\u7acb\u663e\u903c\u683c\u7684\u6548\u679c\u5462\uff1f<\/p>\n<ol>\n<li>\u975e\u6280\u672f\u89d2\u5ea6\u8bb2\uff0c\u662f\u538b\u6839\u6ca1\u89c1\u5230\u6ca1\u60f3\u5230\u8fd9\u4e00\u832c\uff1b<\/li>\n<li>\u6280\u672f\u89d2\u5ea6\u8bb2\uff0cCSS3\u53bb\u5b9e\u73b0\u8fd9\u7c7b\u53d8\u6362\u5c40\u9650\u8f83\u5927\uff0c\u6bd5\u7adftransform\u53d8\u6362\u5c31\u90a3\u51e0\u79cd\uff0c\u597d\u6bd4\u4e0a\u9762gif\u53f3\u4e0a\u90a3\u4e2a2\u4e2a\u77ed\u6a2a\u53d8\u62101\u4e2a\u4e09\u89d2\u7684\u6548\u679c\uff0c\u81f3\u5c11\u5728\u6211\u770b\u6765\uff0c\u5355\u7eafCSS\u5b9e\u73b0\u662f\u5f88\u5403\u529b\u7684\uff1b<\/li>\n<li>\u6700\u597d\u7684\u5b9e\u73b0\u90a3\u5fc5\u987b\u662fSVG, \u4f46\u662f\uff0cHTML\u5f88\u591a\u7ae5\u978b\u90fd\u628a\u73a9\u4e0d\u6765\uff0c\u5939\u6742\u5f88\u591a\u6570\u5b66\u77e5\u8bc6\u7684SVG\u77e2\u91cf\u5904\u7406\u90a3\u66f4\u662f\u832b\u7136\u672a\u77e5\u6216\u77e5\u4e4b\u53d1\u80a4\u800c\u4e0d\u901a\u6653\u673a\u7406\u3002<\/li>\n<\/ol>\n<p>OK\uff0c\u548b\u529e\uff0c\u53ea\u80fd\u9ad8\u5c71\u4ef0\u6b62\u4e86\u5417\uff1f<\/p>\n<p>\u8fd9\u91cc\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e2a\u597d\u4e1c\u897f\uff1a<strong>SVG-Morpheus<\/strong> \u4e13\u95e8\u7528\u6765\u5b9e\u73b0SVG\u56fe\u6807\u56fe\u5f62\u95f4\u7684\u8865\u5f62\u52a8\u753b\u3002<\/p>\n<h3>\u4e8c\u3001SVG-Morpheus\u9879\u76ee\u7b80\u4ecb<\/h3>\n<p>SVG-Morpheus\u4e3a\u5f00\u6e90\u9879\u76ee\uff0cgithub\u9879\u76ee\u5730\u5740\u662f\uff1a<a href=\"https:\/\/github.com\/alexk111\/SVG-Morpheus\" target=\"_blank\">https:\/\/github.com\/alexk111\/SVG-Morpheus<\/a><\/p>\n<p>\u4ecb\u7ecd\u4e4b\u524d\uff0c\u5148\u770b\u4e0b\u90e8\u5206\u622a\u5c4f\u6548\u679c\uff0c\u770b\u770b\u6709\u6728\u6709\u5174\u8da3\uff08\u5982\u679c\u6ca1\u6709\u64ad\u653e\uff0c\u8bf7\u53f3\u952e-\u663e\u793a\u63a7\u4ef6\uff0c\u7136\u540e\u64ad\u653e\uff09\uff1a<br \/>\n<video src=\"\/\/image.zhangxinxu.com\/video\/blog\/201412\/Video_2014-12-13_215709_1.mp4\" loop width=\"172\" height=\"144\" autoplay><\/video><\/p>\n<p>\u6548\u679c\u8fd8\u662f\u6bd4\u8f83\u6d41\u7545\u7684\uff0c\u5b8c\u6574\u6548\u679c\u53ef\u4ee5\u53bb\u9879\u76ee\u4e13\u95e8\u7684<a href=\"http:\/\/alexk111.github.io\/SVG-Morpheus\/\" target=\"_blank\">demo\u6f14\u793a\u9875\u9762<\/a>\u89c2\u6469\u3002<\/p>\n<style>.pl-ent {color: #cd0000;}.pl-e, .pl-en {color: #336699;}.pl-pds, .pl-s1, .pl-s1 .pl-pse .pl-s2, .pl-sr, .pl-sr .pl-cce, .pl-sr .pl-sra, .pl-sr .pl-sre, .pl-src, .pl-v {color: green;}<\/style>\n<p><strong>\u5982\u4f55\u4f7f\u7528\uff1f<\/strong><br \/>\n<strong>1. \u9996\u5148\uff0cSVG\u4ee3\u7801\u7ed3\u6784<\/strong><br \/>\n\u9996\u5148\uff0c\u9700\u8981\u53d8\u6362\u7684\u56fe\u6807\u4eec\u96b6\u5c5e\u540c\u4e00\u4e2aSVG\u5143\u7d20\uff0c\u4e5f\u5c31\u662f\u8fd1\u671f\u70ed\u95e8\u7684SVG sprites. \u4e0d\u8fc7\uff0c\u8fd9\u91cc\uff0c\u8c8c\u4f3c\u76ee\u524d\u53ea\u652f\u6301<code>&lt;g&gt;<\/code>\u5143\u7d20\uff0c\u6211\u8bd5\u4e86\u4e0b\uff0c<code>&lt;symbol&gt;<\/code>\u5143\u7d20\u4e0d\u652f\u6301\u3002\u9aa8\u67b6\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;<span class=\"pl-ent\">svg id=\"icon\"<\/span>&gt;\n  &lt;<span class=\"pl-ent\">g<\/span> <span class=\"pl-e\">id<\/span>=<span class=\"pl-s1\"><span class=\"pl-pds\">\"<\/span>icon1<span class=\"pl-pds\">\"<\/span><\/span>&gt;\n    \u56fe\u5f62\u76f8\u5173\u5143\u7d20\uff0cpath, circle, rect, ellipse, polygon, line\u7b49\n  &lt;\/<span class=\"pl-ent\">g<\/span>&gt;\n  &lt;<span class=\"pl-ent\">g<\/span> <span class=\"pl-e\">id<\/span>=<span class=\"pl-s1\"><span class=\"pl-pds\">\"<\/span>icon2<span class=\"pl-pds\">\"<\/span><\/span>&gt;\n    \u56fe\u5f62\u76f8\u5173\u5143\u7d20\uff0c\u540c\u4e0a\n  &lt;\/<span class=\"pl-ent\">g<\/span>&gt;\n&lt;\/<span class=\"pl-ent\">svg<\/span>&gt;<\/pre>\n<\/div>\n<p>\u6bcf\u7ec4<code>&lt;g&gt;<\/code>\u5143\u7d20\u90fd\u9700\u8981\u4e00\u4e2a\u552f\u4e00\u7684<code>id<\/code>, \u5e72\u561b\u7528\u7684\u5462\uff1f\u54c8\uff0c\u4e0b\u9762\u4f1a\u63d0\u5230\u3002<\/p>\n<p><strong>2. \u4e0b\u8f7dsvg-morpheus.js\u4ee5\u53ca&#8230;<\/strong><\/p>\n<ul>\n<li>\u53ef\u4ee5\u4eceGithub\u4e0b\u8f7d\uff1a<a href=\"https:\/\/github.com\/alexk111\/SVG-Morpheus\/archive\/master.zip\" target=\"_blank\">SVG Morpheus<\/a><\/li>\n<li>\u4e5f\u53ef\u4ee5\u4f7f\u7528Bower\u4e0b\u8f7d\uff1a\n<div class=\"zxx_code\">\n<pre>bower install svg-morpheus<\/pre>\n<\/div>\n<\/li>\n<\/ul>\n<p>\u5269\u4e0b\u7684\u4e8b\u60c5\u5c31\u7b80\u5355\u4e86\uff0c\u5f15\u5165\u8be5JS:<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;script src=\"svg-morpheus.js\">&lt;\/script><\/pre>\n<\/div>\n<p>\u5b9e\u4f8b\u5316\u4e00\u4e2aSVG\u5bf9\u8c61\uff0c\u5047\u8bbeSVG\u5143\u7d20\u7684<code>id<\/code>\u662f<code>icon<\/code>, \u5219 <\/p>\n<div class=\"zxx_code\">\n<pre>var myIcons = new SVGMorpheus('#icon');<\/pre>\n<\/div>\n<p>\u6216\u8005\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>var myIcons = new SVGMorpheus(document.getElementById(\"icon\"));<\/pre>\n<\/div>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u5b9e\u4f8b\u65b9\u6cd5\u7684\u53c2\u6570\u65e2\u53ef\u4ee5\u662f\u9009\u62e9\u5668\uff0c\u4e5f\u53ef\u4ee5\u662fDOM\u5143\u7d20\u3002<\/p>\n<p>\u6b64\u65f6\uff0c\u4f60\u60f3\u8981\u5f53\u524d\u56fe\u6807\u8865\u95f4\u52a8\u753b\u6210\u53e6\u5916\u4e00\u4e2a\u56fe\u6807\uff0c\u53ea\u8981\u7c7b\u4f3c\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>myIcons.to(icon-g-id);<\/pre>\n<\/div>\n<p><code>icon-g-id<\/code>\u5c31\u662f\u56fe\u6807\u5bf9\u5e94<code>&lt;g&gt;<\/code>\u5143\u7d20\u7684<code>id<\/code>\u503c\u5566\uff01<\/p>\n<p>\u7136\u540e\uff0c\u5c31\u6709\u56fe\u6807\u4e4b\u95f4\u7684\u8865\u95f4\u52a8\u753b\u6548\u679c\u5566\uff01<\/p>\n<p><strong>\u65b9\u6cd5\u548c\u53c2\u6570<\/strong><br \/>\n<strong>1. SVGMorpheus\u6784\u9020\u65b9\u6cd5<\/strong><\/p>\n<div class=\"zxx_code\">\n<pre>var myIcons = new SVGMorpheus(element, options, callback);<\/pre>\n<\/div>\n<p>\u5404\u4e2a\u53c2\u6570\u8868\u793a\u7684\u542b\u4e49\u662f\uff1a<\/p>\n<dl>\n<dt><strong>element<\/strong><\/dt>\n<dd>SVG\u5143\u7d20\uff0c\u53ef\u4ee5\u662f\u9009\u62e9\u5668\uff08\u5b57\u7b26\u4e32\uff09\u3001\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c31\u662fSVG\u5143\u7d20\u3001Object\u5143\u7d20\u6216IFrame\u5143\u7d20\uff08\u5bf9\u8c61\uff09\u3002<\/dd>\n<\/dl>\n<dl>\n<dt><strong>options<\/strong><\/dt>\n<dd>\u53ef\u9009\u53c2\u6570\u4eec\u3002\u5177\u4f53\u89c1\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>options.iconId<\/strong> &#8211; \u53ef\u9009\u3002\u8868\u793a\u521d\u59cb\u5316\u4e4b\u540e\uff0c\u9ed8\u8ba4\u663e\u793a\u7684\u56fe\u6807<code>id<\/code>, \u5982\u679c\u4e0d\u4f7f\u7528\u9ed8\u8ba4\u503c\uff0c\u5219\u4f7f\u7528\u6700\u540e\u4e00\u4e2a\u56fe\u6807\u3002<\/li>\n<li><strong>options.duration<\/strong> &#8211; \u53ef\u9009\u3002\u52a8\u753b\u6301\u7eed\u65f6\u95f4\uff0c\u5355\u4f4d\u662f\u6beb\u79d2\u3002\u9ed8\u8ba4\u662f<code>750ms<\/code>.<\/li>\n<li><strong>options.easing<\/strong> &#8211; \u53ef\u9009\u3002\u8bbe\u7f6e\u9ed8\u8ba4\u7f13\u52a8\u7c7b\u578b\uff08\u7f13\u52a8\u5173\u952e\u5b57\u540e\u9762\u6709\u9648\u5217\uff09\u3002\u9ed8\u8ba4\u662f\uff1a<code>quad-in-out<\/code>.<\/li>\n<li><strong>options.rotation<\/strong> &#8211; \u53ef\u9009\u3002\u8bbe\u7f6e\u52a8\u753b\u65cb\u8f6c\u65b9\u5411\uff0c\u987a\u65f6\u9488\u8fd8\u662f\u9006\u65f6\u9488\uff0c\u652f\u6301\u4e0b\u97624\u4e2a\u5173\u952e\u5b57<code>clock<\/code>, <code>counterclock<\/code>, <code>random<\/code>\u4ee5\u53ca<code>none<\/code>, \u5206\u522b\u8868\u793a\u987a\u65f6\u9488\uff0c\u9006\u65f6\u9488\uff0c\u968f\u673a\u65f6\u9488\u4ee5\u53ca\u6ca1\u6709\u65cb\u8f6c\u3002\u9ed8\u8ba4\u503c\u662f<code>clock<\/code>\u4e5f\u5c31\u662f\u987a\u65f6\u9488\u53d8\u65cb\u8f6c\u53d8\u8865\u95f4\u3002<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<dl>\n<dt><strong>callback<\/strong><\/dt>\n<dd>\u53ef\u9009\u3002\u8bbe\u7f6e\u6240\u6709\u56fe\u6807\u53d8\u6362\u52a8\u753b\u7ed3\u675f\u540e\u7684\u56de\u8c03\u3002<\/dd>\n<\/dl>\n<p><strong>2. SVGMorpheus.to()\u65b9\u6cd5<\/strong><\/p>\n<div class=\"zxx_code\">\n<pre>myIcons.to(iconId, options, callback);<\/pre>\n<\/div>\n<p>\u5404\u4e2a\u53c2\u6570\u8868\u793a\u7684\u542b\u4e49\u662f\uff1a<\/p>\n<dl>\n<dt><strong>iconId<\/strong><\/dt>\n<dd>\u8981\u53d8\u6362\u7684\u56fe\u6807\u7684<code>id<\/code>, \u5728<code>&lt;g&gt;<\/code>\u5143\u7d20\u4e0a\u3002<\/dd>\n<\/dl>\n<dl>\n<dt><strong>options<\/strong><\/dt>\n<dd>\u53ef\u9009\u53c2\u6570\u4eec\u3002\u5177\u4f53\u89c1\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>options.iconId<\/strong> &#8211; \u53ef\u9009\u3002\u8868\u793a\u521d\u59cb\u5316\u4e4b\u540e\uff0c\u9ed8\u8ba4\u663e\u793a\u7684\u56fe\u6807<code>id<\/code>, \u5982\u679c\u4e0d\u4f7f\u7528\u9ed8\u8ba4\u503c\uff0c\u5219\u4f7f\u7528\u6700\u540e\u4e00\u4e2a\u56fe\u6807\u3002<\/li>\n<li><strong>options.duration<\/strong> &#8211; \u53ef\u9009\u3002\u5f53\u524d\u52a8\u753b\u6301\u7eed\u65f6\u95f4\uff0c\u5355\u4f4d\u662f\u6beb\u79d2\u3002\u9ed8\u8ba4\u662f<code>750ms<\/code>.<\/li>\n<li><strong>options.easing<\/strong> &#8211; \u53ef\u9009\u3002\u8bbe\u7f6e\u5f53\u524d\u52a8\u753b\u7f13\u52a8\u7c7b\u578b\uff08\u7f13\u52a8\u5173\u952e\u5b57\u540e\u9762\u6709\u9648\u5217\uff09\u3002\u9ed8\u8ba4\u662f\uff1a<code>quad-in-out<\/code>.<\/li>\n<li><strong>options.rotation<\/strong> &#8211; \u53ef\u9009\u3002\u8bbe\u7f6e\u5f53\u524d\u52a8\u753b\u65cb\u8f6c\u65b9\u5411\uff0c\u987a\u65f6\u9488\u8fd8\u662f\u9006\u65f6\u9488\uff0c\u652f\u6301\u4e0b\u97624\u4e2a\u5173\u952e\u5b57<code>clock<\/code>, <code>counterclock<\/code>, <code>random<\/code>\u4ee5\u53ca<code>none<\/code>, \u5206\u522b\u8868\u793a\u987a\u65f6\u9488\uff0c\u9006\u65f6\u9488\uff0c\u968f\u673a\u65f6\u9488\u4ee5\u53ca\u6ca1\u6709\u65cb\u8f6c\u3002\u9ed8\u8ba4\u503c\u662f<code>clock<\/code>\u4e5f\u5c31\u662f\u987a\u65f6\u9488\u53d8\u65cb\u8f6c\u53d8\u8865\u95f4\u3002<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<dl>\n<dt><strong>callback<\/strong><\/dt>\n<dd>\u53ef\u9009\u3002\u8bbe\u7f6e\u5f53\u524d\u56fe\u6807\u53d8\u6362\u52a8\u753b\u7ed3\u675f\u540e\u7684\u56de\u8c03\u3002<\/dd>\n<\/dl>\n<p>\u4e0a\u9762\u63d0\u5230\u7684\u6240\u6709<strong>\u7f13\u52a8\u7c7b\u578b\u5173\u952e\u5b57<\/strong>\uff1a<\/p>\n<p><code>circ-in<\/code>, <code>circ-out<\/code>, <code>circ-in-out<\/code>, <code>cubic-in<\/code>, <code>cubic-out<\/code>, <code>cubic-in-out<\/code>, <code>elastic-in<\/code>, <code>elastic-out<\/code>, <code>elastic-in-out<\/code>, <code>expo-in<\/code>, <code>expo-out<\/code>, <code>expo-in-out<\/code>, <code>linear<\/code>, <code>quad-in<\/code>, <code>quad-out<\/code>, <code>quad-in-out<\/code>, <code>quart-in<\/code>, <code>quart-out<\/code>, <code>quart-in-out<\/code>, <code>quint-in<\/code>, <code>quint-out<\/code>, <code>quint-in-out<\/code>, <code>sine-in<\/code>, <code>sine-out<\/code>, <code>sine-in-out<\/code><\/p>\n<p>\u6bcf\u4e2a\u7f13\u52a8\u7684\u6548\u679c\uff0c\u53ef\u4ee5\u53bb\u9879\u76ee\u539f\u4ea7\u7684<a href=\"http:\/\/alexk111.github.io\/SVG-Morpheus\/\" target=\"_blank\">demo\u9875\u9762<\/a>\u89c2\u6469\u3002\u503c\u5f97\u4e00\u63d0\u7684\u662f<code>elastic<\/code>\u8fd9\u4e2a\u6548\u679c\uff0c\u4f1a\u8ba9\u5143\u7d20\u53d8\u6362\u65f6\u5019\u6296\u4e09\u6296\uff0c\u8ddf\u5176\u4ed6\u6548\u679c\u533a\u522b\u660e\u663e\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201412\/2014-12-14_004725.png\" width=\"397\" height=\"365\" alt=\"\u7f13\u52a8\u7c7b\u578b\u9009\u62e9\u793a\u610f\" class=\"alignnone\" \/><\/p>\n<p><strong>\u6d4f\u89c8\u5668\u517c\u5bb9\u6027<\/strong><br \/>\nIE10+, Chrome, Opera, FireFox, Safari, \u4ee5\u53caAndroid\u6d4f\u89c8\u56684.4+<\/p>\n<h3>\u4e09\u3001\u5b9e\u8df5\u51fa\u771f\u77e5<\/h3>\n<p>\u4ee5\u524d\u505aflash\u56fe\u5f62\u8865\u95f4\u52a8\u753b\u65f6\u5019\uff0c\u5982\u679c\u56fe\u5f62\u524d\u540e\u5dee\u5f02\u8f83\u5927\uff0c\u5219\u8865\u95f4\u7684\u52a8\u753b\u4f1a\u5f88\u602a\uff0c\u4e0d\u77e5\u5e73\u6ed1\u53d8\u5316\uff0c\u800c\u662f\u626d\u9ebb\u82b1\u4f3c\u7684\u53d8\u8fc7\u6765\u3002<\/p>\n<p>\u672c\u9879\u76eedemo\u9875\u9762\u7684\u56fe\u6807\u90fd\u662f2~3\u4e2a\u5143\u7d20\u7ed8\u5236\u7684\uff0c\u6240\u4ee5\uff0c\u6211\u4eec\u770b\u4e0a\u53bb\u597d\u50cf\u6548\u679c\u90fd\u4e0d\u9519\uff0c\u4f46\u662f\uff0c\u5982\u679cSVG\u56fe\u6807\u590d\u6742\u4f1a\u5982\u4f55\u5462\uff1f\u663e\u7136\uff0c\u6709\u5fc5\u8981\u81ea\u5df1\u4f7f\u7528\u5176\u4ed6\u4e00\u5957\u8d44\u6e90\u5b9e\u8df5\u4e00\u756a\u3002<\/p>\n<p>\u6b63\u597d\u5728Github\u4e0a\u770b\u5230\u4e00\u4e2a\u540d\u53eb<a href=\"https:\/\/github.com\/outpunk\/evil-icons\" target=\"_blank\">evil-icons\u7684\u9879\u76ee<\/a>\uff0c\u8c8c\u4f3c\u6b63\u597d\u63d0\u4f9b\u4e86\u4e00\u5957SVG\u56fe\u6807\uff0c\u4e8e\u662f\uff0c\u6211\u5c31\u987a\u624b\u7275\u7f8a\uff0c\u7ed3\u5408SVG-Morpheus\u5f04\u4e86\u4e2a\u5b9e\u8df5demo\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a class=\"a_link\" href=\"http:\/\/www.zhangxinxu.com\/study\/201412\/svg-icon-shape-transform.html\" target=\"_blank\">SVG-Morpheus\u5b9e\u73b0\u4e00\u4e2a\u56fe\u6807\u5230\u53e6\u4e00\u4e2a\u56fe\u6807\u8865\u95f4\u52a8\u753bdemo<\/a><\/p>\n<p>\u4e0b\u56fe\u4e3a\u7b2cN\u5468\u76ee\u67d0\u65f6\u523b\u6bb5\u7684\u8865\u95f4\u6548\u679c\u622a\u56fe(gif)\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201412\/2014-12-14_0_58_40_.gif\" width=\"55\" height=\"55\" alt=\"\u56fe\u6807demo\u5b9e\u8df5\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u7ecf\u8fc7\u5b9e\u8df5\u53d1\u73b0\uff0cSVG-Morpheus\u5728\u5b9e\u73b0\u56fe\u6807\u5143\u7d20\u6761\u76ee\u7c7b\u4f3c\uff0c\u98ce\u683c\u63a5\u8fd1\u7684\u56fe\u6807\u65f6\u5019\u6548\u679c\u8fd8\u662f\u4e0d\u9519\u7684\uff0c\u5728<del datetime=\"2014-12-14T09:20:12+00:00\">\u65f6\u95f4<\/del>\u5b9e\u73b0\u5927\u8272\u5757SVG\u56fe\u6807\u7684\u6548\u679c\u8981\u6bd4\u5b9e\u73b0\u7ebf\u6761SVG\u56fe\u6807\u6548\u679c\u597d\uff1b\u7ec6\u5fc3\u7684\u6211\u8fd8\u53d1\u73b0\uff0c2\u5468\u76ee\u65f6\u5019\u7684\u8865\u95f4\u52a8\u753b\u6548\u679c\u4f3c\u4e4e\u6ca1\u67091\u5468\u76ee\u65f6\u5019<del datetime=\"2014-12-14T09:20:12+00:00\">\u6d41\u7a0b<\/del>\u6d41\u7545\uff08\u56fe\u6807\u6bcf\u6539\u53d8\u4e00\u6b21\u989c\u8272\uff0c\u5219\u8868\u793a\u4e00\u5708\u52a8\u753b\u5df2\u7ecf\u7ed3\u675f\u4e86\uff09\u3002<\/p>\n<p>\u8003\u8651\u5230\uff0c\u6211\u4eec\u5b9e\u9645\u5f00\u53d1\u7684\u65f6\u5019\uff0c\u56fe\u7247\u4eceA\u72b6\u6001\u5230B\u72b6\u6001\uff0c\u98ce\u683c\u80af\u5b9a\u662f\u7c7b\u4f3c\u7684\uff0c\u7ed3\u6784\u3001\u8d1f\u8d23\u5ea6\u7b49\u5176\u5b9e\u4e5f\u662f\u8fd1\u4f3c\u7684\uff0c\u56e0\u6b64\uff0cSVG-Morpheus\u867d\u6709\u4e0d\u5b8c\u7f8e\u4e4b\u5904\uff0c\u4f46\u8fd8\u662f\u6709\u5f88\u5927\u7684\u4f7f\u7528\u4ef7\u503c\u7684\u3002<\/p>\n<p><strong>\u4e0d\u5b8c\u7f8e\u4e4b\u5904<\/strong><br \/>\n\u7531\u4e8e\u8981\u9002\u7528\u4e8e\u5904\u7406\u5404\u79cd\u56fe\u5f62\u53d8\u6362\uff0c\u6240\u4ee5\uff0cSVG-Morpheus\u6709\u4e2a\u7edf\u4e00\u7684\u53c2\u6570\u51fd\u6570\u8fd0\u52a8\u673a\u5236\uff0c\u7136\u540e\uff0c\u9020\u6210\u7684\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\uff0c\u6709\u4e9b\u770b\u4e0a\u53bb\u5e94\u8be5\u53ef\u4ee5\u66f4\u7b80\u5355\u5b9e\u73b0\u7684\u52a8\u753b\uff0c\u7ed3\u679c\u5374\u590d\u6742\u4e86\u3002\u4f8b\u5982\uff0c\u5de6\u7bad\u5934\u53d8\u6210\u4e0a\u7bad\u5934\uff0cSVG-Morpheus\u65e0\u6cd5\u667a\u80fd\u8fa8\u522b\u8fd9\u662f\u4e00\u4e2a\u65cb\u8f6c\uff0c\u5176\u53ea\u662f\u8def\u5f84\u70b9\u7684\u8fd0\u52a8\u7ed8\u5236\uff0c\u4e8e\u662f\uff0c\u5c31\u6709\u4e86\u626d\u9ebb\u82b1\u7684\u8865\u95f4\u6548\u679c\u3002<\/p>\n<p>\u518d\u4e3e\u4e2a\u66f4\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u6587\u7ae0\u4e00\u5f00\u59cb\u63d0\u5230\u7684\u4ece\u77e9\u5f62\u53d8\u6210\u5706\u7684\u4f8b\u5b50\uff0c\u5982\u679c\u662fSVG-Morpheus\u5b9e\u73b0\uff0c\u6700\u540e\u7684\u6548\u679c\u4f1a\u662f\u600e\u6837\u7684\u5462\uff1f<\/p>\n<p>\u5c31\u7b97\u524d\u540e\u56fe\u6807\u4ec5\u4ec5\u662f\u5706\u89d2\u5927\u5c0f\u7684\u5dee\u5f02\uff0c\u5982\u4e0b\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>&lt;g id=rect>&lt;rect x=0 y=0 width=50 height=50>&lt;\/rect>&lt;\/g>\n&lt;g id=rect2>&lt;rect x=0 y=0 width=50 height=50 rx=25 ry=25>&lt;\/rect>&lt;\/g><\/pre>\n<\/div>\n<p>\u7ed3\u679c\uff0c\u5e76\u4e0d\u662f\u5706\u89d2\u52a8\u753b\uff0c\u800c\u662f\uff0c\u5982\u4e0bgif:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201412\/2012-12-24_01-17.gif\" width=\"57\" height=\"57\" alt=\"\u626d\u9ebb\u82b1\u8865\u95f4\u52a8\u753b\u6548\u679c\" class=\"alignnone\" \/><\/p>\n<p>\u5982\u679c\u662f<code>rect<\/code> \u2192 <code>circle<\/code>\uff0c\u5219\u626d\u7684\u66f4\u5389\u5bb3\uff08\u56fe\u7565\uff09\uff0c\u8fd9\u79cd\u60c5\u51b5\uff0c<strong>\u6ce8\u610f\u5404\u4f4d\u4eb2<\/strong>\uff0c\u53ef\u4ee5\u4f7f\u7528<a href=\"http:\/\/www.zhangxinxu.com\/GitHub\/demo-Snap.svg\/demo\/basic\/Snap.animate.php\" target=\"_blank\">Snap.svg\u7684animate\u65b9\u6cd5<\/a>\uff0c\u4e00\u884c\u641e\u5b9a\u3002SVG-Morpheus\u66f4\u9002\u5408\u5904\u7406\u590d\u6742\u7684\u4e0d\u89c4\u5219\u7684<code>path<\/code>\u5143\u7d20\u95f4\u7684\u53d8\u6362\u6548\u679c\uff0c\u7b80\u5355\u7684\u5706\u89d2\u3001\u65cb\u8f6c\u4ee5\u53ca\u4f4d\u79fb\u5c31\u4ea4\u7ed9CSS3\u4ee5\u53ca\u5176\u4ed6SVG\u5904\u7406\u5e93\u3002<\/p>\n<h3>\u56db\u3001\u7ed3\u8bed<\/h3>\n<p>SVG-Morpheus\u5176\u5b9e\u4e0d\u4ec5\u4ec5\u53ef\u4ee5\u5e94\u7528\u5728\u56fe\u6807\u4e0a\uff0c\u6211\u4eec\u5728\u5b9e\u73b0\u4e00\u4e9b\u95ea\u5c4f\u52a8\u753b\uff0c\u4ee5\u53ca\u5176\u4ed6\u77e2\u91cf\u56fe\u5f62\u53d8\u6362\u65f6\u5019\uff0cSVG-Morpheus\u90fd\u662f\u7528\u7684\u3002<\/p>\n<p>\u6211\u4e5f\u662f\u521d\u4f53\u9a8c\uff0c\u56de\u5934\uff0c\u505a\u4e00\u4e9bPPT\u5206\u4eab\u65f6\u5019\uff08web\u7248\uff09\uff0c\u6211\u8bd5\u7740\u7528SVG-Morpheus\u505a\u4e00\u4e9b\u5c0f\u800c\u7f8e\u7684\u52a8\u753b\uff0c\u8fdb\u4e00\u6b65\u770b\u770b\u5176\u5b9e\u7528\u6027\u4ee5\u53ca\u4f18\u7f3a\u70b9\u3002<\/p>\n<p>\u672c\u6587\u8fb9\u6253\u76f9\u8fb9\u5199\u7684\uff0c\u9519\u5b57\u522b\u5b57\u4f30\u8ba1\u6709\u4e00\u7ba9\u7b50\uff0c\u6b22\u8fce\u7ea0\u9519\u3002\u5982\u679c\u6280\u672f\u70b9\u6709\u8868\u8ff0\u4e0d\u51c6\u786e\u7684\u5730\u65b9\uff0c\u6b22\u8fce\u6307\u6b63\uff0c\u6b22\u8fce\u4ea4\u6d41\uff01<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u4f1a\u7ecf\u5e38\u66f4\u65b0\u77e5\u8bc6\u70b9\u4ee5\u53ca\u4fee\u6b63\u4e00\u4e9b\u9519\u8bef\uff0c\u56e0\u6b64\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u539f\u51fa\u5904\uff0c\u65b9\u4fbf\u6eaf\u6e90\uff0c\u907f\u514d\u9648\u65e7\u9519\u8bef\u77e5\u8bc6\u7684\u8bef\u5bfc\uff0c\u540c\u65f6\u6709\u66f4\u597d\u7684\u9605\u8bfb\u4f53\u9a8c\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=4480\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=4480<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5b9e\u73b0\u77e2\u91cf\u56fe\u5f62\u4e4b\u95f4\u7684\u8fc7\u6e21\u52a8\u753b\u6548\u679c\u5462\uff1f\u53ef\u4e0d\u53ef\u4ee5\u50cf\u4ee5\u524d\u7684flash\u90a3\u6837\uff0c\u77e5\u9053\u524d\u540e\u56fe\u5f62\uff0c\u76f4\u63a5\u521b\u5efa\u4e2d\u95f4\u7684\u8865\u95f4\u52a8\u753b\u5462\uff1f\u6709\uff0c\u5f53\u5f53\u5f53\u5f53\uff0c\u5c31\u662f\u672c\u6587\u8981\u4ecb\u7ecd\u7684SVG-Morpheus! \u4e00\u5982\u65e2\u5f80\uff0c\u6709demo\u9875\u9762\u3001\u6709\u4e30\u5bcc\u7684\u622a\u56fe\uff0c\u6709\u5fc5\u8981\u7684\u6e90\u4ee3\u7801\u5c55\u793a\uff0c\u4e0d\u4ec5\u5982\u6b64\uff0c\u672c\u6587\u8fd8\u6709swf\u6548\u679c\u5c55\u793a\uff0c MP4\u89c6\u9891\u6548\u679c\u5c55\u793a\u4ee5\u53cagif\u622a\u56fe\u6548\u679c\u3002\u603b\u4e4b\uff0c\u5e0c\u671b\u672c\u6587\u7684\u5185\u5bb9\u80fd\u591f\u5bf9\u60a8\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[895],"tags":[929,958,722,917,957],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4480"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=4480"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/4480\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=4480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=4480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=4480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}