From 9d440404eb7db2346db327fa7a373ce48934bb8f Mon Sep 17 00:00:00 2001 From: Chris Antaki Date: Thu, 12 Feb 2015 11:07:09 -0800 Subject: [PATCH] Added new experiments --- _src/js/PetitionForm.js | 4 +++ _src/js/index.js | 51 +++++++++++++++++++++++++++++++++++++- css/battle.css | 44 ++++++++++++++++++++++++++++++--- js/battle.js | 55 ++++++++++++++++++++++++++++++++++++++++- notes/experiments.txt | 14 +++++++++++ 5 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 notes/experiments.txt diff --git a/_src/js/PetitionForm.js b/_src/js/PetitionForm.js index 348155da9..d0861d49e 100755 --- a/_src/js/PetitionForm.js +++ b/_src/js/PetitionForm.js @@ -150,4 +150,8 @@ PetitionForm.prototype.addEventListeners = function() { }.bind(this), false); }; +PetitionForm.prototype.updateCTA = function updateCTA(cta) { + this.DOMNode.querySelector('button[type="submit"]').textContent = cta; +}; + module.exports = PetitionForm; diff --git a/_src/js/index.js b/_src/js/index.js index 4543ca784..f8efb54f9 100755 --- a/_src/js/index.js +++ b/_src/js/index.js @@ -28,6 +28,35 @@ var YourSenators = require('./YourSenators'); // Design enhancements (function(){ + if (global.experiments.alternateHeadline1) { + document.getElementById('battle').className += ' experiment-alternate-headline-1 '; + document.querySelector('#battle h1').textContent = '...Until the most important FCC vote of our lifetime.'; + } + + if (global.experiments.alternateExplanation1) { + document.querySelector('#battle p').textContent = 'The FCC votes February 26th. They\'re planning to *prohibit* ISPs like Comcast from messing with the sites you love. But Comcast\'s friends in Congress want to block the FCC, with fake legislation written... by Comcast. Tell Congress: "Back off, and let the FCC do net neutrality right."'; + } + + if (global.experiments.alternateExplanation2) { + document.querySelector('#battle p').textContent = 'The FCC is about to listen to the voices of over 4 million Americans and pass strong net neutrality. But Comcast\'s friends in Congress are threatening to block it. Can you contact Congress now?'; + } + + if (global.experiments.removeExplanation) { + document.querySelector('#battle p').textContent = ''; + } + + if (global.experiments.removeTimer) { + document.getElementById('battle').className += ' experiment-remove-timer '; + } + + if (global.experiments.removeHeadline) { + document.querySelector('#battle h1').textContent = ''; + } + + if (global.experiments.removeNavigation) { + document.body.className += ' experiment-remove-navigation '; + } + // Start the countdown setTimeout(function() { var countdownDelay = 0; @@ -112,9 +141,29 @@ var YourSenators = require('./YourSenators'); target: '#battle .form-wrapper' }); + if (global.experiments.alternatePetitionCTA1) { + petitionForm.updateCTA('WRITE CONGRESS'); + } + + if (global.experiments.alternatePetitionCTA2) { + petitionForm.updateCTA('WRITE CONGRESS NOW'); + } + + if (global.experiments.alternatePetitionCTA3) { + petitionForm.updateCTA('WRITE THEM NOW'); + } + + if (global.experiments.alternatePetitionCTA4) { + petitionForm.updateCTA('TAKE ACTION'); + } + + if (global.experiments.alternatePetitionCTA5) { + petitionForm.updateCTA('WRITE YOUR SENATORS'); + } + // Experiment: Remove Letter Preview if (global.experiments.removeLetterPreview) { - petitionForm.DOMNode.className += ' remove-letter-preview '; + document.getElementById('battle').className += ' experiment-remove-letter-preview '; } // Rotate organizations diff --git a/css/battle.css b/css/battle.css index ef7fc704b..1539d3826 100755 --- a/css/battle.css +++ b/css/battle.css @@ -165,6 +165,19 @@ body.loaded header nav a { opacity: 1; } + + +/* Experiment: Remove Navigation */ +body.experiment-remove-navigation { + padding: 20px 0 0; +} + +body.experiment-remove-navigation header { + display: none; +} + + + #battle .timer .card { -webkit-transition: background-color 0.6s ease-out; transition: background-color 0.6s ease-out; @@ -213,6 +226,19 @@ body.svg #battle .timer .card .number { text-transform: uppercase; } + + +/* Experiment: Remove Timer */ +#battle.experiment-remove-timer .timer { + display: none; +} + +#battle.experiment-remove-timer .spinner { + display: none; +} + + + body.slow .tk-bebas-neue, body.slow .tk-proxima-nova { font-family: arial, sans-serif !important; @@ -284,6 +310,10 @@ body.typekit #battle .timer .card .type { transition-delay: 0.4s; } +/* Experiment: Alternate Headline 1 */ +#battle.experiment-alternate-headline-1 .timer .tagline { + display: none; +} /* Politicians */ @@ -509,20 +539,26 @@ body #battle #petition .right:hover .edit { /* Experiment: Remove Letter Preview */ -body #battle .form-wrapper.remove-letter-preview { +body #battle.experiment-remove-letter-preview .form-wrapper { width: 320px; } -body #battle .form-wrapper.remove-letter-preview #petition { +body #battle.experiment-remove-letter-preview .form-wrapper #petition { width: 270px; } -body #battle .form-wrapper.remove-letter-preview #petition .right { +body #battle.experiment-remove-letter-preview .form-wrapper #petition .right { display: none; } +@media screen and (min-width: 500px) { + body #battle.experiment-remove-letter-preview .phone-call-form { + margin-left: -75px; + } +} + @media screen and (min-width: 520px) { - body #battle .form-wrapper.remove-letter-preview .politicians .politician:last-child { + body #battle.experiment-remove-letter-preview .form-wrapper .politicians .politician:last-child { left: 270px; top: 24px; } diff --git a/js/battle.js b/js/battle.js index 1e8b11c98..9527fb086 100755 --- a/js/battle.js +++ b/js/battle.js @@ -30,6 +30,35 @@ var YourSenators = require('./YourSenators'); // Design enhancements (function(){ + if (global.experiments.alternateHeadline1) { + document.getElementById('battle').className += ' experiment-alternate-headline-1 '; + document.querySelector('#battle h1').textContent = '...Until the most important FCC vote of our lifetime.'; + } + + if (global.experiments.alternateExplanation1) { + document.querySelector('#battle p').textContent = 'The FCC votes February 26th. They\'re planning to *prohibit* ISPs like Comcast from messing with the sites you love. But Comcast\'s friends in Congress want to block the FCC, with fake legislation written... by Comcast. Tell Congress: "Back off, and let the FCC do net neutrality right."'; + } + + if (global.experiments.alternateExplanation2) { + document.querySelector('#battle p').textContent = 'The FCC is about to listen to the voices of over 4 million Americans and pass strong net neutrality. But Comcast\'s friends in Congress are threatening to block it. Can you contact Congress now?'; + } + + if (global.experiments.removeExplanation) { + document.querySelector('#battle p').textContent = ''; + } + + if (global.experiments.removeTimer) { + document.getElementById('battle').className += ' experiment-remove-timer '; + } + + if (global.experiments.removeHeadline) { + document.querySelector('#battle h1').textContent = ''; + } + + if (global.experiments.removeNavigation) { + document.body.className += ' experiment-remove-navigation '; + } + // Start the countdown setTimeout(function() { var countdownDelay = 0; @@ -114,9 +143,29 @@ var YourSenators = require('./YourSenators'); target: '#battle .form-wrapper' }); + if (global.experiments.alternatePetitionCTA1) { + petitionForm.updateCTA('WRITE CONGRESS'); + } + + if (global.experiments.alternatePetitionCTA2) { + petitionForm.updateCTA('WRITE CONGRESS NOW'); + } + + if (global.experiments.alternatePetitionCTA3) { + petitionForm.updateCTA('WRITE THEM NOW'); + } + + if (global.experiments.alternatePetitionCTA4) { + petitionForm.updateCTA('TAKE ACTION'); + } + + if (global.experiments.alternatePetitionCTA5) { + petitionForm.updateCTA('WRITE YOUR SENATORS'); + } + // Experiment: Remove Letter Preview if (global.experiments.removeLetterPreview) { - petitionForm.DOMNode.className += ' remove-letter-preview '; + document.getElementById('battle').className += ' experiment-remove-letter-preview '; } // Rotate organizations @@ -1048,6 +1097,10 @@ PetitionForm.prototype.addEventListeners = function() { }.bind(this), false); }; +PetitionForm.prototype.updateCTA = function updateCTA(cta) { + this.DOMNode.querySelector('button[type="submit"]').textContent = cta; +}; + module.exports = PetitionForm; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) diff --git a/notes/experiments.txt b/notes/experiments.txt new file mode 100644 index 000000000..920c6ba3c --- /dev/null +++ b/notes/experiments.txt @@ -0,0 +1,14 @@ +global.experiments.removeActionBar +global.experiments.removeLetterPreview +global.experiments.alternateHeadline1 +global.experiments.removeHeadline +global.experiments.alternateExplanation1 +global.experiments.alternateExplanation2 +global.experiments.removeExplanation +global.experiments.removeTimer +global.experiments.removeNavigation +global.experiments.alternatePetitionCTA1 +global.experiments.alternatePetitionCTA2 +global.experiments.alternatePetitionCTA3 +global.experiments.alternatePetitionCTA4 +global.experiments.alternatePetitionCTA5