Last active
November 27, 2017 14:46
-
-
Save andrexduarte/5198069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var $quote = $(".post p:first"); | |
var $numWords = $quote.text().split(" ").length; | |
if (($numWords >= 1) && ($numWords < 10)) { | |
$quote.css("font-size", "36px"); | |
} | |
else if (($numWords >= 10) && ($numWords < 20)) { | |
$quote.css("font-size", "32px"); | |
} | |
else if (($numWords >= 20) && ($numWords < 30)) { | |
$quote.css("font-size", "28px"); | |
} | |
else if (($numWords >= 30) && ($numWords < 40)) { | |
$quote.css("font-size", "24px"); | |
} | |
else { | |
$quote.css("font-size", "20px"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
someone should make this into a SASS mixin! I will post here when I complete one