circletype
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -8,2 +8,2 @@ /*! | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CircleType=e():t.CircleType=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,i){"use strict";var n=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(n);t.exports=r.default},function(t,e,i){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=["webkit","Moz","O","ms"],u=Math.PI,a=Math.floor,h=Math.abs,l=Math.max,f=function(t){return t*(180/u)},c=function(t){var e=t.getBoundingClientRect(),i=e.top,n=e.left,r=e.width,o=e.height;return{top:i+window.pageYOffset,left:n+window.pageXOffset,width:r,height:o}},d=function(t){return t.trim().split("").map(function(t){var e=document.createElement("span");return e.innerHTML=" "===t?" ":t,e})},p=function(t){var e=a(t.length/2),i=c(t[e]),n=c(t[0]);return n.height+h(n.top-i.top)},m=function(){function t(e){r(this,t),this._dir=1,this.element=e,this.originalHTML=this.element.innerHTML;var i=this.element.innerText,n=document.createElement("div");n.setAttribute("aria-label",i),n.style.position="relative",this.container=n,this._letters=d(i),this._letters.forEach(function(t){return n.appendChild(t)}),this.element.innerHTML="",this.element.appendChild(n);var o=window.getComputedStyle(this.element),s=o.fontSize,a=o.lineHeight;this._fontSize=parseInt(s,10),this._lineHeight=parseInt(a,10)||this._fontSize,this._metrics=this._letters.map(c);var h=this._metrics.reduce(function(t,e){return t+e.width},0);this._minRadius=h/u/2+this._lineHeight,this._invalidate()}return o(t,[{key:"radius",value:function(t){return void 0!==t?(this._radius=l(this._minRadius,t),this._invalidate(),this):this._radius}},{key:"dir",value:function(t){return void 0!==t?(this._dir=t,this._invalidate(),this):this._dir}},{key:"refresh",value:function(){return this._invalidate()}},{key:"destroy",value:function(){return this.element.innerHTML=this.originalHTML,this}},{key:"_invalidate",value:function(){var t=this;return requestAnimationFrame(function(){t._layout()}),this}},{key:"_layout",value:function(){var t=this,e=this._radius?this._radius:this._minRadius,i=-1===this._dir?-e+this._lineHeight:e,r="center "+i/this._fontSize+"em",o=e-this._lineHeight,u=this._metrics.reduce(function(t,e){var i=e.width,r=f(i/o);return{sum:t.sum+r,rotations:[].concat(n(t.rotations),[t.sum+r/2])}},{sum:0,rotations:[]}),a=u.rotations,h=u.sum;return this._letters.forEach(function(e,i){var n=e.style,o=(-.5*h+a[i])*t._dir,u=-.5*t._metrics[i].width/t._fontSize;n.position="absolute",n.bottom=-1===t._dir?0:"auto",n.left="50%",s.forEach(function(t){n[t+"Transform"]="translateX("+u+"em) rotate("+o+"deg)",n[t+"TransformOrigin"]=r})}),this.container.style.height=p(this._letters)+"px",this}}]),t}();e.default=m}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CircleType=e():t.CircleType=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,i){"use strict";var n=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(n);t.exports=r.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),u=i(2),a=n(u),l=i(3),f=n(l),h=Math.PI,c=Math.floor,d=Math.abs,p=Math.max,_=function(t){var e=t.getBoundingClientRect(),i=e.top,n=e.left,r=e.width,o=e.height;return{top:i+window.pageYOffset,left:n+window.pageXOffset,width:r,height:o}},m=function(t){var e=c(t.length/2),i=_(t[e]),n=_(t[0]);return n.height+d(n.top-i.top)},v=function(){function t(e){o(this,t),this._dir=1,this.element=e,this.originalHTML=this.element.innerHTML;var i=this.element.innerText,n=document.createElement("div");n.setAttribute("aria-label",i),n.style.position="relative",this.container=n,this._letters=(0,f.default)(i),this._letters.forEach(function(t){return n.appendChild(t)}),this.element.innerHTML="",this.element.appendChild(n);var r=window.getComputedStyle(this.element),s=r.fontSize,u=r.lineHeight;this._fontSize=parseInt(s,10),this._lineHeight=parseInt(u,10)||this._fontSize,this._metrics=this._letters.map(_);var a=this._metrics.reduce(function(t,e){return t+e.width},0);this._minRadius=a/h/2+this._lineHeight,this._invalidate()}return s(t,[{key:"radius",value:function(t){return void 0!==t?(this._radius=p(this._minRadius,t),this._invalidate(),this):this._radius}},{key:"dir",value:function(t){return void 0!==t?(this._dir=t,this._invalidate(),this):this._dir}},{key:"refresh",value:function(){return this._invalidate()}},{key:"destroy",value:function(){return this.element.innerHTML=this.originalHTML,this}},{key:"_invalidate",value:function(){var t=this;return requestAnimationFrame(function(){t._layout()}),this}},{key:"_layout",value:function(){var t=this,e=this._radius?this._radius:this._minRadius,i=-1===this._dir?-e+this._lineHeight:e,n="center "+i/this._fontSize+"em",o=e-this._lineHeight,s=this._metrics.reduce(function(t,e){var i=e.width,n=(0,a.default)(i/o);return{sum:t.sum+n,rotations:[].concat(r(t.rotations),[t.sum+n/2])}},{sum:0,rotations:[]}),u=s.rotations,l=s.sum;return this._letters.forEach(function(e,i){var r=e.style,o=(-.5*l+u[i])*t._dir,s=-.5*t._metrics[i].width/t._fontSize,a="translateX("+s+"em) rotate("+o+"deg)";r.position="absolute",r.bottom=-1===t._dir?0:"auto",r.left="50%",r.transform=a,r.transformOrigin=n,r.webkitTransform=a,r.webkitTransformOrigin=n}),this.container.style.height=m(this._letters)+"px",this}}]),t}();e.default=v},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t*(180/Math.PI)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.trim().split("").map(function(t){var e=document.createElement("span");return e.innerHTML=" "===t?" ":t,e})}}])}); |
{ | ||
"name": "circletype", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "A JavaScript library that lets you curve type on the web.", | ||
"main": "dist/circletype.min.js", | ||
"scripts": {}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/peterhry/CircleType.git" | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": "peterhry/CircleType", | ||
"scripts": { | ||
"test": "jest --notify" | ||
}, | ||
"keywords": [ | ||
"circletype", | ||
"circular text", | ||
"curved text", | ||
"curved type", | ||
"circular text", | ||
"typography", | ||
"jquery" | ||
"typography" | ||
], | ||
"author": "Peter Hrynkow", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/peterhry/CircleType/issues" | ||
}, | ||
"bugs": "https://github.com/peterhry/CircleType/issues", | ||
"homepage": "https://github.com/peterhry/CircleType#readme", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"babel": "6.23.0", | ||
"babel-core": "^6.25.0", | ||
"babel-loader": "^7.1.1", | ||
"babel-plugin-transform-object-rest-spread": "6.23.0", | ||
"babel-preset-env": "^1.6.0", | ||
"eslint": "4.4.1", | ||
"babel-core": "6.26.0", | ||
"babel-loader": "7.1.2", | ||
"babel-plugin-transform-object-rest-spread": "6.26.0", | ||
"babel-preset-env": "1.6.0", | ||
"eslint": "4.5.0", | ||
"eslint-config-airbnb": "15.1.0", | ||
"eslint-loader": "1.9.0", | ||
"eslint-plugin-import": "2.7.0", | ||
"eslint-plugin-jsx-a11y": "5.1.1", | ||
"eslint-plugin-react": "7.2.0", | ||
"webpack": "^3.5.3" | ||
"eslint-plugin-jsx-a11y": "5.1.0", | ||
"eslint-plugin-react": "7.3.0", | ||
"jest": "20.0.4", | ||
"webpack": "3.5.5" | ||
} | ||
} |
# CircleType | ||
[![Build Status](https://travis-ci.org/peterhry/CircleType.svg?branch=master)](https://travis-ci.org/peterhry/CircleType) | ||
A JavaScript library that lets you curve type on the web | ||
@@ -4,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21
6625
13
4
7
2
1
2