git.schokokeks.org
Repositories
Help
Report an Issue
tor-webwml.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
7f17ea251
Branches
Tags
bridges
docs-debian
jobs
master
press-clips
tor-webwml.git
js
donation_banner.js
Bug 23484: 2017 Homepage donation banner
Arthur Edelstein
commited
7f17ea251
at 2017-10-25 09:20:31
donation_banner.js
Blame
History
Raw
/* jshint esnext:true */ let kTaglines = [ "Protecting Journalists, Whistleblowers, & Activists Since 2006", "Networking Freedom Worldwide", "Freedom Online", "Fostering Free Expression Worldwide", "Protecting the Privacy of Millions Every Day", ]; let kTaglineSizes = [ 30, 40, 48, 36, 36, ]; // Returns a random integer x, such that 0 <= x < max let randomInteger = function (max) { return Math.floor(max * Math.random()); }; // The main donation banner function. let runDonationBanner = function () { // Load random tag line once page is loaded let index = randomInteger(kTaglines.length); let taglineElement = document.querySelector("#banner-tagline span"); taglineElement.innerText = kTaglines[index]; taglineElement.style.fontSize = kTaglineSizes[index] + "px"; }; runDonationBanner();