-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (118 loc) · 6.66 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootrstrap 5.3-->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>
<title>Prácticas</title>
<!-- CSS ICONS-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
</head>
<body onload="getRepositorie()">
<script type="text/javascript">
function getRepositorie() {
var request = new XMLHttpRequest();
request.open("GET", "https://api.github.com/users/guada8a/repos", true);
request.onload = () => show_list(JSON.parse(request.responseText));
console.log("consola" + request.responseText);
request.send();
}
function show_list(user) {
var repo = user.find(repo => repo.name == "PrograMovil");
console.log(repo);
//Titulo
var title = document.getElementById("title");
//Meter html a title
title.innerHTML = `<i class="bi bi-github"/> Repo: ${repo.name}`;
//Branch
var branch = document.getElementById("branch");
branch.append(repo.default_branch);
//Owner
var owner = document.getElementById("owner");
//Avater
var avatar = document.createElement("img");
avatar.setAttribute("src", repo.owner.avatar_url);
avatar.setAttribute("width", "20px");
avatar.setAttribute("height", "20px");
avatar.setAttribute("style", "border-radius: 50%;");
owner.appendChild(avatar);
owner.appendChild(document.createTextNode(` ${repo.owner.login}`));
owner.setAttribute("href", repo.owner.html_url);
//Enlace nueva pestaña
var enlace = document.getElementsByClassName("enlace")[0];
enlace.setAttribute("href", repo.html_url);
enlace.setAttribute("target", "_blank");
enlace.appendChild(document.createTextNode(` ${repo.html_url}`));
//Descripcion
var desc = document.getElementById("desc");
desc.appendChild(document.createTextNode(repo.description));
}
</script>
<nav class="container-fluid p-2 mb-2 bg-body-secondary">
<div class="row">
<div class="col-6 text-auto"></i>
<h2 id="title"></h2>
</div>
<div class="col-6 d-flex flex-row-reverse">
<p class="bg-success rounded-pill text-center lead" style="width: 5rem;" id="branch"></p>
</div>
</div>
</nav>
<div class="container">
<p id="data-collapse" class="h3" data-bs-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="true" aria-controls="multiCollapseExample1">Datos
<dl class="row collapse multi-collapse rounded-1 bg-body-secondary mt-2 show" id="multiCollapseExample1">
<dd class="col-sm-6 mt-2">
<dl class="row">
<dt class="col-sm-6">Asignatura:</dt>
<dd class="col-sm-6">Programación Móvil</dd>
<dt class="col-sm-6">Propietario:</dt>
<dd class="col-sm-6"><a id="owner" class="text-decoration-none"></a></dd>
</dl>
</dd>
<dd class="col-sm-6 mt-2">
<dl class="row">
<dt class="col-sm-4">Descripción</dt>
<dd class="col-sm-8" id="desc"></dd>
<dt class="col-sm-4">Enlace</dt>
<dd class="col-sm-8"><i class="bi bi-github"></i><a class="enlace text-decoration-none"></a></dd>
</dl>
</dd>
</dl>
<div class="row">
<div class="col col-md-12 text-center user-list">
<h5 class="display-5 lead text-center">Prácticas</h5>
<hr>
<div id="list" class="row row-mt4 justify-content-between">
<script>
for(let i=0; i<4; i++){
document.write(`
<div class='col col-md-3 col-sm-6 col-xs-12 mb-4'>
<div class='card'>
<div class='card-header'><h4 class='card-title'>Práctica B${i+1}</h4></div>
<div class='card-body'>
<a href='https://github.com/Guada8a/PrograMovil/tree/main/p${i+1}' class='btn btn-outline-success rounded-pill mb-2 mx-2' target='_blank'>Ir a ruta</a>
<a href='https://guada8a.github.io/PrograMovil/p${i+1}/' class='btn btn-outline-warning rounded-pill mb-2' target='_blank'>Deployment</a>
</div>
</div>
</div>`);
}
document.write(`
<div class='col col-md-3 col-sm-6 col-xs-12 mb-4'>
<div class='card'>
<div class='card-header'><h4 class='card-title'>Práctica B4_v2</h4></div>
<div class='card-body'>
<a href='https://github.com/Guada8a/PrograMovil/tree/main/p4_again' class='btn btn-outline-success rounded-pill mb-2 mx-2' target='_blank'>Ir a ruta</a>
<a href='https://guada8a.github.io/PrograMovil/p4_again/' class='btn btn-outline-warning rounded-pill mb-2' target='_blank'>Deployment</a>
</div>
</div>
</div>`);
</script>
</div>
</div>
</div>
</div>
</body>
</html>