From 41f44607c9c7b6babeea78a6df0a7b41c15069e4 Mon Sep 17 00:00:00 2001 From: dalisoft Date: Sat, 19 Mar 2016 22:10:30 +0500 Subject: [PATCH 1/2] Create kute-html.js --- kute-html.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 kute-html.js diff --git a/kute-html.js b/kute-html.js new file mode 100644 index 0000000..f891d2d --- /dev/null +++ b/kute-html.js @@ -0,0 +1,30 @@ +/* KUTE.js - The Light Tweening Engine + * package - HTML Plugin + * desc - makes tween object with HTML + * by @dalisoft (https://github.com/dalisoft) + * Licensed under MIT-License + */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(["./kute.js"], function(KUTE){ factory(KUTE); return KUTE; }); + } else if(typeof module == "object" && typeof require == "function") { + // We assume, that require() is sync. + var KUTE = require("./kute.js"); + // Export the modified one. Not really required, but convenient. + module.exports = factory(KUTE); + } else if ( typeof window.KUTE !== 'undefined' ) { + // Browser globals + factory(KUTE); + } else { + throw new Error("HTML Plugin require KUTE.js."); + } +}( function (KUTE) { + 'use strict'; + // performance-ready simple & lightweight HTML plug-in for KUTE.js + var kute = [].slice.call(document.querySelectorAll('[kute]')); + kute.map(function(k){ + var type = k.getAttribute("kute"), prop = (new Function("return {" + k.getAttribute("kute-props") + "}")()), opt = (new Function("return {" + k.getAttribute("kute-options") + "}")()) + KUTE[type](/all/.test(type) ? (k.getAttribute("class") || "").split(" ")[0] || k.tagName : k, type === "fromTo" ? prop.from : prop, type === "fromTo" ? prop.to : opt, type === "fromTo" && opt).start(); + }); +})); From b3daedbfaf4d1f1787d9340c573f228921cb1612 Mon Sep 17 00:00:00 2001 From: dalisoft Date: Sat, 19 Mar 2016 22:13:39 +0500 Subject: [PATCH 2/2] Update kute-html.js --- kute-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kute-html.js b/kute-html.js index f891d2d..853c968 100644 --- a/kute-html.js +++ b/kute-html.js @@ -15,7 +15,7 @@ module.exports = factory(KUTE); } else if ( typeof window.KUTE !== 'undefined' ) { // Browser globals - factory(KUTE); + factory(window.KUTE); } else { throw new Error("HTML Plugin require KUTE.js."); }