This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Scene({ | |
| ".animte": { | |
| 0: { | |
| left: "0%", | |
| }, | |
| 2: { | |
| left: "50%", | |
| }, | |
| 4: { | |
| left: "30%", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .animate { | |
| animation-name: keyframes1; | |
| animation-duration: 4; | |
| animation-iteration-count: 3; | |
| animation-timing-function: ease-in-out; | |
| } | |
| @keyframes keyframes1 { | |
| 0% { | |
| left: 0%; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import babel from "rollup-plugin-babel"; | |
| import typescript from "rollup-plugin-typescript"; | |
| import uglify from "rollup-plugin-uglify"; | |
| import minify from "rollup-plugin-prototype-minify"; | |
| export default [ | |
| { | |
| input: 'src/index.ts', | |
| plugins: [babel()], // or typescript() | |
| output: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var TRANSFORM = "trasnform"; | |
| var ANIMATION = "animation"; | |
| var DIRECTION_LEFT = 1; | |
| var ALTERNATE_REVERSE = "alternate-reverse"; | |
| TRASNFORM; | |
| ANIMATION; | |
| DIRECTION_LEFT; | |
| ALTERNATE_REVERSE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import babel from "rollup-plugin-babel"; | |
| import typescript from "rollup-plugin-typescript"; | |
| import uglify from "rollup-plugin-uglify"; | |
| import minify from "rollup-plugin-prototype-minify"; | |
| export default { | |
| input: 'src/index.ts', | |
| plugins: [babel()], // or typescript() | |
| output: { | |
| banner, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \ | component.js | axes.js | flicking.js | |
|---|---|---|---|---|
| Before | 3.28kb | 56.2kb | 80.3kb | |
| After | 1.98kb | 40.53kb | 57kb | |
| Improvement rate(%) | 40% | 28% | 29% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import traverse from "@babel/traverse"; | |
| import t from "@babel/types"; | |
| traverse(ast, { | |
| FunctionDeclaration: function (path) { | |
| // path.node(FunctionDeclaration) | |
| path.insertAfter(t.variableDeclaration("var", [ | |
| t.variableDeclarator( | |
| t.identifier("__proto"), | |
| t.memberExpression(t.identifier("Item"), t.identifier("prototype")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import t from "@babel/types"; | |
| left.object = t.identifier("__proto"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import traverse from "@babel/traverse"; | |
| traverse(ast, { | |
| FunctionDeclaration: function (path) { | |
| // path.node (FunctionDeclaration) | |
| // path.node.id (Identifier) | |
| console.log(path.node.id.name); | |
| }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Item = /*#__PURE__*/ function () { | |
| function Item() {} | |
| var __proto = Item.prototype; | |
| __proto.a = function () {} | |
| __proto.b = function () {} | |
| __proto.c = function () {} | |
| return Item; | |
| }(); |