11<script setup>
22import contributors from ' ../../contributors.json'
33// console.debug('%c Contributors', 'color: Cyan', 'contributors:', contributors)
4- const imageStyle = {}
4+
55const props = defineProps ({
6- size: { type: String , default: null },
6+ size: { type: String , default: ' 64' },
7+ margin: { type: String , default: null },
8+ heading: { type: String , default: null },
79})
8- if (props .size ) {
9- imageStyle .height = props .size
10- imageStyle .width = props .size
11- }
10+
11+ const outerStyle = { margin: props .margin }
12+ console .log (' outerStyle:' , outerStyle)
13+ const imageStyle = { width: ` ${ props .size } px` , height: ` ${ props .size } px` }
14+ console .log (' imageStyle:' , imageStyle)
1215 </script >
1316
1417<template >
15- <div class =" contributors" >
16- <a
17- v-for =" { login, avatar_url } of contributors"
18- :key =" login"
19- :aria-label =" `${login} on GitHub`"
20- :href =" `https://github.com/${login}`"
21- target =" _blank"
22- rel =" noopener noreferrer"
23- >
24- <img :alt =" login" :src =" avatar_url" :style =" imageStyle" loading =" lazy" />
25- </a >
18+ <div class =" vp-contributors" :style =" outerStyle" >
19+ <div class =" vp-contributors-heading" v-if =" props.heading" >{{ props.heading }}</div >
20+ <div class =" vp-contributors-images" >
21+ <a
22+ v-for =" { login, avatar_url } of contributors"
23+ :key =" login"
24+ :aria-label =" `${login} on GitHub`"
25+ :href =" `https://github.com/${login}`"
26+ target =" _blank"
27+ rel =" noopener noreferrer"
28+ >
29+ <img
30+ :alt =" login"
31+ :src =" avatar_url"
32+ :width =" props.size"
33+ :height =" props.size"
34+ :style =" imageStyle"
35+ loading =" lazy"
36+ />
37+ </a >
38+ </div >
2639 </div >
2740</template >
2841
2942<style scoped>
30- div .contributors {
43+ div .vp-contributors-heading {
44+ font-size : 32px ;
45+ text-align : center ;
46+ margin-bottom : 36px ;
47+ }
48+
49+ div .vp-contributors-images {
3150 display : flex ;
3251 flex-wrap : wrap ;
3352 gap : 0.8rem ;
3453 justify-content : center ;
3554 align-items : center ;
3655}
3756
38- .contributors img {
57+ .vp- contributors img {
3958 margin : 0 ;
4059 border-radius : 50% ;
41- width : 4rem ;
42- height : 4rem ;
4360 /* styles for img:hover transform */
4461 display : inline-block ;
4562 vertical-align : middle ;
@@ -51,7 +68,7 @@ div.contributors {
5168 transition-property : transform;
5269}
5370
54- .contributors img :hover {
71+ .vp- contributors img :hover {
5572 transform : scale (1.08 );
5673}
5774 </style >
0 commit comments