Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First design pass #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports.controller = function(app) {
// TODO: add constraint for pour frequency and amount
console.log("User with IP " + req.connection.remoteAddress + " has poured " + req.body.pour_amount + " to address " + req.body.wallet_address);
console.log("req.body.pour_amount: " + req.body.pour_amount + " config.bit_limit: " + config.bit_limit);
if (req.body.pour_amount <= config.bit_limit) {
btcClient.getBalance('*', 1, function(err, balance, resHeaders) {
if (req.body.pour_amount <= config.bit_limit && balance>=req.body.pour_amount) {
btcClient.sendToAddress(req.body.wallet_address, parseFloat(req.body.pour_amount), function(err, txid) {
if (err) return console.error(err);
var pour = new Pour({
Expand All @@ -47,9 +48,14 @@ module.exports.controller = function(app) {
});
});
});
} else if (balance<req.body.pour_amount) {
pourMessage = "You tried to pour more than the available balance.";
res.render('index', {balance: btcBalance, message: pourMessage, faucet_address: config.faucet_address, net_name: config.name});

} else {
pourMessage = "You tried to pour too much! Don't be stingy...";
res.render('index', {balance: btcBalance, message: pourMessage, faucet_address: config.faucet_address, net_name: config.name});
};
}
});
});
}
66 changes: 66 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>New Bitfaucet Layout</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body class = "body">

