{"id":1385,"date":"2019-09-25T22:26:17","date_gmt":"2019-09-25T14:26:17","guid":{"rendered":"https:\/\/www.develop-note.com\/blog\/?p=1385"},"modified":"2022-02-17T15:07:31","modified_gmt":"2022-02-17T07:07:31","slug":"2020ironman-svelte-transitions","status":"publish","type":"post","link":"https:\/\/www.develop-note.com\/blog\/2019\/09\/25\/2020ironman-svelte-transitions\/","title":{"rendered":"\u7b2c\u5341\u4e00\u5c46\u9435\u4eba\u8cfd \u524d\u7aef\u5de5\u7a0b\u5e2b\u7684\u53e6\u4e00\u500b\u9078\u64c7 svelte DAY24- \u904e\u5834\u52d5\u756b"},"content":{"rendered":"<h1>Transitions \u904e\u5834\u52d5\u756b<\/h1>\n<p>Transitions \u662f\u4eca\u5929\u8981\u5206\u4eab\u7684\u4e3b\u984c\uff0c\u76f8\u4fe1\u4e0d\u7ba1\u5728\u54ea\u88e1\u90fd\u5f88\u5e38\u770b\u5230\u4ed6\uff0c\u56e0\u70ba\u6709\u4ed6\u756b\u9762\u5448\u73fe\u624d\u4e0d\u6703\u90a3\u9ebc\u786c\u6886\u6886\u7684\uff0c\u7576\u7136 svelte \u6709\u5167\u5efa\u81ea\u5df1\u7684\u904e\u5834\u52d5\u756b\uff0c\u4eca\u5929\u5c31\u4f86\u4ecb\u7d39\u4e00\u4e0b\u3002<!--more--><\/p>\n<h2>Transitions \u751a\u9ebc\u662f\u904e\u5834\u52d5\u756b<\/h2>\n<p>\u76f8\u4fe1\u5927\u5bb6\u90fd\u5f88\u719f\u6089 Power Point \uff0c\u4e5f\u77e5\u9053\u5982\u679c\u55ae\u7d14\u7684\u63db\u9801\u6703\u8b93\u770b\u6295\u5f71\u7247\u7684\u4eba\u89ba\u5f97\u55ae\u8abf\u4e4f\u5473\uff0c\u751a\u81f3\u65bc\u7121\u6cd5\u5438\u6536\u5230\u8b1b\u8005\u60f3\u8981\u5206\u4eab\u7684\u5167\u5bb9\uff0c\u6240\u4ee5\u5728 Power Point \u5728\u63db\u9801\u6642\u6703\u6709\u4e9b\u52d5\u756b\u5448\u73fe\u65b9\u5f0f\uff0c\u8b93\u807d\u773e\u4e0d\u6703\u611f\u89ba\u5230\u6295\u5f71\u7247\u592a\u6b7b\u677f\u3002\u7576\u7136\u7db2\u9801\u4e5f\u662f\u4e00\u6a23\u7684\uff0c\u5982\u679c\u592a\u55ae\u8abf\u6703\u8b93\u700f\u89bd\u7684\u89c0\u773e\u89ba\u5f97\u592a\u67af\u71e5\u4e4f\u5473\uff0c\u6240\u4ee5 svelte \u624d\u6703\u6709\u5167\u5efa\u4eca\u5929\u8981\u8ddf\u5927\u5bb6\u5206\u4eab\u7684 Transitions \u904e\u5834\u52d5\u756b\u3002<\/p>\n<h2>Transitions \u7684\u7a2e\u985e<\/h2>\n<p>\u9019\u90e8\u5206\u5927\u5bb6\u53ef\u4ee5\u53c3\u8003\u5b98\u7db2\u7684<a href=\"https:\/\/svelte.dev\/docs#svelte_transition\" title=\"Transitions API \u6587\u4ef6\" rel=\"nofollow noopener\" target=\"_blank\">Transitions API \u6587\u4ef6<\/a>\uff0c\u9019\u90e8\u5206\u5148\u8ddf\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u5b83\u7684\u7a2e\u985e\u6709\u4ee5\u4e0b\u516d\u7a2e\u3002<\/p>\n<ul>\n<li>fade<\/li>\n<li>fly<\/li>\n<li>slide<\/li>\n<li>scale<\/li>\n<li>draw <\/li>\n<li>crossfade<\/li>\n<\/ul>\n<h2>Transitions \u7684\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<p>\u5728\u4ecb\u7d39\u5b8c Transitions \u7684\u7a2e\u985e\u5f8c\u5927\u5bb6\u6bd4\u8f03\u6709\u8208\u8da3\u7684\u662f\u9019\u904e\u5834\u52d5\u756b\u600e\u9ebc\u7528\uff0c\u4eca\u5929\u5148\u8ddf\u5927\u5bb6\u5206\u4eab\u4e00\u4e9b\u7c21\u55ae\u7684\u904e\u5834\u52d5\u756b\u7684\u4f7f\u7528\u65b9\u5f0f\uff0c\u4eca\u5929\u6703\u8ddf\u5927\u5bb6\u5206\u4eab\u7684\u662f <code>fade<\/code> \u6de1\u5165\u6de1\u51fa\u8ddf <code>fly<\/code> \u98db\u5165\u98db\u51fa\u3002\u6240\u4ee5\u5148\u8acb\u5927\u5bb6\u770b\u4e00\u4e0b\u4e0b\u5217\u7684\u7a0b\u5f0f\u78bc\u3002<\/p>\n<pre><code class=\"language-xml\">&lt;script&gt;\n    import { fade } from &#039;svelte\/transition&#039;;\n    let visible = true;\n&lt;\/script&gt;\n\n&lt;label&gt;\n    &lt;input type=&quot;checkbox&quot; bind:checked={visible}&gt;\n    visible\n&lt;\/label&gt;\n\n{#if visible}\n    &lt;p transition:fade&gt;\n        Fades in and out\n    &lt;\/p&gt;\n{\/if}<\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u4f8b\u5b50\u662f\u8ddf\u5927\u5bb6\u5206\u4eab\u5982\u4f55\u8b93html\u7684\u5143\u4ef6\u6de1\u5165\u6de1\u51fa\u7684\u5448\u73fe\uff0c\u7c21\u55ae\u8aaa\u660e\u4e00\u4e0b\u5c31\u662f\u5148\u5f9e svelte\/transition import fade \u9032\u4f86\uff0c\u63a5\u4e0b\u4f86\u5728html\u4e0a\u52a0\u4e0a <code>transition:fade<\/code> \u5373\u53ef\uff0c\u4f46\u662f\u4e00\u5b9a\u8981\u5728\u9019\u4e4b\u524d\u52a0\u5165\u986f\u793a\u7684\u689d\u4ef6\uff0c\u5982\u6b64\u5728\u986f\u793a\u6642\u6703\u6de1\u5165\uff0c\u4e0d\u986f\u793a\u6642\u6703\u6de1\u51fa\u3002\u63a5\u4e0b\u4f86\u5927\u5bb6\u518d\u770b\u770b\u4e0b\u5217\u7684\u7a0b\u5f0f\u78bc\u3002<\/p>\n<pre><code class=\"language-html\">&lt;script&gt;\n    import { fly } from &#039;svelte\/transition&#039;;\n    let visible = true;\n&lt;\/script&gt;\n\n&lt;label&gt;\n    &lt;input type=&quot;checkbox&quot; bind:checked={visible}&gt;\n    visible\n&lt;\/label&gt;\n\n{#if visible}\n    &lt;p transition:fly=&quot;{{ y: 200, duration: 2000 }}&quot;&gt;\n        Fades in and out\n    &lt;\/p&gt;\n{\/if}<\/code><\/pre>\n<p>\u63a5\u627f <code>fade<\/code> \u7684\u4f8b\u5b50\u6211\u5011\u5728\u6539\u5beb\u6210 <code>fly<\/code> \u7684\u4f8b\u5b50\uff0c\u7c21\u55ae\u8aaa\u660e\u4e00\u4e0b\u5c31\u662f\u7576\u5143\u4ef6\u6d88\u5931\u7684\u6642\u5019\u6703\u8dd1\u5230\u6307\u5b9a\u7684\u4f4d\u7f6e\u6de1\u51fa\uff0c\u9019\u90e8\u5206\u8ddf\u5927\u5bb6\u5206\u4eab\u7684\u662f\u904e\u5834\u52d5\u756b\u5f8c\u53ef\u4ee5\u63a5\u8457\u8981\u5982\u4f55\u5448\u73fe\u7684\u8b8a\u6578\uff0c\u4ee5\u4e0a\u9762\u7684\u4f8b\u5b50\u5c31\u662f\u8017\u66422000\u6beb\u79d2\u79fb\u52d5\u5230y=200\u7684\u4f4d\u7f6e\u5f8c\u6de1\u51fa\u3002<\/p>\n<h2>\u5c0f\u7d50<\/h2>\n<p>\u4eca\u5929\u5148\u8ddf\u5927\u5bb6\u521d\u6b65\u7684\u4ecb\u7d39 Transitions \u904e\u5834\u52d5\u756b\uff0c\u4e26\u4e14\u5206\u4eab\u4e86\u5169\u500b\u904e\u5834\u52d5\u756b\u7684\u7a2e\u985e <code>fade<\/code> \u8ddf <code>fly<\/code> \uff0c\u9084\u6709\u7528\u5be6\u969b\u7684\u4f8b\u5b50\u544a\u8a34\u5927\u5bb6\u4ed6\u662f\u751a\u9ebc\u4ee5\u53ca\u8a72\u5982\u4f55\u4f7f\u7528\uff0c\u5e0c\u671b\u5927\u5bb6\u6703\u559c\u6b61\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Transitions \u904e\u5834\u52d5\u756b Transitions \u662f\u4eca\u5929\u8981\u5206\u4eab\u7684\u4e3b\u984c\uff0c\u76f8\u4fe1\u4e0d\u7ba1\u5728\u54ea\u88e1\u90fd\u5f88\u5e38\u770b\u5230\u4ed6\uff0c\u56e0\u70ba &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.develop-note.com\/blog\/2019\/09\/25\/2020ironman-svelte-transitions\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u7b2c\u5341\u4e00\u5c46\u9435\u4eba\u8cfd \u524d\u7aef\u5de5\u7a0b\u5e2b\u7684\u53e6\u4e00\u500b\u9078\u64c7 svelte DAY24- \u904e\u5834\u52d5\u756b\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[160,79],"class_list":["post-1385","post","type-post","status-publish","format-standard","hentry","category-develop","tag-2019ironman","tag-svelte"],"_links":{"self":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/comments?post=1385"}],"version-history":[{"count":6,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1385\/revisions"}],"predecessor-version":[{"id":3002,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/posts\/1385\/revisions\/3002"}],"wp:attachment":[{"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/media?parent=1385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/categories?post=1385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.develop-note.com\/blog\/wp-json\/wp\/v2\/tags?post=1385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}