1/* 2* FlowType.JS v1.1 3* Copyright 2013-2014, Simple Focus http://simplefocus.com/ 4* 5* FlowType.JS by Simple Focus (http://simplefocus.com/) 6* is licensed under the MIT License. Read a copy of the 7* license in the LICENSE.txt file or at 8* http://choosealicense.com/licenses/mit 9* 10* Thanks to Giovanni Difeterici (http://www.gdifeterici.com/) 11*/ 12 13(function($) { 14 $.fn.flowtype = function(options) { 15 16// Establish default settings/variables 17// ==================================== 18 var settings = $.extend({ 19 maximum : 9999, 20 minimum : 1, 21 maxFont : 9999, 22 minFont : 1, 23 fontRatio : 35 24 }, options), 25 26// Do the magic math 27// ================= 28 changes = function(el) { 29 30 var $el = $(el), 31 elw = $el.width(), 32 width = elw > settings.maximum ? settings.maximum : elw < settings.minimum ? settings.minimum : elw, 33 fontBase = width / settings.fontRatio, 34 fontSize = fontBase > settings.maxFont ? settings.maxFont : fontBase < settings.minFont ? settings.minFont : fontBase; 35// console.log( fontSize + " | " + width) 36 $el.css('font-size', fontSize + 'px'); 37 }; 38 39// Make the magic visible 40// ====================== 41 return this.each(function() { 42 // Context for resize callback 43 var that = this; 44 // Make changes upon resize 45 $(window).resize(function(){changes(that);}); 46 // Set changes on load 47 changes(this); 48 }); 49 }; 50}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.