Skip to content

Commit 76aa7d1

Browse files
authored
Merge pull request jsonwebtoken#213 from jsonwebtoken/banner-rotate
Added ability to rotate banners
2 parents a9bb362 + 83b918b commit 76aa7d1

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

js/app.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,18 @@ $('.stars').each(function(idx, element){
719719
}
720720
});
721721

722+
function rotateBanner() {
723+
var extensionSection = $(".update-site");
724+
var ebookSection = $(".jtw-ebook-banner");
725+
if (Math.random() >= .5) {
726+
extensionSection.show();
727+
} else {
728+
ebookSection.show();
729+
}
730+
};
731+
732+
rotateBanner();
733+
722734
function setInstalledText() {
723735
var button = $('#extension-button');
724736
if(button && button.hasClass('is-installed')) {

stylus/app.styl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ body
338338
width 80px
339339

340340
.update-site
341+
display: none;
341342
background: #e3e5e7
342343
padding: 30px 20px;
343344
font-size: 18px;
@@ -394,6 +395,29 @@ body
394395
line-height: 33px;
395396
display: inline-block;
396397

398+
// jtw ebook banner
399+
.jtw-ebook-banner
400+
display: none;
401+
background: #e3e5e7;
402+
padding: 30px 20px;
403+
font-size: 18px;
404+
text-align: center;
405+
color: darken(#e3e5e7, 70%);
406+
407+
+breakpoint("desktop")
408+
padding: 30px 0;
409+
410+
.btn-download-ebook
411+
padding: 8px 24px;
412+
margin: 0px auto 0 11px;
413+
color: #fff;
414+
border-radius: 3px;
415+
background-color: #00b9f1;
416+
font-size: 14px;
417+
font-weight: bold;
418+
text-transform: uppercase;
419+
text-align: center;
420+
text-decoration: none;
397421

398422
// debugger-jwt
399423

views/index.jade

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ block content
5757
use(fill='#FFFFFF', fill-rule='evenodd', xlink:href='#path-1')
5858

5959
span.button-text Add to chrome
60-
60+
section.jtw-ebook-banner
61+
span
62+
strong Get the JWT Handbook for free!
63+
|Spread the word and download it now.
64+
a.btn.btn-download-ebook(href='https://auth0.com/e-books/jwt-handbook', target='_blank') Download Ebook
6165
section#debugger-io.debugger-jwt
6266
.container
6367
//- a(name='debugger')

0 commit comments

Comments
 (0)