Skip to content

Commit

Permalink
Fixes scroll jump when clicking buttons in demo site. Clicking demo b…
Browse files Browse the repository at this point in the history
…uttons toggles icon version.
  • Loading branch information
smcllns committed Apr 28, 2019
1 parent 6e468e0 commit ec2df0c
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .fontcustom-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"checksum": {
"previous": "e917b0d2afe7f0e6263faf9c8a168855584a121161c902c816fb7b4701405b14",
"current": "e917b0d2afe7f0e6263faf9c8a168855584a121161c902c816fb7b4701405b14"
"previous": "e29477d791915347e3972b017c4157b6cb80af31d0f648e5cc2b1089d92e8dfc",
"current": "e29477d791915347e3972b017c4157b6cb80af31d0f648e5cc2b1089d92e8dfc"
},
"fonts": [
"./css/zocial.ttf",
Expand Down
3 changes: 2 additions & 1 deletion css/zocial.css

Large diffs are not rendered by default.

Binary file modified css/zocial.eot
Binary file not shown.
4 changes: 2 additions & 2 deletions css/zocial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified css/zocial.ttf
Binary file not shown.
Binary file modified css/zocial.woff
Binary file not shown.
Binary file modified css/zocial.woff2
Binary file not shown.
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ <h2 id="icons">Icon versions</h2>
<p>Under MIT License. <a href="https://github.com/smcllns/css-social-buttons">Zocial on Github.</a></p>

<script type="text/javascript">
// interactive demo button
var sizeInput = document.getElementById('font-size-range');
var sizeDisplay = document.getElementById('font-size-display');
var labelInput = document.getElementById('label-input');
Expand All @@ -360,6 +361,18 @@ <h2 id="icons">Icon versions</h2>
showcaseButton.classList.toggle('icon');
})
}

// interactive button list
var buttons = document.getElementById('samples').querySelectorAll('.zocial');
for (var i = 0; i < buttons.length; i++) {
buttons[i].addEventListener('click', function(e) {
e.preventDefault();
this.classList.toggle('icon');
})
}



</script>

</body>
Expand Down
1 change: 1 addition & 0 deletions templates/zocial.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ a.zocial {
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
white-space: nowrap;
vertical-align: middle;

-moz-user-select: none;
-webkit-user-select: none;
Expand Down

0 comments on commit ec2df0c

Please sign in to comment.