Skip to content

Commit

Permalink
dureja
Browse files Browse the repository at this point in the history
  • Loading branch information
Naman Dureja authored and Naman Dureja committed Jan 9, 2022
1 parent 031d529 commit 2836a78
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 53 deletions.
3 changes: 1 addition & 2 deletions public/css/players.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ textarea:focus, input:focus, select:focus{
z-index: 30;
opacity: 0;
background-size: contain;

}

.elim-box{
Expand All @@ -350,7 +349,7 @@ textarea:focus, input:focus, select:focus{
flex-direction: column;
justify-content: center;
align-items: center;
padding-bottom: 40px;
padding-bottom: 30px;
padding-top: 10px;
z-index: 100;
border-radius: 6px;
Expand Down
3 changes: 2 additions & 1 deletion public/css/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ textarea:focus, input:focus, select:focus{
font-size: 24px;
margin-top: 10px;
font-weight: 600;
white-space: nowrap;
}
.header{
display: flex;
Expand Down Expand Up @@ -80,7 +81,7 @@ textarea:focus, input:focus, select:focus{
padding: 7px 10px;
font-weight: 300;
overflow: scroll;
width: 180px;
width: 260px;
font-size: 20px;
}

Expand Down
Binary file added public/user-2-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions routes/vip.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ router.use((req, res, next) => {

router.get("/", (req, res) => {
// console.log(req.user);
return res.render("vipDashboard");
return res.render("profile", { money: req.user.money, name: req.user._id, walletAddress: req.user.walletAddress });
});

router.get("/players", async (req, res) => {
Expand Down Expand Up @@ -81,13 +81,15 @@ router.post("/bet", async (req, res) => {
if (!req.user.bets[currentGame.game_no]) {
req.user.bets[currentGame.game_no] = {}
}
if(req.user.bets[currentGame.game_no][req.body.playerId]){
return res.json({error:true,message:"You have already placed a bet on this player"});
}
req.user.bets[currentGame.game_no][req.body.playerId] = parseInt(req.body.betAmount);
req.user.markModified('bets');
await req.user.save();
// console.log(req.user.bets);
return res.send("success");
})

return res.json({error:false,message:"Bet placed successfully!"})
});


module.exports = router;
5 changes: 0 additions & 5 deletions views/accessCode.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@300;400;700&display=swap" rel="stylesheet">
<<<<<<< HEAD
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/access.css">
=======
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/access.css">
>>>>>>> 565f894d306fdd2045df48206e5061843a72050b
<script src="https://cdnjs.cloudflare.com/ajax/libs/parallax/3.1.0/parallax.min.js"></script>
<!-- CSS only -->

Expand Down
73 changes: 64 additions & 9 deletions views/profile.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,24 @@
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@300;400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/profile.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/parallax/3.1.0/parallax.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<style>
#scene{
opacity: 0.8;
}
</style>
</head>
<body>
<nav>
<div class="nav-wrap">
<a href="/vip/players" class="nav">Dashboard</a>
<a href="/vip/games" class="nav">Games</a>
</div>
<div class="user-log active" onclick="openProfile()">
<img src="./user-2.png">
<img src="./user-2-red.png">
&nbsp; Profile
</div>
</nav>
Expand All @@ -41,17 +47,16 @@
<div class="label">
<i class="fas fa-wallet"></i>&nbsp; Connected Wallet
</div>
<div class="val" id="wallet" >
https://www.google.com/fbwaubfnkjawnfakjn
</div>
<a class="val" href="" id="wallet" target="_blank">
</a>
</div>
</div>
<div class="logout" onclick="logout()">
Logout &nbsp;<i class="fas fa-sign-out-alt"></i>
</div>
</div>

<div class="content">
<div class="content" style="display: flex;">
<h1>You have to pay the following amount: </h1>
<h2>$ 42,30400,3004</h2>
<p>Scan the QR Code to pay with your Bitcoin wallet. </p>
Expand All @@ -62,10 +67,60 @@
<div class="blank">
Squid Game
</div>

<div id="scene" style="top: 100px;">
<div data-depth="0.5">
<div class="l1">
<img id="e2" src="../ellipse.png" width="50">
<img id="s2" src="../square.png" width="50">
<img id="t2" src="../triangle.png" width="50">
<img id="e4" src="../ellipse.png" width="50">
<img id="e3" src="../ellipse.png" width="40">
<img id="s3" src="../square.png" width="50">
<img id="t3" src="../triangle.png" width="50">
<img id="s4" src="../square.png" width="50">
<img id="t4" src="../triangle.png" width="50">
</div>
</div>
<div data-depth="0.2">
<div class="l1">
<img id="e1" src="../ellipse.png" width="40">
<img id="s1" src="../square.png" width="50">
<img id="t1" src="../triangle.png" width="50">

</div>
</div>
</div>

<script type="text/javascript">
function logout(){
window.location.href='/auth/logout'
}
$('.content').hide()
var money =<%-JSON.stringify(money)%>;
var userName =<%-JSON.stringify(name)%>;
var walletAddress =<%-JSON.stringify(walletAddress)%>;
var scene = document.getElementById('scene');
var parallaxInstance = new Parallax(scene);
if(money<0)
{
console.log("hello")
$('.content h2').html(''+(money*(-1)).toLocaleString('en-IN'))
$('.content').show()
$('.blank').hide()
$('#scene').hide()
}else if(money>0){
console.log("hello")
$('.content h1').html("You will recieve the following amount: " );
$('.content h2').html(''+(money).toLocaleString('en-IN'))
$('.content p').hide()
$('.content img').hide()
$('.content').show()
$('.blank').hide()
}
$('#codename').html(userName);
$('#wallet').html('https://www.blockchain.com/btc-testnet/address/'+walletAddress);
document.getElementById('wallet').href='https://www.blockchain.com/btc-testnet/address/'+walletAddress;
function logout(){
window.location.href='/auth/logout'
}
</script>
</body>
</html>
10 changes: 0 additions & 10 deletions views/staff.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@300;400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/staff.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Expand Down Expand Up @@ -163,17 +162,8 @@
<button type="submit" value="edit" form="edit-form">Save Changes</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>
<script>
var notyf = new Notyf({
position: {
x: 'center',
y: 'bottom',
}
});
// Display an error notification
notyf.success('Created Successfully');
$('.bg-overlay').hide();
$('.create-dialog').hide();
$('.edit-dialog').hide();
Expand Down
15 changes: 12 additions & 3 deletions views/vipGames.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@

<body>
<nav>
<a href="/vip/" class="nav">Dashboard</a>
<a href="/vip/players" class="nav">Players</a>
<a href="/vip/games" class="nav active">Games</a>
<div class="nav-wrap">
<a href="/vip/players" class="nav">Dashboard</a>
<a href="/vip/games" class="nav">Games</a>
</div>
<div class="user-log active" onclick="openProfile()">
<img src="./user-2-red.png">
&nbsp; Profile
</div>
</nav>

<section style="display: flex; justify-content: space-between;flex-direction:column">
Expand Down Expand Up @@ -175,6 +180,10 @@
}
renderData(data.games)
function openProfile(){
window.location.href='/vip'
}
</script>

</body>
Expand Down
Loading

0 comments on commit 2836a78

Please sign in to comment.