Skip to content

Commit

Permalink
Added new experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisAntaki committed Feb 12, 2015
1 parent e4f5f2b commit 9d44040
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 6 deletions.
4 changes: 4 additions & 0 deletions _src/js/PetitionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
51 changes: 50 additions & 1 deletion _src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
44 changes: 40 additions & 4 deletions css/battle.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}
Expand Down
55 changes: 54 additions & 1 deletion js/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 : {})
Expand Down
14 changes: 14 additions & 0 deletions notes/experiments.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9d44040

Please sign in to comment.