git.schokokeks.org
Repositories
Help
Report an Issue
tor-webwml.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
c27d7dd8d
Branches
Tags
bridges
docs-debian
jobs
master
press-clips
tor-webwml.git
js
donation_banner.js
Bug 20415: 2016 Donation banner
Arthur Edelstein
commited
c27d7dd8d
at 2016-11-18 02:24:39
donation_banner.js
Blame
History
Raw
/* jshint esnext:true */ var kTaglines = [ "Millions of People Depend on Tor for Online Security & Privacy", "A Network of People Protecting People", "Surveillance = Oppression", "Protecting Journalists, Activists & Whistleblowers Since 2006", ]; var kTaglineSizes = [ 26, 32, 32, 26, ]; var sel = function (selector) { return document.querySelector(selector) }; // Returns a random integer x, such that 0 <= x < max var randomInteger = function (max) { return Math.floor(max * Math.random()); }; // The main donation banner function. var runDonationBanner = function () { // Load random tag line once page is loaded var index = randomInteger(4); var taglineElement = sel("#banner-tagline span"); taglineElement.innerText = kTaglines[index]; taglineElement.style.fontSize = kTaglineSizes[index]; }; // Run banner code on load. window.addEventListener("load", runDonationBanner);