BigText,js
by ian_smithz
HTML
<div id="bigtext">
<div>The elusive <span>xxx</span></div>
<div>BIGTEXT</div>
<div>plugin exclusively</div>
<div>captured on film</div>
</div>
CSS
@import url('//fonts.googleapis.com/css?family=Lato');
* {
font-family:'Lato', sans-serif;
}
span {
font-size: 70%
}
#bigtext {
max-width: 1278px;
width: 80%;
margin: 0 auto;
}
JavaScript
/*! BigText - v0.1.7a - 2014-07-18
* https://github.com/zachleat/bigtext
* Copyright (c) 2014 Zach Leatherman (@zachleat)
* MIT License */
(function(window, $) {
"use strict";
var counter = 0,
$headCache = $('head'),
oldBigText = window.BigText,
oldjQueryMethod = $.fn.bigtext,
BigText = {
DEBUG_MODE: false,
DEFAULT_MIN_FONT_SIZE_PX: null,
DEFAULT_MAX_FONT_SIZE_PX: 528,
GLOBAL_STYLE_ID: 'bigtext-style',
STYLE_ID: 'bigtext-id',
LINE_CLASS_PREFIX: 'bigtext-line',
EXEMPT_CLASS: 'bigtext-exempt',
noConflict: function(restore)
{
if(restore) {
$.fn.bigtext = oldjQueryMethod;
window.BigText = oldBigText;
}
return BigText;
},
test: {
wholeNumberFontSizeOnly: function() {
if( !( 'getComputedStyle' in window ) || document.body == null ) {
return true;
}
var test = $('<div/>').css({
position: 'absolute',
'font-size': '14.1px'
}).appendTo(document.body).get(0),
computedStyle = window.getComputedStyle( test, null );
if( computedStyle ) {
return computedStyle.getPropertyValue( 'font-size' ) === '14px';
}
return true;
}
},
supports: {
wholeNumberFontSizeOnly: undefined
},
init: function() {
if( BigText.supports.wholeNumberFontSizeOnly === undefined ) {
BigText.supports.wholeNumberFontSizeOnly = BigText.test.wholeNumberFontSizeOnly();
}
if(!$('#'+BigText.GLOBAL_STYLE_ID).length) {
$headCache.append(BigText.generateStyleTag(BigText.GLOBAL_STYLE_ID, ['.bigtext * { white-space: nowrap; } .bigtext > * { display: block; }',
'.bigtext .' + BigText.EXEMPT_CLASS + ', .bigtext .' + BigText.EXEMPT_CLASS + ' * { white-space: normal; }']));
}
},
bindResize:...