<div class="header">
<svg width="110px" height="250px" viewBox="0 0 128 208" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<!-- Generator: Sketch 3.3.2 (12043) - http://www.bohemiancoding.com/sketch -->
<title>dripping-faucet</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Desktop-HD-Copy" sketch:type="MSArtboardGroup" transform="translate(0.000000, -45.000000)">
<g id="dripping-faucet" sketch:type="MSLayerGroup" transform="translate(63.500000, 149.000000) scale(-1, 1) translate(-63.500000, -149.000000) translate(-1.000000, 45.000000)">
<path d="M59.4050076,3.60061728 L59.4050076,5.95617284 C58.8227335,5.3279043 58.010034,4.9337963 57.0968081,4.9337963 L33.0709098,4.9337963 C31.2969358,4.9337963 29.874331,6.40888968 29.874331,8.23811728 L29.874331,10.2828704 C29.874331,12.112098 31.2969358,13.5871914 33.0709098,13.5871914 L57.0968081,13.5871914 C58.010034,13.5871914 58.8227335,13.1930834 59.4050076,12.5648148 L59.4050076,22.1587963 C56.5640522,23.0121722 54.4951261,25.7024339 54.4951261,28.9146605 L54.4951261,39.4819444 L50.6560589,39.4819444 C46.8715787,39.4819444 43.8187118,42.6217194 43.8187118,46.5240741 L43.8187118,52.6910494 L22.1961965,52.6910494 C15.7254454,52.6910494 10.4235171,57.6716596 9.6875,64.1334877 L9.60024847,105.974383 L7.22859327,105.974383 C3.32584697,105.974383 0.185015291,109.213041 0.185015291,113.237346 C0.185015291,117.26165 0.629204893,117.367747 0.629204893,117.367747 L50.1642775,117.367747 C50.1642775,117.367747 50.6084671,117.26165 50.6084671,113.237346 C50.6084671,109.213041 47.3409272,104.957267 43.5648891,105.974383 L41.6215596,105.974383 L41.6215596,78.6594136 L115.713972,78.6594136 L115.713972,106.268827 C115.713972,110.171182 118.758907,113.319136 122.543387,113.319136 C122.809408,113.319136 123.070721,113.300291 123.328651,113.270062 L128.873089,113.319136 L128.873089,29.3563272 L123.328651,29.3563272 C123.070483,29.3751245 122.809662,29.3563272 122.543387,29.3563272 C118.758907,29.3563272 116.871588,32.6831489 115.713972,36.3984568 L115.713972,52.6910494 L81.392393,52.6910494 L81.392393,46.5240741 C81.392393,42.6217194 78.347458,39.4819444 74.5629778,39.4819444 L70.7159786,39.4819444 L70.7159786,28.9146605 C70.7159786,25.6996962 68.650799,23.0097512 65.8060971,22.1587963 L65.8060971,12.5239198 C66.3903486,13.1766468 67.2285648,13.5871914 68.1618884,13.5871914 L92.1798547,13.5871914 C93.9538287,13.5871914 95.3843654,12.112098 95.3843654,10.2828704 L95.3843654,8.23811728 C95.3843654,6.40888968 93.9538287,4.9337963 92.1798547,4.9337963 L68.1618884,4.9337963 C67.2285648,4.9337963 66.3903486,5.34434084 65.8060971,5.9970679 L65.8060971,3.60061728 C65.8060971,1.77138968 64.3834923,0.296296296 62.6095183,0.296296296 C60.8355444,0.296296296 59.4050076,1.77138968 59.4050076,3.60061728 Z" id="path3783" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>
<path d="M7.03029434,189.801698 C7.28788116,202.876305 16.5060363,207.727543 24.5361239,207.852778 C33.406542,207.991117 41.7052602,203.413521 41.6215596,189.768981 C41.5441057,177.142565 29.5124282,171.575178 25.4958907,146.837346 C20.0570352,171.629866 6.72114092,174.109745 7.03029434,189.801698 Z" id="rect2985" fill="#8BE865" sketch:type="MSShapeGroup"></path>
<path d="M31.9704632,186.949861 C32.2252084,185.108291 30.8022743,184.146224 28.855293,183.492879 L29.4594031,180.997966 L27.9200141,180.635395 L27.3377393,183.072872 C26.9301469,182.975948 26.5189154,182.882613 26.111323,182.803637 L26.6935978,180.36616 L25.1360127,180 L24.5355418,182.498504 C24.204373,182.423118 23.8732042,182.365681 23.5420354,182.286705 L23.5420354,182.286705 L21.4203716,181.787722 L21.0309754,183.399544 C21.0309754,183.399544 22.1809681,183.650831 22.1409367,183.66878 C22.7632429,183.823141 22.8796979,184.225199 22.8615018,184.533923 L22.1809681,187.377047 C22.2209995,187.394996 22.279227,187.394996 22.3374544,187.434484 C22.279227,187.416535 22.2391956,187.416535 22.1809681,187.394996 L21.2456892,191.36891 C21.1692656,191.559169 20.9727479,191.828404 20.5433202,191.73507 C20.5615163,191.753019 19.4151628,191.465834 19.4151628,191.465834 L18.6764016,193.210479 L20.6816105,193.669974 C21.0528107,193.766899 21.4203716,193.842285 21.7733757,193.939209 L21.1692656,196.455662 L22.7086546,196.821822 L23.3127647,194.326908 C23.7421924,194.441782 24.1497848,194.538707 24.539181,194.635631 L23.9350709,197.112596 L25.4744599,197.478756 L26.07857,194.962303 C28.7060851,195.421798 30.6712625,195.21359 31.4682511,192.851499 C32.1087534,190.970441 31.4100237,189.8935 30.0089249,189.182719 C31.0351843,188.949382 31.7739454,188.296037 31.9704632,186.949861 L31.9704632,186.949861 Z M28.5059281,191.846353 C28.0583044,193.727411 24.8266792,192.747394 23.7967807,192.499698 L24.5937693,189.15759 C25.6455032,189.408877 28.9717479,189.868371 28.5059281,191.846353 L28.5059281,191.846353 Z M28.9317166,186.949861 C28.5241242,188.658607 25.8383817,187.832953 24.9613303,187.621154 L25.7000914,184.58777 C26.5589467,184.799568 29.3611442,185.165728 28.9317166,186.949861 L28.9317166,186.949861 Z" id="Bitcoin_Symbol_1_" fill="#FFFFFF" sketch:type="MSShapeGroup" transform="translate(25.338201, 188.739378) scale(-1, 1) translate(-25.338201, -188.739378) "></path>
</g>
</g>
</g>
</svg>

<div class="container">

<div class="logo">
<h1> <a href="#">Bitfaucet</h1></a>
<h3> An open source testnet faucet </h3>
</div>

