Skip to content

Instantly share code, notes, and snippets.

@nluqo
Last active Dec 24, 2015
Embed
What would you like to do?
Code used to autumnify CNN's topic headers. Try this in your JavaScript console on CNN. https://github.com/nluqo/autumn This code is waaaay more complicated than normal Autumn use (loading scripts and such), so please don't be put off by that.
function autumnify(){jQuery.getScript("//rawgithub.com/boronine/husl/v2.0.0/husl.js", function(){jQuery.getScript("//rawgithub.com/nluqo/autumn/master/autumn.js", function(){jQuery(".cnn_sectbincntnt2 h4").each(function(i,e){jQuery.fn.autumn.init({colorProfile:'dark'});var g = jQuery.fn.autumn.getGradientColors(i);jQuery(this).css({'background-image':'linear-gradient(to top, '+g[1]+','+g[0]+')'});});});});}if(!window.hasOwnProperty('jQuery')){var s = document.body.appendChild(document.createElement('script')); s.src = '//code.jquery.com/jquery-1.10.1.min.js';s.onload = autumnify;}else{autumnify();}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment