From 83b918b868e74c92fb4c897810d5d27666579031 Mon Sep 17 00:00:00 2001 From: Diego Poza Date: Tue, 22 Nov 2016 17:53:09 -0300 Subject: [PATCH] Added ability to rotate banners --- js/app.js | 12 ++++++++++++ stylus/app.styl | 24 ++++++++++++++++++++++++ views/index.jade | 6 +++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index b881bf51..6abe3a2d 100644 --- a/js/app.js +++ b/js/app.js @@ -719,6 +719,18 @@ $('.stars').each(function(idx, element){ } }); +function rotateBanner() { + var extensionSection = $(".update-site"); + var ebookSection = $(".jtw-ebook-banner"); + if (Math.random() >= .5) { + extensionSection.show(); + } else { + ebookSection.show(); + } +}; + +rotateBanner(); + function setInstalledText() { var button = $('#extension-button'); if(button && button.hasClass('is-installed')) { diff --git a/stylus/app.styl b/stylus/app.styl index 2e408ca2..41e9940a 100644 --- a/stylus/app.styl +++ b/stylus/app.styl @@ -338,6 +338,7 @@ body width 80px .update-site + display: none; background: #e3e5e7 padding: 30px 20px; font-size: 18px; @@ -394,6 +395,29 @@ body line-height: 33px; display: inline-block; +// jtw ebook banner +.jtw-ebook-banner + display: none; + background: #e3e5e7; + padding: 30px 20px; + font-size: 18px; + text-align: center; + color: darken(#e3e5e7, 70%); + + +breakpoint("desktop") + padding: 30px 0; + + .btn-download-ebook + padding: 8px 24px; + margin: 0px auto 0 11px; + color: #fff; + border-radius: 3px; + background-color: #00b9f1; + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + text-align: center; + text-decoration: none; // debugger-jwt diff --git a/views/index.jade b/views/index.jade index f93205f2..e9e8123c 100644 --- a/views/index.jade +++ b/views/index.jade @@ -57,7 +57,11 @@ block content use(fill='#FFFFFF', fill-rule='evenodd', xlink:href='#path-1') span.button-text Add to chrome - + section.jtw-ebook-banner + span + strong Get the JWT Handbook for free! + |Spread the word and download it now. + a.btn.btn-download-ebook(href='https://auth0.com/e-books/jwt-handbook', target='_blank') Download Ebook section#debugger-io.debugger-jwt .container //- a(name='debugger')