-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
59 lines (57 loc) · 1.83 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
<!DOCTYPE html>
<html>
<head>
<title>Contributors - Doocs Community</title>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/vue/dist/vue.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/[email protected]/dist/html2canvas.min.js"></script>
<link rel="stylesheet" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/element-ui/lib/theme-chalk/index.css">
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/element-ui/lib/index.js"></script>
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
</head>
<style>
.custom {
width: 60px;
height: 60px;
border-radius: 50%;
margin: 1px 1px;
}
</style>
<body>
<div id="app">
<div v-for="item in items" :key="item.id" style="display: inline-block;">
<a :href="generateLink(item.username)" target="_blank">
<el-tooltip class="item" effect="dark" placement="top" :content="item.username">
<img :src="item.avatar" class="custom" @load="handleImageLoad(item)" />
</el-tooltip>
</a>
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
items: [],
},
mounted() {
this.fetchData();
},
methods: {
fetchData() {
axios.get('contributors.json')
.then(response => {
this.items = response.data;
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
generateLink(username) {
return `https://github.com/${username}`;
},
}
});
</script>
</body>
</html>