|
4 | 4 |
|
5 | 5 | A JavaScript library that lets you curve type on the web. |
6 | 6 |
|
7 | | -Demo: <http://circletype.labwire.ca> |
| 7 | +Demo: <https://circletype.labwire.ca> |
8 | 8 |
|
9 | 9 | ## Installation |
10 | 10 |
|
@@ -39,6 +39,10 @@ A CircleType instance creates a circular text element. |
39 | 39 | * [.radius()](#CircleType+radius) ⇒ <code>number</code> |
40 | 40 | * [.dir(value)](#CircleType+dir) ⇒ [<code>CircleType</code>](#CircleType) |
41 | 41 | * [.dir()](#CircleType+dir) ⇒ <code>number</code> |
| 42 | + * [.forceWidth(value)](#CircleType+forceWidth) ⇒ [<code>CircleType</code>](#CircleType) |
| 43 | + * [.forceWidth()](#CircleType+forceWidth) ⇒ <code>boolean</code> |
| 44 | + * [.forceHeight(value)](#CircleType+forceHeight) ⇒ [<code>CircleType</code>](#CircleType) |
| 45 | + * [.forceHeight()](#CircleType+forceHeight) ⇒ <code>boolean</code> |
42 | 46 | * [.refresh()](#CircleType+refresh) ⇒ [<code>CircleType</code>](#CircleType) |
43 | 47 | * [.destroy()](#CircleType+destroy) ⇒ [<code>CircleType</code>](#CircleType) |
44 | 48 |
|
@@ -92,7 +96,7 @@ for the text to form a complete circle. |
92 | 96 | const circleType = new CircleType(document.getElementById('myElement')); |
93 | 97 |
|
94 | 98 | circleType.radius(); |
95 | | -// > 150 |
| 99 | +//=> 150 |
96 | 100 | ``` |
97 | 101 | <a name="CircleType+dir"></a> |
98 | 102 |
|
@@ -128,7 +132,93 @@ Gets the text direction. `1` is clockwise, `-1` is counter-clockwise. |
128 | 132 | const circleType = new CircleType(document.getElementById('myElement')); |
129 | 133 |
|
130 | 134 | circleType.dir(); |
131 | | -// > 1 (clockwise) |
| 135 | +//=> 1 (clockwise) |
| 136 | +``` |
| 137 | +<a name="CircleType+forceWidth"></a> |
| 138 | + |
| 139 | +### circleType.forceWidth(value) ⇒ [<code>CircleType</code>](#CircleType) |
| 140 | +Sets the `forceWidth` option. If `true` the width of the arc is calculated |
| 141 | +and applied to the element as an inline style. |
| 142 | + |
| 143 | +**Kind**: instance method of [<code>CircleType</code>](#CircleType) |
| 144 | +**Returns**: [<code>CircleType</code>](#CircleType) - The current instance. |
| 145 | + |
| 146 | +| Param | Type | Description | |
| 147 | +| --- | --- | --- | |
| 148 | +| value | <code>boolean</code> | `true` if the width should be set | |
| 149 | + |
| 150 | +**Example** |
| 151 | +```js |
| 152 | +const circleType = new CircleType(document.getElementById('myElement')); |
| 153 | + |
| 154 | +circleType.radius(384); |
| 155 | + |
| 156 | +console.log(circleType.container); |
| 157 | +//=> <div style="position: relative; height: 3.18275em;">...</div> |
| 158 | + |
| 159 | +// Enable the force width option |
| 160 | +circleType.forceWidth(true); |
| 161 | + |
| 162 | +console.log(circleType.container); |
| 163 | +//=> <div style="position: relative; height: 3.18275em; width: 12.7473em;">...</div> |
| 164 | +``` |
| 165 | +<a name="CircleType+forceWidth"></a> |
| 166 | + |
| 167 | +### circleType.forceWidth() ⇒ <code>boolean</code> |
| 168 | +Gets the `forceWidth` option. If `true` the width of the arc is calculated |
| 169 | +and applied to the element as an inline style. Defaults to `false`. |
| 170 | + |
| 171 | +**Kind**: instance method of [<code>CircleType</code>](#CircleType) |
| 172 | +**Returns**: <code>boolean</code> - The current `forceWidth` value |
| 173 | +**Example** |
| 174 | +```js |
| 175 | +const circleType = new CircleType(document.getElementById('myElement')); |
| 176 | + |
| 177 | +circleType.forceWidth(); |
| 178 | +//=> false |
| 179 | +``` |
| 180 | +<a name="CircleType+forceHeight"></a> |
| 181 | + |
| 182 | +### circleType.forceHeight(value) ⇒ [<code>CircleType</code>](#CircleType) |
| 183 | +Sets the `forceHeight` option. If `true` the height of the arc is calculated |
| 184 | +and applied to the element as an inline style. |
| 185 | + |
| 186 | +**Kind**: instance method of [<code>CircleType</code>](#CircleType) |
| 187 | +**Returns**: [<code>CircleType</code>](#CircleType) - The current instance. |
| 188 | + |
| 189 | +| Param | Type | Description | |
| 190 | +| --- | --- | --- | |
| 191 | +| value | <code>boolean</code> | `true` if the height should be set | |
| 192 | + |
| 193 | +**Example** |
| 194 | +```js |
| 195 | +const circleType = new CircleType(document.getElementById('myElement')); |
| 196 | + |
| 197 | +circleType.radius(384); |
| 198 | + |
| 199 | +console.log(circleType.container); |
| 200 | +//=> <div style="position: relative; height: 3.18275em;">...</div> |
| 201 | + |
| 202 | +// Disable the force height option |
| 203 | +circleType.forceHeight(false); |
| 204 | + |
| 205 | +console.log(circleType.container); |
| 206 | +//=> <div style="position: relative;">...</div> |
| 207 | +``` |
| 208 | +<a name="CircleType+forceHeight"></a> |
| 209 | + |
| 210 | +### circleType.forceHeight() ⇒ <code>boolean</code> |
| 211 | +Gets the `forceHeight` option. If `true` the height of the arc is calculated |
| 212 | +and applied to the element as an inline style. Defaults to `true`. |
| 213 | + |
| 214 | +**Kind**: instance method of [<code>CircleType</code>](#CircleType) |
| 215 | +**Returns**: <code>boolean</code> - The current `forceHeight` value |
| 216 | +**Example** |
| 217 | +```js |
| 218 | +const circleType = new CircleType(document.getElementById('myElement')); |
| 219 | + |
| 220 | +circleType.forceHeight(); |
| 221 | +//=> true |
132 | 222 | ``` |
133 | 223 | <a name="CircleType+refresh"></a> |
134 | 224 |
|
|
0 commit comments