-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSCN.js
More file actions
52 lines (49 loc) · 1.69 KB
/
Copy pathSCN.js
File metadata and controls
52 lines (49 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//Learning to clone, pull, and push (git)//
$("#os-phrases > h2")
.css('opacity', 1).lettering( 'words' )
.children( "span" ).lettering()
.children( "span" ).lettering();
$("#os-phrases > h3")
.css('opacity', 1).lettering( 'words' )
.children( "span" ).lettering()
.children( "span" ).lettering();
/*Script reference "https://cdnjs.cloudflare.com/ajax/libs/lettering.js/0.6.1/jquery.lettering.min.js"*/
/* Lettering.JS 0.6.1 by Dave Rupert - http://daverupert.com */
(function($){
function injector(t,splitter,klass,after){
var a=t.text().split(splitter),inject='';
if(a.length){
$(a).each(function(i,item){
inject+='<span class="'+klass+(i+1)+'">'+item+'</span>'+after
});
t.empty().append(inject)
}
}
var methods={
init:function(){
return this.each(function(){
injector($(this),'','char','')
}
)},
words:function(){
return this.each(function(){
injector($(this),' ','word',' ')
})
},lines:function(){
return this.each(function(){
var r="eefec303079ad17405c889e092e105b0";
injector($(this).children("br").replaceWith(r).end(),r,'line','')
})
}
};
$.fn.lettering=function(method){
if(method&&methods[method]){
return methods[method].apply(this,[].slice.call(arguments,1))
}
else if(method==='letters'||!method){
return methods.init.apply(this,[].slice.call(arguments,0))
}
$.error('Method '+method+' does not exist on jQuery.lettering');
return this
}
})(jQuery);