-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathmorepage.html
More file actions
227 lines (194 loc) · 7.39 KB
/
morepage.html
File metadata and controls
227 lines (194 loc) · 7.39 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Document</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Quicksand:wght@500;600;700&display=swap');
* {
font-family: "Poppins", sans-serif;
margin: 0;
padding: 0;
}
.btn {
width: 90px;
height: 30px;
font-size: 11px;
}
.fa {
margin-right: 10px;
}
.card {
margin: 0;
padding: 0px;
position: relative;
width: 100%;
height: 100%;
cursor: pointer;
transform-style: preserve-3d;
transform-origin: center right;
transition: transform 1s;
perspective: 600px;
}
.card__face {
position: absolute;
width: 100%;
height: 100%;
text-align: center;
font-weight: bold;
font-size: 14px;
backface-visibility: hidden;
text-align: center;
border-radius: 10px;
}
.card__face--front {
width: 100%;
height: 100%;
}
.card__face--back {
transform: rotateY(180deg);
}
.card.is-flipped {
transform: translateX(-100%) rotateY(-180deg);
}
#card-ul {
display: flex;
list-style-type: upper-greek;
/* margin-top: 20px; */
flex-direction: column;
padding-top: 20px;
align-items: flex-start;
height: 80%;
margin-left: 20px;
font-size: 12px;
}
#span-text {
border-bottom: 2px solid #0275d8;
width: 200px;
margin-left: 30px;
padding-top: 5px;
}
.class-li {
padding: 3px;
}
.main-content-diff{
display: grid;
grid-template-columns: auto auto;
justify-content: space-evenly;
align-content: center;
margin-top: 20px;
}
#text-content {
padding-top: 7px;
font-size: 12px;
text-align: start;
}
#text-content-sha{
max-width: 180px;
font-size: 11px;
text-align: start;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark bg-dark mt-10"
style="display:flex;justify-content: flex-start; align-items: center;width: 80%;position: relative; bottom: 10px; left: 9%;">
<img src="https://avatars.githubusercontent.com/u/6811672?v=4" width="50" height="50" class="d-inline-block"
style="margin-left: 30px;" alt="">
<a class="navbar-brand" href="#" style="font-weight:900;margin-top: 20px;font-size: large;">
Github
</a>
</nav>
<div>
<h1 class="display-4 my-4 text-center" style="font-weight: 500;">
</h1>
</div>
<div class="container" style="width: 100%;" id="card-lists">
<div class="row" id="panel" style="width: 100%;">
</div>
</div>
</body>
<script>
const username = "******";
const password = "******"
const header = {
"Authorization": `Basic ${btoa(`${username}:${password}`)}`
}
let content = " ";
fetch("https://api.github.com/repos/larymak/Python-project-Scripts/contents", {
"method": "GET",
"headers": header
})
.then(response => response.json())
.then(jsonData => {
let data = jsonData
console.log(jsonData)
data.forEach((p) => {
content += `
<div class="card border-primary mb-3" style="max-width: 250px;margin:10px;height:200px">
<div class="card__face card__face--front">
<div class="card-header" style="display:flex;justify-content:space-between">
<text style="font-size:12px;"> ${p.name}</text>
<button type="button"
class="btn btn-outline-primary"
onclick= "viewDetail('${p.name}')"
id="ViewMore"
style="width:50px;float:right;height:20px;display:flex;justify-content:center;align-items:center;">More</button>
</div>
<div class="main-content-diff">
<text id="text-content">SHA: </text>
<text id="text-content-sha">${p.sha}</text>
<text id="text-content">Size: </text>
<text id="text-content">${p.size}</text>
<text id="text-content">Type: </text>
<text id="text-content">${p.type}</text>
</div>
</div>
<div class="card__face card__face--back">
<div id="span-text">
<span>File Details</span>
</div>
<div class="list-card">
<ul id="card-ul">
</ul>
</div>
</div>
</div>
`
});
document.querySelector("#panel").innerHTML = content;
var cards = document.querySelectorAll('.card');
[...cards].forEach((card, i) => {
card.addEventListener('click', function () {
card.classList.toggle('is-flipped');
});
})
}).catch(err => {
console.log("Error: ", err);
})
function viewDetail(name) {
fetch("https://api.github.com/repos/larymak/Python-project-Scripts/contents/" + name)
.then(response => response.json())
.then(jsonData => {
let content1 = " ";
Array.from(jsonData, child => {
jsonData.forEach(element => {
content1 += `<li class="class-li">'${element.name}'</li>`
});
document.querySelector("#card-ul").innerHTML = content1;
});
});
}
</script>
</html>