voteamerica / voteamerica.github.io

Front end for the Carpool Vote website. Support every American's right to vote!
http://www.carpoolaction.org/
MIT License
38 stars 50 forks source link

Replace Facebook & Twitter widgets in the header with plain styled links #337

Closed richardwestenra closed 6 years ago

richardwestenra commented 6 years ago

image At present, the Facebook and Twitter buttons in the header are generated with the official widgets. However these require an unnecessarily large JS download, and they load slower than the Youtube link (which is currently hard-coded and styled with CSS). So, let's remove the widget JS and make our own, faster buttons! Copy the Youtube button styling but change the icon, text and background colour (remember to add a hover colour too). You can make the link something like this:

<a href="[URL]" onClick="MyWindow=window.open('[URL]','MyWindow',width=600,height=400); return false;">[Button text]</a>

For the [URL], you'll want to get the current URL that each one directs to. If you have a clever solution for generating the URL without needing a whole load of JS, I'm open to it!

mikeesto commented 6 years ago

Hi. I can work on this! Should have a PR done within the next couple of hours.