Changes:
* KUTE.js now works when added to `<head>` but tween object initialization scripting must be added after `<body>` or when new `Element` target is appended into document * updated `shorter-js`
This commit is contained in:
parent
64ac54a4d0
commit
65a56cd338
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* KUTE.js Base v2.0.11 (http://thednp.github.io/kute.js)
|
* KUTE.js Base v2.0.12 (http://thednp.github.io/kute.js)
|
||||||
* Copyright 2015-2020 © thednp
|
* Copyright 2015-2020 © thednp
|
||||||
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
(global = global || self, global.KUTE = factory());
|
(global = global || self, global.KUTE = factory());
|
||||||
}(this, (function () { 'use strict';
|
}(this, (function () { 'use strict';
|
||||||
|
|
||||||
var version = "2.0.11";
|
var version = "2.0.12";
|
||||||
|
|
||||||
var KUTE = {};
|
var KUTE = {};
|
||||||
|
|
||||||
|
|
4
demo/src/kute-base.min.js
vendored
4
demo/src/kute-base.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* KUTE.js Extra v2.0.11 (http://thednp.github.io/kute.js)
|
* KUTE.js Extra v2.0.12 (http://thednp.github.io/kute.js)
|
||||||
* Copyright 2015-2020 © thednp
|
* Copyright 2015-2020 © thednp
|
||||||
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
(global = global || self, global.KUTE = factory());
|
(global = global || self, global.KUTE = factory());
|
||||||
}(this, (function () { 'use strict';
|
}(this, (function () { 'use strict';
|
||||||
|
|
||||||
var version = "2.0.11";
|
var version = "2.0.12";
|
||||||
|
|
||||||
var KUTE = {};
|
var KUTE = {};
|
||||||
|
|
||||||
|
@ -1116,8 +1116,8 @@
|
||||||
|
|
||||||
function trueColor (colorString) {
|
function trueColor (colorString) {
|
||||||
if (/rgb|rgba/.test(colorString)) {
|
if (/rgb|rgba/.test(colorString)) {
|
||||||
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
|
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
|
||||||
var colorAlpha = vrgb[3] ? vrgb[3] : null;
|
colorAlpha = vrgb[3] ? vrgb[3] : null;
|
||||||
if (!colorAlpha) {
|
if (!colorAlpha) {
|
||||||
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
||||||
} else {
|
} else {
|
||||||
|
|
4
demo/src/kute-extra.min.js
vendored
4
demo/src/kute-extra.min.js
vendored
File diff suppressed because one or more lines are too long
4
demo/src/kute.min.js
vendored
4
demo/src/kute.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/kute.esm.js
vendored
8
dist/kute.esm.js
vendored
|
@ -1,9 +1,9 @@
|
||||||
/*!
|
/*!
|
||||||
* KUTE.js Standard v2.0.11 (http://thednp.github.io/kute.js)
|
* KUTE.js Standard v2.0.12 (http://thednp.github.io/kute.js)
|
||||||
* Copyright 2015-2020 © thednp
|
* Copyright 2015-2020 © thednp
|
||||||
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
var version = "2.0.11";
|
var version = "2.0.12";
|
||||||
|
|
||||||
var KUTE = {};
|
var KUTE = {};
|
||||||
|
|
||||||
|
@ -820,8 +820,8 @@ function hexToRGB (hex) {
|
||||||
|
|
||||||
function trueColor (colorString) {
|
function trueColor (colorString) {
|
||||||
if (/rgb|rgba/.test(colorString)) {
|
if (/rgb|rgba/.test(colorString)) {
|
||||||
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
|
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
|
||||||
var colorAlpha = vrgb[3] ? vrgb[3] : null;
|
colorAlpha = vrgb[3] ? vrgb[3] : null;
|
||||||
if (!colorAlpha) {
|
if (!colorAlpha) {
|
||||||
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
||||||
} else {
|
} else {
|
||||||
|
|
4
dist/kute.esm.min.js
vendored
4
dist/kute.esm.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/kute.js
vendored
8
dist/kute.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* KUTE.js Standard v2.0.11 (http://thednp.github.io/kute.js)
|
* KUTE.js Standard v2.0.12 (http://thednp.github.io/kute.js)
|
||||||
* Copyright 2015-2020 © thednp
|
* Copyright 2015-2020 © thednp
|
||||||
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
(global = global || self, global.KUTE = factory());
|
(global = global || self, global.KUTE = factory());
|
||||||
}(this, (function () { 'use strict';
|
}(this, (function () { 'use strict';
|
||||||
|
|
||||||
var version = "2.0.11";
|
var version = "2.0.12";
|
||||||
|
|
||||||
var KUTE = {};
|
var KUTE = {};
|
||||||
|
|
||||||
|
@ -826,8 +826,8 @@
|
||||||
|
|
||||||
function trueColor (colorString) {
|
function trueColor (colorString) {
|
||||||
if (/rgb|rgba/.test(colorString)) {
|
if (/rgb|rgba/.test(colorString)) {
|
||||||
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
|
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
|
||||||
var colorAlpha = vrgb[3] ? vrgb[3] : null;
|
colorAlpha = vrgb[3] ? vrgb[3] : null;
|
||||||
if (!colorAlpha) {
|
if (!colorAlpha) {
|
||||||
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
||||||
} else {
|
} else {
|
||||||
|
|
4
dist/kute.min.js
vendored
4
dist/kute.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "kute.js",
|
"name": "kute.js",
|
||||||
"version": "2.0.11",
|
"version": "2.0.12",
|
||||||
"description": "JavaScript animation engine of the future is called KUTE.js.",
|
"description": "JavaScript animation engine of the future is called KUTE.js.",
|
||||||
"main": "dist/kute.min.js",
|
"main": "dist/kute.min.js",
|
||||||
"module": "dist/kute.esm.js",
|
"module": "dist/kute.esm.js",
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cubic-bezier-easing": "^1.0.2",
|
"cubic-bezier-easing": "^1.0.2",
|
||||||
"minifill": "^0.0.13",
|
"minifill": "^0.0.13",
|
||||||
"shorter-js": "^0.1.0"
|
"shorter-js": "^0.1.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-buble": "^0.21.3",
|
"@rollup/plugin-buble": "^0.21.3",
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
import transformProperty from './transformProperty.js'
|
import transformProperty from './transformProperty.js'
|
||||||
export default transformProperty in document.body.style
|
export default transformProperty in document.head.style
|
|
@ -3,20 +3,19 @@ import hexToRGB from './hexToRGB.js'
|
||||||
// trueColor - replace transparent and transform any color to rgba()/rgb()
|
// trueColor - replace transparent and transform any color to rgba()/rgb()
|
||||||
export default function (colorString) {
|
export default function (colorString) {
|
||||||
if (/rgb|rgba/.test(colorString)) { // first check if it's a rgb string
|
if (/rgb|rgba/.test(colorString)) { // first check if it's a rgb string
|
||||||
const vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
|
let vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
|
||||||
|
colorAlpha = vrgb[3] ? vrgb[3] : null;
|
||||||
const colorAlpha = vrgb[3] ? vrgb[3] : null;
|
|
||||||
if (!colorAlpha) {
|
if (!colorAlpha) {
|
||||||
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
|
||||||
} else {
|
} else {
|
||||||
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]), a: parseFloat(colorAlpha) };
|
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]), a: parseFloat(colorAlpha) };
|
||||||
}
|
}
|
||||||
} else if (/^#/.test(colorString)) {
|
} else if (/^#/.test(colorString)) {
|
||||||
const fromHex = hexToRGB(colorString); return { r: fromHex.r, g: fromHex.g, b: fromHex.b };
|
let fromHex = hexToRGB(colorString); return { r: fromHex.r, g: fromHex.g, b: fromHex.b };
|
||||||
} else if (/transparent|none|initial|inherit/.test(colorString)) {
|
} else if (/transparent|none|initial|inherit/.test(colorString)) {
|
||||||
return { r: 0, g: 0, b: 0, a: 0 };
|
return { r: 0, g: 0, b: 0, a: 0 };
|
||||||
} else if (!/^#|^rgb/.test(colorString) ) { // maybe we can check for web safe colors
|
} else if (!/^#|^rgb/.test(colorString) ) { // maybe we can check for web safe colors
|
||||||
const siteHead = document.getElementsByTagName('head')[0]; siteHead.style.color = colorString;
|
let siteHead = document.getElementsByTagName('head')[0]; siteHead.style.color = colorString;
|
||||||
let webColor = getComputedStyle(siteHead,null).color; webColor = /rgb/.test(webColor) ? webColor.replace(/[^\d,]/g, '').split(',') : [0,0,0];
|
let webColor = getComputedStyle(siteHead,null).color; webColor = /rgb/.test(webColor) ? webColor.replace(/[^\d,]/g, '').split(',') : [0,0,0];
|
||||||
siteHead.style.color = ''; return { r: parseInt(webColor[0]), g: parseInt(webColor[1]), b: parseInt(webColor[2]) };
|
siteHead.style.color = ''; return { r: parseInt(webColor[0]), g: parseInt(webColor[1]), b: parseInt(webColor[2]) };
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import getPrefix from './getPrefix.js'
|
||||||
|
|
||||||
// trueProperty - returns prefixed property | property
|
// trueProperty - returns prefixed property | property
|
||||||
export default function(property) {
|
export default function(property) {
|
||||||
return !(property in document.body.style)
|
return !(property in document.head.style)
|
||||||
? getPrefix() + (property.charAt(0).toUpperCase() + property.slice(1))
|
? getPrefix() + (property.charAt(0).toUpperCase() + property.slice(1))
|
||||||
: property;
|
: property;
|
||||||
}
|
}
|
Loading…
Reference in a new issue