Skip to content

Instantly share code, notes, and snippets.

@sweinberg
Created May 2, 2013 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save sweinberg/5500333 to your computer and use it in GitHub Desktop.
Save sweinberg/5500333 to your computer and use it in GitHub Desktop.
A simple 'Donate' button that displays a dialog box with a copy-n-pasteable Bitcoin address, for easy sending from a wallet.
<!DOCTYPE html>
<html>
<head>
<style>
.text {
color:#333333;
font-family:arial;
font-size:35px;
font-weight:bold;
text-decoration:none;
text-shadow:0px 1px 0px #ffee66;
}
.myButton {
-moz-box-shadow:inset 0px 1px 0px 0px #fff6af;
-webkit-box-shadow:inset 0px 1px 0px 0px #fff6af;
box-shadow:inset 0px 1px 0px 0px #fff6af;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffec64), color-stop(1, #ffab23));
background:-moz-linear-gradient(top, #ffec64 5%, #ffab23 100%);
background:-webkit-linear-gradient(top, #ffec64 5%, #ffab23 100%);
background:-o-linear-gradient(top, #ffec64 5%, #ffab23 100%);
background:-ms-linear-gradient(top, #ffec64 5%, #ffab23 100%);
background:linear-gradient(to bottom, #ffec64 5%, #ffab23 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffec64', endColorstr='#ffab23',GradientType=0);
background-color:#ffec64;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #ffaa22;
display:inline-block;
color:#333333;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:0px 1px 0px #ffee66;
}
.myButton:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffab23), color-stop(1, #ffec64));
background:-moz-linear-gradient(top, #ffab23 5%, #ffec64 100%);
background:-webkit-linear-gradient(top, #ffab23 5%, #ffec64 100%);
background:-o-linear-gradient(top, #ffab23 5%, #ffec64 100%);
background:-ms-linear-gradient(top, #ffab23 5%, #ffec64 100%);
background:linear-gradient(to bottom, #ffab23 5%, #ffec64 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffab23', endColorstr='#ffec64',GradientType=0);
background-color:#ffab23;
}
.myButton:active {
position:relative;
top:1px;
}
</style>
</head>
<body>
<p id="demo" class="text">Please consider supporting us in Bitcoin.</p>
<button onclick="myFunction()" class="myButton">Donate</button>
<script>
function myFunction()
{
var x;
var r=confirm;javascript:window.prompt ('Please send a donation to our Bitcoin address:', '1BayBFcQP4D6iz3FSaEwqNDDcbbgnQFUtN');
if (r==true)
{
x="Thank you!";
}
else
{
x="Thank you!";
}
document.getElementById("demo").innerHTML=x;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment