circletype
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,1 +0,8 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(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";Object.defineProperty(e,"__esModule",{value:!0}),e.CircleType=void 0;var n=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.CircleType=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,l=Math.abs,f=function(t){return t*(180/u)},h=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}},c=function(t){return t.trim().split("").map(function(t){var e=document.createElement("span");return e.innerHTML=" "===t?" ":t,e})},d=function(t){var e=a(t.length/2),i=h(t[e]),n=h(t[0]);return n.height+l(n.top-i.top)},p=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=c(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(h);var l=this._metrics.reduce(function(t,e){return t+e.width},0);this._minRadius=l/u/2+this._lineHeight,this._invalidate()}return o(t,[{key:"radius",value:function(t){return void 0!==t?(this._radius=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,l=u.sum;return this._letters.forEach(function(e,i){var n=e.style,o=(-.5*l+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=d(this._letters)+"px",this}}]),t}();e.default=p}])}); | ||
/*! | ||
* circletype 2.0.2 | ||
* A JavaScript library that lets you curve type on the web. | ||
* Copyright © 2014-2017 Peter Hrynkow | ||
* Licensed MIT | ||
* https://github.com/peterhry/CircleType#readme | ||
*/ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(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";Object.defineProperty(e,"__esModule",{value:!0}),e.CircleType=void 0;var n=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(n);e.CircleType=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"],a=Math.PI,u=Math.floor,l=Math.abs,f=Math.max,h=function(t){return t*(180/a)},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=u(t.length/2),i=c(t[e]),n=c(t[0]);return n.height+l(n.top-i.top)},_=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,u=o.lineHeight;this._fontSize=parseInt(s,10),this._lineHeight=parseInt(u,10)||this._fontSize,this._metrics=this._letters.map(c);var l=this._metrics.reduce(function(t,e){return t+e.width},0);this._minRadius=l/a/2+this._lineHeight,this._invalidate()}return o(t,[{key:"radius",value:function(t){return void 0!==t?(this._radius=f(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,a=this._metrics.reduce(function(t,e){var i=e.width,r=h(i/o);return{sum:t.sum+r,rotations:[].concat(n(t.rotations),[t.sum+r/2])}},{sum:0,rotations:[]}),u=a.rotations,l=a.sum;return this._letters.forEach(function(e,i){var n=e.style,o=(-.5*l+u[i])*t._dir,a=-.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("+a+"em) rotate("+o+"deg)",n[t+"TransformOrigin"]=r})}),this.container.style.height=p(this._letters)+"px",this}}]),t}();e.default=_}])}); |
{ | ||
"name": "circletype", | ||
"version": "2.0.1", | ||
"description": "A JavaScript library that lets you curve type on the web", | ||
"version": "2.0.2", | ||
"description": "A JavaScript library that lets you curve type on the web.", | ||
"main": "src/circletype.js", | ||
@@ -6,0 +6,0 @@ "scripts": {}, |
@@ -26,2 +26,3 @@ { | ||
"CHANGELOG", | ||
"LICENSE", | ||
"/node_modules/", | ||
@@ -34,2 +35,3 @@ "bower.json", | ||
"README.md", | ||
"/src/", | ||
"/sass/", | ||
@@ -36,0 +38,0 @@ "yarn.lock", |
@@ -1,9 +0,3 @@ | ||
/* | ||
* CircleType 2.0.0 | ||
* Peter Hrynkow | ||
* Copyright 2014, Licensed GPL & MIT | ||
* | ||
*/ | ||
const vendors = ['webkit', 'Moz', 'O', 'ms']; | ||
const { PI, floor, abs } = Math; | ||
const { PI, floor, abs, max } = Math; | ||
@@ -117,3 +111,3 @@ /** | ||
if (value !== undefined) { | ||
this._radius = value; | ||
this._radius = max(this._minRadius, value); | ||
@@ -120,0 +114,0 @@ this._invalidate(); |
@@ -0,1 +1,10 @@ | ||
import webpack from 'webpack'; | ||
import PACKAGE from './package.json'; | ||
const banner = `${PACKAGE.name} ${PACKAGE.version} | ||
${PACKAGE.description} | ||
Copyright © 2014-${new Date().getFullYear()} ${PACKAGE.author} | ||
Licensed ${PACKAGE.license} | ||
${PACKAGE.homepage}`; | ||
module.exports = { | ||
@@ -24,2 +33,6 @@ context: __dirname, | ||
}, | ||
plugins: [ | ||
new webpack.BannerPlugin(banner) | ||
], | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
153019
22
333