Socket
Socket
Sign inDemoInstall

circletype

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.0.3

4

dist/circletype.min.js
/*!
* circletype 2.0.2
* circletype 2.0.3
* A JavaScript library that lets you curve type on the web.

@@ -8,2 +8,2 @@ * Copyright © 2014-2017 Peter Hrynkow

*/
!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?"&nbsp;":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=_}])});
!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?"&nbsp;":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}])});
{
"name": "circletype",
"version": "2.0.2",
"version": "2.0.3",
"description": "A JavaScript library that lets you curve type on the web.",
"main": "src/circletype.js",
"main": "dist/circletype.min.js",
"scripts": {},

@@ -7,0 +7,0 @@ "repository": {

@@ -1,6 +0,3 @@

/* eslint-disable */
import CircleType from './class';
export {
CircleType,
};
module.exports = CircleType;

@@ -31,2 +31,3 @@ import webpack from 'webpack';

filename: './dist/[name].min.js',
library: 'CircleType',
libraryTarget: 'umd',

@@ -33,0 +34,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc