@@ -6,42 +6,59 @@ <h2 class="text-4xl text-center pt-20 xl:pt-30">
6
6
<!-- デスクトップで表示 -->
7
7
< div class ="hidden xl:block max-w-7xl mx-auto my-24 ">
8
8
< ul class ="staff flex flex-wrap justify-center gap-x-36 ">
9
- {% for i in (1..42) %}
9
+ {% for member in site.data.staff %}
10
10
< li class ="-mt-[74px] ">
11
+ {% if member.site %}
12
+ < a href ="{{ member.site }} " target ="_blank ">
13
+ {% endif %}
14
+
11
15
< div class ="relative aspect-[1/cos(30deg)] w-50 overflow-hidden flex items-center justify-center "
12
16
style ="clip-path: polygon(50% -50%,100% 50%,50% 150%,0 50%); ">
13
17
14
- < div class ="block absolute size-full opacity-0 hover:opacity-100 transition-200 transition-opacity ">
18
+ < div class ="absolute size-full opacity-0 hover:opacity-100 ">
15
19
< div class ="absolute size-full mix-blend-multiply bg-[#6f6f6f] "> </ div >
16
20
< p class ="flex flex-col items-center justify-center text-white text-center absolute size-full ">
17
- < span class ="text-xs "> 肩書き</ span >
18
- 名字 名前
19
- < span class ="text-xs "> 道場名</ span >
21
+ {{ member.name }}
22
+ < span class ="text-xs "> {{ member.dojo }}</ span >
20
23
</ p >
21
24
</ div >
22
- < img class ="w-full " src ="https://placehold.jp/320x320.png " alt ="スタッフの写真 ">
25
+ < img class ="min- w-full min-h-full object-cover " src ="/img/staff/{{ member.name }}.webp " alt ="{{ member.name }} ">
23
26
</ div >
27
+
28
+ {% if member.site %}
29
+ </ a >
30
+ {% endif %}
24
31
</ li >
25
32
{% endfor %}
33
+
34
+ {% comment %} 空の要素を入れて、最後の行のバランスを取る {% endcomment %}
35
+ < div class ="w-50 "> </ div >
26
36
</ ul >
27
37
</ div >
28
38
29
39
<!-- モバイルで表示 -->
30
40
< div class ="block xl:hidden mx-auto mt-9 mb-20 ">
31
41
< ul class ="flex flex-wrap justify-center gap-x-2 gap-y-6 mx-[2%] ">
32
- {% for i in (1..42) %}
42
+ {% for member in site.data.staff %}
33
43
< li class ="flex flex-col items-center gap-y-2 ">
44
+ {% if member.site %}
45
+ < a href ="{{ member.site }} " target ="_blank " class ="flex flex-col items-center gap-y-2 ">
46
+ {% endif %}
47
+
34
48
< div class ="relative aspect-[1/cos(30deg)] w-24 sm:w-30 overflow-hidden flex items-center justify-center "
35
49
style ="clip-path: polygon(50% -50%,100% 50%,50% 150%,0 50%); ">
36
- < img class ="w-full " src ="https://placehold.jp/320x320.png " alt ="スタッフの写真 ">
50
+ < img class ="w-full " src ="/img/staff/{{ member.name }}.webp " alt ="{{ member.name }} ">
37
51
</ div >
38
52
39
53
<!-- モバイルで表示する、肩書きや氏名の表示 -->
40
- < p class ="flex flex-col text-center ">
41
- < span class ="text-xs "> 肩書き</ span >
42
- 名字 名前
43
- < span class ="text-xs "> 道場名</ span >
54
+ < p class ="flex flex-col text-center w-24 text-sm word-break ">
55
+ {{ member.name }}
56
+ < span class ="text-xs "> {{ member.dojo }}</ span >
44
57
</ p >
58
+
59
+ {% if member.site %}
60
+ </ a >
61
+ {% endif %}
45
62
</ li >
46
63
{% endfor %}
47
64
</ ul >
0 commit comments