Skip to content

Instantly share code, notes, and snippets.

View daybrush's full-sized avatar
😀
HAHAHAHAHAHA

Daybrush (Younkue Choi) daybrush

😀
HAHAHAHAHAHA
View GitHub Profile
@daybrush
daybrush / keyframes.js
Last active June 2, 2019 07:46
keyframes with scene.js
new Scene({
".animte": {
0: {
left: "0%",
},
2: {
left: "50%",
},
4: {
left: "30%",
.animate {
animation-name: keyframes1;
animation-duration: 4;
animation-iteration-count: 3;
animation-timing-function: ease-in-out;
}
@keyframes keyframes1 {
0% {
left: 0%;
}
@daybrush
daybrush / rollup.config.js
Created October 19, 2018 08:51
multi entry
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: {
@daybrush
daybrush / rollup.js
Created October 18, 2018 09:52
use rollup to merge modules.
var TRANSFORM = "trasnform";
var ANIMATION = "animation";
var DIRECTION_LEFT = 1;
var ALTERNATE_REVERSE = "alternate-reverse";
TRASNFORM;
ANIMATION;
DIRECTION_LEFT;
ALTERNATE_REVERSE;
@daybrush
daybrush / rollup.config.js
Last active October 18, 2018 10:06
rollup.config.js
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,
@daybrush
daybrush / rollup.csv
Last active October 29, 2018 05:54
Table in Medium
\ component.js axes.js flicking.js
Before 3.28kb 56.2kb 80.3kb
After 1.98kb 40.53kb 57kb
Improvement rate(%) 40% 28% 29%
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"))
import t from "@babel/types";
left.object = t.identifier("__proto");
@daybrush
daybrush / traverse.js
Last active October 7, 2018 13:20
traverse
import traverse from "@babel/traverse";
traverse(ast, {
FunctionDeclaration: function (path) {
// path.node (FunctionDeclaration)
// path.node.id (Identifier)
console.log(path.node.id.name);
},
});
@daybrush
daybrush / prototypeminify.js
Last active October 7, 2018 13:07
prototypeminify.js
var Item = /*#__PURE__*/ function () {
function Item() {}
var __proto = Item.prototype;
__proto.a = function () {}
__proto.b = function () {}
__proto.c = function () {}
return Item;
}();