Skip to content

Commit 65a56cd

Browse files
committedJul 27, 2020
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`
1 parent 64ac54a commit 65a56cd

13 files changed

+32
-33
lines changed
 

‎demo/src/kute-base.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* KUTE.js Base v2.0.11 (http://thednp.github.io/kute.js)
2+
* KUTE.js Base v2.0.12 (http://thednp.github.io/kute.js)
33
* Copyright 2015-2020 © thednp
44
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
55
*/
@@ -9,7 +9,7 @@
99
(global = global || self, global.KUTE = factory());
1010
}(this, (function () { 'use strict';
1111

12-
var version = "2.0.11";
12+
var version = "2.0.12";
1313

1414
var KUTE = {};
1515

‎demo/src/kute-base.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎demo/src/kute-extra.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* KUTE.js Extra v2.0.11 (http://thednp.github.io/kute.js)
2+
* KUTE.js Extra v2.0.12 (http://thednp.github.io/kute.js)
33
* Copyright 2015-2020 © thednp
44
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
55
*/
@@ -9,7 +9,7 @@
99
(global = global || self, global.KUTE = factory());
1010
}(this, (function () { 'use strict';
1111

12-
var version = "2.0.11";
12+
var version = "2.0.12";
1313

1414
var KUTE = {};
1515

@@ -1116,8 +1116,8 @@
11161116

11171117
function trueColor (colorString) {
11181118
if (/rgb|rgba/.test(colorString)) {
1119-
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
1120-
var colorAlpha = vrgb[3] ? vrgb[3] : null;
1119+
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
1120+
colorAlpha = vrgb[3] ? vrgb[3] : null;
11211121
if (!colorAlpha) {
11221122
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
11231123
} else {

‎demo/src/kute-extra.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎demo/src/kute.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/kute.esm.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*!
2-
* KUTE.js Standard v2.0.11 (http://thednp.github.io/kute.js)
2+
* KUTE.js Standard v2.0.12 (http://thednp.github.io/kute.js)
33
* Copyright 2015-2020 © thednp
44
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
55
*/
6-
var version = "2.0.11";
6+
var version = "2.0.12";
77

88
var KUTE = {};
99

@@ -820,8 +820,8 @@ function hexToRGB (hex) {
820820

821821
function trueColor (colorString) {
822822
if (/rgb|rgba/.test(colorString)) {
823-
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
824-
var colorAlpha = vrgb[3] ? vrgb[3] : null;
823+
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
824+
colorAlpha = vrgb[3] ? vrgb[3] : null;
825825
if (!colorAlpha) {
826826
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
827827
} else {

‎dist/kute.esm.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/kute.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* KUTE.js Standard v2.0.11 (http://thednp.github.io/kute.js)
2+
* KUTE.js Standard v2.0.12 (http://thednp.github.io/kute.js)
33
* Copyright 2015-2020 © thednp
44
* Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE)
55
*/
@@ -9,7 +9,7 @@
99
(global = global || self, global.KUTE = factory());
1010
}(this, (function () { 'use strict';
1111

12-
var version = "2.0.11";
12+
var version = "2.0.12";
1313

1414
var KUTE = {};
1515

@@ -826,8 +826,8 @@
826826

827827
function trueColor (colorString) {
828828
if (/rgb|rgba/.test(colorString)) {
829-
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
830-
var colorAlpha = vrgb[3] ? vrgb[3] : null;
829+
var vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
830+
colorAlpha = vrgb[3] ? vrgb[3] : null;
831831
if (!colorAlpha) {
832832
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
833833
} else {

‎dist/kute.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kute.js",
3-
"version": "2.0.11",
3+
"version": "2.0.12",
44
"description": "JavaScript animation engine of the future is called KUTE.js.",
55
"main": "dist/kute.min.js",
66
"module": "dist/kute.esm.js",
@@ -56,7 +56,7 @@
5656
"dependencies": {
5757
"cubic-bezier-easing": "^1.0.2",
5858
"minifill": "^0.0.13",
59-
"shorter-js": "^0.1.0"
59+
"shorter-js": "^0.1.4"
6060
},
6161
"devDependencies": {
6262
"@rollup/plugin-buble": "^0.21.3",

‎src/util/supportLegacyTransform.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import transformProperty from './transformProperty.js'
2-
export default transformProperty in document.body.style
2+
export default transformProperty in document.head.style

‎src/util/trueColor.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ import hexToRGB from './hexToRGB.js'
33
// trueColor - replace transparent and transform any color to rgba()/rgb()
44
export default function (colorString) {
55
if (/rgb|rgba/.test(colorString)) { // first check if it's a rgb string
6-
const vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(',');
7-
8-
const colorAlpha = vrgb[3] ? vrgb[3] : null;
6+
let vrgb = colorString.replace(/\s|\)/,'').split('(')[1].split(','),
7+
colorAlpha = vrgb[3] ? vrgb[3] : null;
98
if (!colorAlpha) {
109
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]) };
1110
} else {
1211
return { r: parseInt(vrgb[0]), g: parseInt(vrgb[1]), b: parseInt(vrgb[2]), a: parseFloat(colorAlpha) };
1312
}
1413
} else if (/^#/.test(colorString)) {
15-
const fromHex = hexToRGB(colorString); return { r: fromHex.r, g: fromHex.g, b: fromHex.b };
14+
let fromHex = hexToRGB(colorString); return { r: fromHex.r, g: fromHex.g, b: fromHex.b };
1615
} else if (/transparent|none|initial|inherit/.test(colorString)) {
1716
return { r: 0, g: 0, b: 0, a: 0 };
1817
} else if (!/^#|^rgb/.test(colorString) ) { // maybe we can check for web safe colors
19-
const siteHead = document.getElementsByTagName('head')[0]; siteHead.style.color = colorString;
18+
let siteHead = document.getElementsByTagName('head')[0]; siteHead.style.color = colorString;
2019
let webColor = getComputedStyle(siteHead,null).color; webColor = /rgb/.test(webColor) ? webColor.replace(/[^\d,]/g, '').split(',') : [0,0,0];
2120
siteHead.style.color = ''; return { r: parseInt(webColor[0]), g: parseInt(webColor[1]), b: parseInt(webColor[2]) };
2221
}

0 commit comments

Comments
 (0)
Failed to load comments.