Skip to content

Commit

Permalink
Add license banner, fix min radius bug, improve demo page for mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhry committed Aug 26, 2017
1 parent 8da8216 commit d3f6a1d
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 19 deletions.
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014 Peter Hrynkow

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 8 additions & 1 deletion dist/circletype.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion index.html
Expand Up @@ -112,6 +112,11 @@ <h2 class="strong">Browser Support</h2>
* Title
*/
var titleDemo = new CircleType(document.getElementById('title')).radius(500);
function updateTitleDemoRadius() {
titleDemo.radius(titleDemo.element.offsetWidth / 2);
}
window.addEventListener('resize', updateTitleDemoRadius);
updateTitleDemoRadius();

/**
* Basic Arc
Expand Down Expand Up @@ -139,7 +144,7 @@ <h2 class="strong">Browser Support</h2>
demo4.radius(demo4.element.offsetWidth / 2);
}
window.addEventListener('resize', updateRadius);
updateRadius(demo4);
updateRadius();

/**
* FitText
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"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",
"scripts": {},
"repository": {
Expand Down
10 changes: 2 additions & 8 deletions src/class.js
@@ -1,11 +1,5 @@
/*
* 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;

/**
* Converts radians to degrees.
Expand Down Expand Up @@ -114,7 +108,7 @@ class CircleType {
*/
radius(value) {
if (value !== undefined) {
this._radius = value;
this._radius = max(this._minRadius, value);

this._invalidate();

Expand Down
13 changes: 13 additions & 0 deletions webpack.config.babel.js
@@ -1,3 +1,12 @@
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 = {
context: __dirname,
entry: {
Expand All @@ -21,4 +30,8 @@ module.exports = {
filename: './dist/[name].min.js',
libraryTarget: 'umd',
},

plugins: [
new webpack.BannerPlugin(banner)
],
};

0 comments on commit d3f6a1d

Please sign in to comment.