-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathscript.min.js
1 lines (1 loc) · 1.51 KB
/
script.min.js
1
$(document).ready(function(){function e(){scaleRatio=$(".font_scale").val(),t()}function t(){function e(){a=baseSize,b=scaleRatio,result=baseSize,$($(".scale_high").get().reverse()).each(function(){$(this).css("font-size",Math.round(1e3*result)/1e3+"em"),result=a*b,a=result})}function t(){a=1,b=scaleRatio,result=1,$($(".scale_high_label").get().reverse()).each(function(){$(this).text(Math.round(1e3*result)/1e3+"em"),result=a*b,a=result})}function s(){a=baseSize,b=scaleRatio,result=baseSize,$(".scale_low").each(function(){result=a/b,a=result,$(this).css("font-size",Math.round(1e3*result)/1e3+"em")})}function i(){a=1,b=scaleRatio,result=1,$(".scale_low_label").each(function(){result=a/b,a=result,$(this).text(Math.round(1e3*result)/1e3+"em")})}e(),t(),s(),i()}viewportHeight=$(window).innerHeight(),$(".stage").css("min-height",viewportHeight),$(".base_size").val(24),baseSize=1.5,scaleRatio=1.5,t(),$(".input_select_all").click(function(){$(this).select()}),$(".base_size").bind("change paste keyup",function(){baseSize=$.isNumeric($(this).val())?$(this).val()/16:0,$(".base_em").text(Math.round(1e3*baseSize)/1e3),e()}),$(".preview_text").bind("change paste keyup",function(){previewText=$(this).val(),$(".scale_preview_text").text(previewText)}),$(".web_font").bind("change paste keyup",function(){webFont=$(this).val(),$("head").append(webFont)}),$(".web_font_name").bind("change paste keyup",function(){webFontName=$(this).val(),$(".scale_webfont").attr("style",webFontName)}),$(".font_scale").bind("change paste keyup",function(){e()})});