2018-11-26 17:42:55 +08:00
|
|
|
<!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>
|
2018-11-26 18:50:40 +08:00
|
|
|
const arr = sliceArr(list.reverse(), 5)
|
2018-11-26 17:42:55 +08:00
|
|
|
const html = `<table><tbody>
|
|
|
|
${arr.map(subArr => {
|
|
|
|
let tds = subArr.map(info => {
|
2018-11-26 18:44:33 +08:00
|
|
|
return `<td><a target="_blank" href="https://github.com${info.author.path}"><img width="60px" src="${info.author.avatar}"></a></td>`
|
2018-11-26 17:42:55 +08:00
|
|
|
})
|
|
|
|
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>
|