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

    circletype

A JavaScript library that lets you curve type on the web.


Version published
Weekly downloads
1K
decreased by-31.31%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

CircleType

Build Status

A JavaScript library that lets you curve type on the web

Demos: http://circletype.labwire.ca

Installation

npm

npm i circletype --save

bower

bower i circletype.js --save

API

CircleType

A CircleType instance creates a circular text element.

Kind: global class

new CircleType(elem)

ParamTypeDescription
elemHTMLElementA target HTML element.

Example

const circleType = new CircleType(document.getElementById('elementId'));

// Instance methods are chainable.
circleType.radius(200).dir(-1);

circleType.radius(value) ⇒ Number

Sets the text radius.

Kind: instance method of CircleType
Returns: Number - The current instance.

ParamTypeDescription
valueNumberA new text radius in pixels.

Example

const circleType = new CircleType(myElement);

// Set the radius to 150 pixels.
circleType.radius(150);

circleType.radius() ⇒ Number

Gets the current text radius in pixels.

Kind: instance method of CircleType
Returns: Number - The current text radius.
Example

const circleType = new CircleType(myElement);

circleType.radius();
// > 150

circleType.dir(value) ⇒ CircleType

Sets the text direction. 1 is clockwise, -1 is counter-clockwise.

Kind: instance method of CircleType
Returns: CircleType - The current instance.

ParamTypeDescription
valueNumberA new text direction.

Example

const circleType = new CircleType(myElement);

// Set the direction to counter-clockwise.
circleType.dir(-1);

// Set the direction to clockwise.
circleType.dir(1);

circleType.dir() ⇒ Number

Gets the current text direction. 1 is clockwise, -1 is counter-clockwise.

Kind: instance method of CircleType
Returns: Number - The current text radius.
Example

const circleType = new CircleType(myElement);

circleType.dir();
// > 1 (clockwise)

circleType.refresh() ⇒ CircleType

Schedules a task to recalculate the height of the element. This should be called if the font size is ever changed.

Kind: instance method of CircleType
Returns: CircleType - The current instance.
Example

const circleType = new CircleType(myElement);

circleType.refresh();

circleType.destroy() ⇒ CircleType

Removes the CircleType effect from the element, restoring it to its original state.

Kind: instance method of CircleType
Returns: CircleType - This instance.
Example

const circleType = new CircleType(myElement);

// Restore `myElement` to its original state.
circleType.destroy();

Keywords

FAQs

Last updated on 31 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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