JSFiddle - React, Tailwind, and code Playground
by kangismet
HTML
<button class='hide-download' style="display: none">Download</button>
<div class="g-plus likeButton" data-action="share" data-href="http://blog.kangismet.net"></div>
CSS
body {
text-align:center;
}
.likeButton {
display: block;
}
JavaScript
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
var clickedLinks = [];
$(document).ready(function() {
$(".likeButton").click(function(e) {
var clickedLink = e.currentTarget.innerText;
// If they haven't clicked this link before, add it to array
if (clickedLinks.indexOf(clickedLink) == -1) {
clickedLinks.push(clickedLink);
// If they've clicked 3, show the div
if (clickedLinks.length == 1) {
$("#promo").show();
}
}
});
});