Skip to content

Instantly share code, notes, and snippets.

@griv
Created June 14, 2016 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save griv/fa8b5ab591d335ff373668103d833920 to your computer and use it in GitHub Desktop.
Save griv/fa8b5ab591d335ff373668103d833920 to your computer and use it in GitHub Desktop.
/*
* arts action! by pvi collective
*
* adds content to end of <body> to cover site as a protest to arts funding cuts to independent artists.
* checks local time and only shows on national day of action, june 17th 2016
*
* author: steve berrick <mrberrick@pvicollective.com>
*
*/
// check for time - only show on Friday June 17th 2016
var d = new Date();
if (d.getFullYear() === 2016 && d.getMonth() === 5 && d.getDate() === 17) {
// make div
var artsActionDiv = document.createElement('div');
artsActionDiv.setAttribute('class', 'artsAction');
artsActionDiv.style.cssText = 'position:fixed; top:0; left: 0; bottom:0; right:0; background-color:rgba(246,152,157,0.97); z-index:99999; text-align:center; font-size:17px; font-family:Arial; font-weight:bold; color:#1b0b4d;';
// make banner image
var artsActionBanner = document.createElement('img');
artsActionBanner.style.cssText = 'padding:40px; width:77%; max-width:640px; display:block; margin-left:auto; margin-right:auto;';
artsActionBanner.src = 'http://action.pvicollective.com/protagonists.png';
artsActionDiv.appendChild(artsActionBanner);
// make text
var artsActionParagraph = document.createElement('div');
artsActionParagraph.style.cssText = 'padding:0px; margin:0px; width:77%; max-width:640px; text-align:center; margin-left:auto; margin-right:auto;';
artsActionParagraph.innerHTML = '<p>This site is ON STRIKE as a statement of solidarity with independent artists on this National Day of Action, June 17th 2016.</p><p>To know more, and to act, visit <a href="http://artprotagonists.com" target="_blank">artprotagonists.com</a></p><p>#artprotagonists</p><style>.artsAction a, .artsAction a:visited, .artsAction a:active { color:#1b0b4d; text-decoration:underline; }</style>';
artsActionDiv.appendChild(artsActionParagraph);
// add it all to the body
document.body.appendChild(artsActionDiv);
// that's it!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment