40 lines
997 B
HTML
40 lines
997 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head lang="en">
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
|
|
<title></title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div></div>
|
|
<script src="./list.js"></script>
|
|
<script>
|
|
const arr = sliceArr(list.reverse(), 5)
|
|
const html = `<table><tbody>
|
|
${arr.map(subArr => {
|
|
let tds = subArr.map(info => {
|
|
return `<td><a target="_blank" href="https://github.com${info.author.path}"><img width="60px" src="${info.author.avatar}"></a></td>`
|
|
})
|
|
return `<tr>${tds.join('')}</tr>`
|
|
}).join('')}</tbody></table>`
|
|
console.log(html)
|
|
document.querySelector('div').innerHTML = html
|
|
|
|
|
|
|
|
function sliceArr(array, size) {
|
|
var result = [];
|
|
for (let x = 0; x < Math.ceil(array.length / size); x++) {
|
|
let start = x * size;
|
|
let end = start + size;
|
|
result.push(array.slice(start, end));
|
|
}
|
|
return result;
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |