99 < script src ="https://use.typekit.net/fbl0lhq.js "> </ script >
1010 < link rel ="shortcut icon " type ="image/x-icon " href ="assets/favicon.ico ">
1111 < link rel ="stylesheet " href ="assets/stylesheets/screen.css ">
12+ < link rel ="stylesheet " href ="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/monokai-sublime.min.css ">
13+ < script src ="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js "> </ script >
1214 </ head >
1315 < body >
1416 < div class ="container ">
@@ -31,175 +33,75 @@ <h2 class="strong">Features</h2>
3133 < a href ="https://github.com/peterhry/circletype " class ="btn "> Download on GitHub</ a >
3234 </ p >
3335
34- < ins
35- class ="adsbygoogle "
36- style ="display:block "
37- data-ad-format ="fluid "
38- data-ad-layout ="text-only "
39- data-ad-layout-key ="-gw-c+2p-30-2w "
40- data-ad-client ="ca-pub-2609593449239823 "
41- data-ad-slot ="9041076570 ">
42- </ ins >
43- < script >
44- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
45- </ script >
46-
4736 < h2 class ="strong "> Demos</ h2 >
4837 < h3 class ="puffy "> Basic Arc</ h3 >
4938 < p > Here’s some curved text that flows clockwise.</ p >
5039 < div class ="demo-box " id ="demo-box1 ">
5140 < h2 id ="demo1 " class ="demo strong "> Here’s some curved text flowing clockwise.</ h2 >
5241 </ div >
53- < code > <h2 id="demo1">Here’s some curved text flowing clockwise.</h2>
54- new CircleType(document.getElementById('demo1')).radius(384);</ code >
55-
56- < ins
57- class ="adsbygoogle "
58- style ="display:block "
59- data-ad-format ="fluid "
60- data-ad-layout ="text-only "
61- data-ad-layout-key ="-gw-c+2p-30-2w "
62- data-ad-client ="ca-pub-2609593449239823 "
63- data-ad-slot ="9041076570 ">
64- </ ins >
65- < script >
66- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
67- </ script >
68-
42+ < pre > < code class ="javascript "> // <h2 id="demo1"> Here’s some curved text flowing clockwise.</h2>
43+ new CircleType(document.getElementById('demo1'))
44+ .radius(384);</ code > </ pre >
6945 < h3 class ="puffy " id ="reverse "> Reversed Arc</ h3 >
7046 < p > By setting dir to -1, the text will flow counter-clockwise instead.</ p >
7147 < div class ="demo-box " id ="demo-box2 ">
7248 < h2 id ="demo2 " class ="demo strong "> Here’s some curved text flowing counter-clockwise.</ h2 >
7349 </ div >
74- < code > <h2 id="demo2">Here’s some curved text flowing counter-clockwise.</h2>
75- new CircleType(document.getElementById('demo2')).dir(-1).radius(384);</ code >
76-
77- < ins
78- class ="adsbygoogle "
79- style ="display:block "
80- data-ad-format ="fluid "
81- data-ad-layout ="text-only "
82- data-ad-layout-key ="-gw-c+2p-30-2w "
83- data-ad-client ="ca-pub-2609593449239823 "
84- data-ad-slot ="9041076570 ">
85- </ ins >
86- < script >
87- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
88- </ script >
89-
50+ < pre > < code class ="js "> // <h2 id="demo2"> Here’s some curved text flowing counter-clockwise.</h2>
51+ new CircleType(document.getElementById('demo2'))
52+ .dir(-1)
53+ .radius(384);</ code > </ pre >
9054 < h3 class ="puffy " id ="auto "> Auto Radius</ h3 >
9155 < p > By leaving the radius empty, CircleType.js will find the perfect radius so the text makes a complete rotation.</ p >
9256 < div class ="demo-box " id ="demo-box3 ">
9357 < h2 id ="demo3 " class ="demo strong "> This text makes a complete rotation no matter how long it is. </ h2 >
9458 </ div >
95- < code > <h2 id="demo3">This text makes a complete rotation no matter how long it is. </h2>
96- new CircleType(document.getElementById('demo3'));</ code >
97-
98- < ins
99- class ="adsbygoogle "
100- style ="display:block "
101- data-ad-format ="fluid "
102- data-ad-layout ="text-only "
103- data-ad-layout-key ="-gw-c+2p-30-2w "
104- data-ad-client ="ca-pub-2609593449239823 "
105- data-ad-slot ="9041076570 ">
106- </ ins >
107- < script >
108- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
109- </ script >
110-
59+ < pre > < code class ="js "> // <h2 id="demo3"> This text makes a complete rotation no matter how long it is. </h2>
60+ new CircleType(document.getElementById('demo3'));</ code > </ pre >
11161 < h3 class ="puffy " id ="fluid "> Fluid</ h3 >
11262 < p > Update the radius when the window is resized to create a fluid effect (try resizing your window).</ p >
11363 < div class ="demo-box " id ="demo-box4 ">
11464 < h2 id ="demo4 " class ="demo strong "> This curved type shrinks and expands to fit inside its container. </ h2 >
11565 </ div >
116- < code > <h2 id="demo4"> This curved type shrinks and expands to fit inside its container. </h2>
66+ < pre > < code class =" js " > // <h2 id="demo4"> This curved type shrinks and expands to fit inside its container. </h2>
11767var demo4 = new CircleType(document.getElementById('demo4'));
11868window.addEventListener('resize', function updateRadius() {
11969 demo4.radius(demo4.element.offsetWidth / 2);
12070});
121- updateRadius();</ code >
122-
123- < ins
124- class ="adsbygoogle "
125- style ="display:block "
126- data-ad-format ="fluid "
127- data-ad-layout ="text-only "
128- data-ad-layout-key ="-gw-c+2p-30-2w "
129- data-ad-client ="ca-pub-2609593449239823 "
130- data-ad-slot ="9041076570 ">
131- </ ins >
132- < script >
133- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
134- </ script >
135-
71+ updateRadius();</ code > </ pre >
13672 < h3 class ="puffy " id ="fitText "> Using FitText.js</ h3 >
137- < p > Here’s how you can use < a href ="http://fittextjs.com " target ="_blank "> FitText.js</ a > to make the text scale (try resizing your window)</ p >
73+ < p > Here’s how you can use < a href ="http://fittextjs.com " target ="_blank "> FitText.js</ a > to make the text scale (try resizing your window). </ p >
13874 < div class ="demo-box " id ="demo-box5 ">
13975 < h2 id ="demo5 " class ="demo strong "> I play well with FitText.js too! </ h2 >
14076 </ div >
141- < code > <h2 id="demo5">I play well with FitText.js too! </h2>
142- var demo5 = new CircleType(document.getElementById('demo5')).radius(180);
143- $(demo5.element).fitText();</ code >
144-
145- < ins
146- class ="adsbygoogle "
147- style ="display:block "
148- data-ad-format ="fluid "
149- data-ad-layout ="text-only "
150- data-ad-layout-key ="-gw-c+2p-30-2w "
151- data-ad-client ="ca-pub-2609593449239823 "
152- data-ad-slot ="9041076570 ">
153- </ ins >
154- < script >
155- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
156- </ script >
157-
77+ < pre > < code class ="js "> // <h2 id="demo5"> I play well with FitText.js too! </h2>
78+ var demo5 = new CircleType(document.getElementById('demo5'))
79+ .radius(180);
80+ $(demo5.element).fitText();</ code > </ pre >
15881 < h3 class ="puffy " id ="fitText "> Destroy</ h3 >
15982 < p > Here’s how you can remove the effect from an element.</ p >
16083 < div class ="demo-box " id ="demo-box6 ">
16184 < p > < a href ="# " class ="btn " id ="destroyButton "> Destroy Me</ a > </ p >
16285 < h2 id ="demo6 " class ="demo strong "> Easily remove the effect.</ h2 >
16386 </ div >
164- < code > <button id="destroyButton"> Destroy Me</button>
165- <h2 id="demo6">Easily remove the effect.</h2>
166- var demo6 = new CircleType(document.getElementById('demo6')).radius(180);
167- document.getElementById('destroyButton').addEventListener('click', demo6.destroy.bind(demo6));</ code >
168-
169- < ins
170- class ="adsbygoogle "
171- style ="display:block "
172- data-ad-format ="fluid "
173- data-ad-layout ="text-only "
174- data-ad-layout-key ="-gw-c+2p-30-2w "
175- data-ad-client ="ca-pub-2609593449239823 "
176- data-ad-slot ="9041076570 ">
177- </ ins >
178- < script >
179- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
180- </ script >
181-
87+ < pre > < code class ="js "> // <button id="destroyButton">Destroy Me</button>
88+ // <h2 id="demo6">Easily remove the effect.</h2>
89+ var demo6 = new CircleType(document.getElementById('demo6'))
90+ .radius(180);
91+ document.getElementById('destroyButton')
92+ .addEventListener('click', demo6.destroy.bind(demo6));</ code > </ pre >
18293 < h3 class ="puffy " id ="emoji "> Emojis</ h3 >
183- < p > I work with emojis! </ p >
94+ < p > I work with emojis but you’ll need to provide your own splitter function. Here is an example that uses GraphemeSplitter: </ p >
18495 < div class ="demo-box " id ="demo-box7 ">
185- < h2 id ="demo7 " class ="demo strong "> 🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩 </ h2 >
96+ < h2 id ="demo7 " class ="demo strong "> 👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦 </ h2 >
18697 </ div >
187- < code > <h2 id="demo7">🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩🍩</h2>
188- var demo7 = new CircleType(document.getElementById('demo7'));</ code >
189-
190- < ins
191- class ="adsbygoogle "
192- style ="display:block "
193- data-ad-format ="fluid "
194- data-ad-layout ="text-only "
195- data-ad-layout-key ="-gw-c+2p-30-2w "
196- data-ad-client ="ca-pub-2609593449239823 "
197- data-ad-slot ="9041076570 ">
198- </ ins >
199- < script >
200- ( adsbygoogle = window . adsbygoogle || [ ] ) . push ( { } ) ;
201- </ script >
202-
98+ < pre > < code class ="js "> // <script src="https://cdn.rawgit.com/orling/grapheme-splitter/b4500feb/index.js"></script>
99+ // <h2 id="demo7">👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦👨👩👧👦</h2>
100+ var splitter = new GraphemeSplitter()
101+ var demo7 = new CircleType(
102+ document.getElementById('demo7'),
103+ splitter.splitGraphemes.bind(splitter)
104+ );</ code > </ pre >
203105 < h2 class ="strong "> Browser Support</ h2 >
204106 < ul class ="bullets ">
205107 < li > Chrome, Firefox, Safari, Opera, Edge (last 2 versions)</ li >
@@ -213,6 +115,7 @@ <h2 class="strong">Browser Support</h2>
213115 </ div >
214116 < script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js "> </ script >
215117 < script src ="https://cdnjs.cloudflare.com/ajax/libs/FitText.js/1.2.0/jquery.fittext.min.js "> </ script >
118+ < script src ="https://cdn.rawgit.com/orling/grapheme-splitter/b4500feb/index.js "> </ script >
216119 < script src ="dist/circletype.min.js "> </ script >
217120 < script >
218121 try {
@@ -280,7 +183,11 @@ <h2 class="strong">Browser Support</h2>
280183 /**
281184 * Emojis
282185 */
283- var demo7 = new CircleType ( document . getElementById ( 'demo7' ) ) ;
186+ var splitter = new GraphemeSplitter ( )
187+ var demo7 = new CircleType (
188+ document . getElementById ( 'demo7' ) ,
189+ splitter . splitGraphemes . bind ( splitter )
190+ ) ;
284191 }
285192 </ script >
286193 < script type ="text/javascript ">
@@ -297,5 +204,6 @@ <h2 class="strong">Browser Support</h2>
297204 < script
298205 async
299206 src ="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js "> </ script >
207+ < script > hljs . initHighlightingOnLoad ( ) ; </ script >
300208 </ body >
301209</ html >
0 commit comments