-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.ejs
174 lines (173 loc) · 7.63 KB
/
user.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/css/bootstrap-select.css" />
<style>
body {
overflow-x: hidden;
}
.sideNav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
background-color: lightgrey;
top: 0;
left: 0;
overflow-x: hidden;
padding-top: 60px;
transition: 0.5s;
}
.sideNav a:hover {
color: #ffffff;
background-color: #999999;
}
.sideNav .closebtn {
position: absolute;
top: 2%;
right: 25px;
font-size: 36px;
margin-left: 50px;
cursor: pointer;
transition: 0.5s;
}
.cat {
position: absolute;
top: 0;
margin-left: 30%;
font-size: 130%;
}
#main {
transition: margin-left .5s;
margin-left: 10px;
margin-right: 10px;
}
.pad {
margin-left: 5%;
}
@media screen and (max-height: 450px) {
.sidenav {
padding-top: 15px;
}
.sidenav a {
font-size: 18px;
}
}
</style>
</head>
<body>
<div id="sideNav" class="sideNav">
<span class="closebtn" onclick="closeNav()">×</span>
<span class="cat">Categorias</span>
<div class="btn-group-vertical pad" role="group">
<button class="btn btn-primary">Classificar por</button>
</div>
</div>
<div id="main">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<!--<a class="navbar-brand">SaveGames</a>-->
<button class="navbar-toggler navbar-brand" type="button" onclick="openNav()" id="openbtn"><span class="navbar-toggler-icon"></span></button>
<span class="navbar-brand"><a class="btn btn-outline-secondary" href="/" role="button">SaveGames</a></span>
<div class="dropdown">
<button type="button" class="btn btn-dark dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<% if(user === null) { %>
<%= 'Area do usuario' %>
<% } else { %>
<%= user.name %>
<% } %>
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" id="loginbtn" href="/login">
<% if(user === 'no') { %>
<%= 'Login' %>
<% } else { %>
<%= 'Ja esta logado' %>
<% } %>
</a></li>
<li><a class="dropdown-item logged" id="posta" href="/postar">Enviar save</a></li>
<li><form action="/logout?_method=DELETE" method="POST"><button class="dropdown-item" id="logoutbtn" type="submit">Sair</button></form></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<% if(data !== null) { %>
<!--daqui-->
<% for(i=0; i < data.length; i++) { %>
<div class="col">
<div class="card card-r" style="max-width: 24rem; margin-bottom: 2rem; margin-right: 5rem;">
<img class="card-img-top" src=" <%= data[i].imgSrc %> " alt="GTA 5 thumbnail">
<div class="card-body">
<h5 class="card-title">
<%= data[i].title %>
</h5>
<p class="card-text">
<%= data[i].desc %>
</p>
<a href=" <%= data[i].url %> " class="btn btn-primary">Download</a>
</div>
</div>
</div>
<% } %>
<% } else { %>
<div> <%= 'Nenhum save adicionado ainda, se você é o dono desta conta, pode clicar em "Enviar Save" ' %> </div>
<% } %>
<!--ate aqui-->
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></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>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.js"></script>
<script>
var openNav, closeNav;
$(document).ready(() => {
if($("#navbarDropdown").width() < 160) {
$("#navbarDropdown").css({'width': '160px'});
}
console.log($("#loginbtn").html())
if($("#loginbtn").html().indexOf("esta") >= 0) {
$("#loginbtn").addClass('disabled')
} else {
$("#logoutbtn").hide();
$(".logged").addClass('disabled');
}
function respond() {
var wWidth = $(window).width();
var wHeight = $(window).height();
if (wWidth < 600) {
$("#sideNav").width(0);
$("#main").css({"margin-left":"0"});
$(".closebtn").css({"display": "" });
$("#openbtn").css("display", "");
openNav = function() {
document.getElementById("sideNav").style.width = "250px";
$("#sideNav").css({'width' : (wWidth / 2)})
//document.getElementById("main").style.marginLeft = "250px";
}
closeNav = function() {
document.getElementById("sideNav").style.width = "0";
//document.getElementById("main").style.marginLeft = "0";
}
} else {
$("#sideNav").width(250);
$(".closebtn").css({"display": "none" });
$("#openbtn").css("display", "none");
$("#main").css("margin-left", "260px");
}
}
respond();
$(window).resize(respond);
});
</script>
</body>
</html>