<div class="nav">
<p id="nav-amount">100000000000 BTC</p>
<p><small><h4> CURRENT BALANCE <h4/><small/></p>
</div>

</div>

</div>


<div class="container">
<div class="content">
<h2>An open source testnet bitcoin wallet.</h2>
<p>We built it because you need it.</p>
</div>

<div class= "content">
<p> AMOUNT <p>
<input type= "text"/>
<p> WALLET ADDRESS <p>
<input type= "text"/>
<div>
<input class="button" value="SEND TESTNET COIN" type="submit" />
</div>
</div>
</div>

<div class="footer">
bitpay
</div>

</body>
</html>
26 changes: 26 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 error [email protected] start: `node ./bin/www`
9 error Exit status 8
10 error Failed at the [email protected] start script.
10 error This is most likely a problem with the bitfaucet package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node ./bin/www
10 error You can get their info via:
10 error npm owner ls bitfaucet
10 error There is likely additional logging output above.
11 error System Darwin 12.5.0
12 error command "node" "/usr/local/bin/npm" "start"
13 error cwd /Users/aksayamanickandan/Documents/bitfaucet
14 error node -v v0.10.28
15 error npm -v 1.4.9
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]
2 changes: 1 addition & 1 deletion public/stylesheets/style.css

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions public/stylesheets/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ body {
margin-right: auto;
text-align: center;
}

.page-header {
margin-left: auto;
margin-right: auto;
margin-left: 80;

}
.container-narrow {
text-align: center;
Expand Down Expand Up @@ -47,6 +48,9 @@ body {
}
}




@import "responsive-embed.less";
@iconSpritePath: "/images/bootstrap/glyphicons-halflings.png";
@iconWhiteSpritePath: "/images/bootstrap/glyphicons-halflings-white.png";
106 changes: 106 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
body {
width: 110.5%;
margin: auto;
}


.container {
width: 960px;
margin: 0 auto;
margin-top: -22px;
font-family: Geneva;
font-size: 15px;
color: #7A7A7A;
display: flex;
margin-right: 250px
}

input[type="text"] {
display: block;
margin: 0;
width: 60%;
height: 38px;
font-family: Geneva;
font-size: 13px;
appearance: none;
box-shadow: none;
border-radius: 4px;
padding-left: 170px;
padding-right: 20px;
}

.header {
background: linear-gradient(to right, #94E863 , #71DB92);
width: 100%;
height: 200px;
}

.logo {
float: left;
font-size: 15px;
margin-top: -225px;
color: white;
text-shadow: 2px 2px #68B059;
padding-top: 10px;
padding-left:25px;
}

.nav {
margin-top: -193px;
color: white;
padding-top: -50px;
padding-left: 452px;
text-align: right;
font-size: 15px;
text-shadow: 1px 1px #68B059;
}

#nav-amount {
font-size: 27px;
}

.button {
padding:15px 60px 15px 60px;
background-color: #78DC8B;
border: 1px solid #78DC8B;
color: #FFFFFF;
text-decoration:none;
border-radius: 5px;
margin-top: 60px;
padding-left: 75px;
font-size: 12px;
margin-left: 230px;
}

a {
text-decoration: none;
color:white;
}

.content {
margin-top: 75px;
padding: 0px 60px 50px 25px;
}

.class {
margin-right: 500px;
}

.content p {
font-size: 16px;
}

.footer {
padding-left: 265px;
padding-top: 20px;
font-size: 20px;
background-color: #4A4A4A;
color: white;
font-family: Trebuchet MS ;
font-style: italic;
height: 50px;
position:absolute;
bottom:0px;
width:100%;
width: 90.2%
}
2 changes: 1 addition & 1 deletion views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ block content
p.lead Amount&nbsp
input.form-control(type="number", step="any", name="pour_amount", max="#{bit_limit}", min="0")
h6 (You can withdrawl up to #{bit_limit}btc per request)
p
pnew bitfaucet
button.btn.btn-large.btn-success(type="submit") Get Bit
p
hr
Expand Down
2 changes: 1 addition & 1 deletion views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ html
.container-narrow
block content
div.page-header
small Welcome to BitFaucet
small An open source testnet bitcoin wallet