1+
2+
3+ {{ if .page.Title }}
4+ < a href ="{{ .RelPermalink }} ">
5+ < li class ="chapter-item ">
6+ {{- $img := (.Resources.ByType "image").GetMatch "*feature*" -}} {{- if
7+ $img -}}
8+ < img
9+ class ="chapter-image "
10+ src ="{{ $img.RelPermalink }} "
11+ alt ="{{ .Title }} "
12+ loading ="lazy "
13+ width ="100 "
14+ height ="100 "
15+ style ="border-radius: 8px; margin-right: 10px; float: left "
16+ />
17+ {{- end -}} {{- if .page.Params.image -}}
18+ < img
19+ class ="chapter-image "
20+ src ="{{ .page.Params.image }} "
21+ alt ="{{ .Title }} "
22+ loading ="lazy "
23+ width ="100 "
24+ height ="100 "
25+ style ="border-radius: 8px; margin-right: 10px; float: left "
26+ />
27+ {{- end -}} {{- if .page.Params.icon -}}
28+ < img
29+ class ="chapter-image "
30+ src ="{{ .page.Params.icon }} "
31+ alt ="{{ .Title }} "
32+ loading ="lazy "
33+ width ="100 "
34+ height ="100 "
35+ style ="border-radius: 8px; margin-right: 10px; float: left "
36+ />
37+ {{- end -}} {{ if .page.Params.emoji}}
38+ < span class ="chapter-emoji "> {{ .page.Params.emoji }}</ span >
39+ {{ end -}}
40+
41+ < h2 class ="chapter-title mona-sans ">
42+ < span class ="gradient-text "
43+ > {{ if lt (add .num 1) 10 }}0{{ end }}{{ add .num 1 }}</ span
44+ >
45+ {{ .page.Title }}
46+ </ h2 >
47+ < p class ="chapter-description ">
48+ {{- if .page.Params.description -}}
49+ {{ .page.Params.description | markdownify | plainify }}
50+ {{- else -}}
51+ {{- partial "utils/page-description" .page -}}
52+ {{- end -}}
53+ {{/* {{- partial "utils/page-description" . -}} */}}
54+ </ p >
55+ </ li >
56+ </ a >
57+ {{ end -}}
58+
59+
60+ < style >
61+
62+
63+ .gradient-text {
64+ background : linear-gradient (90deg , # ff7e5f, # feb47b );
65+ -webkit-background-clip : text;
66+ -webkit-text-fill-color : transparent;
67+ margin : 0 0.25rem ;
68+ list-style-type : decimal-leading-zero;
69+ }
70+
71+ .chapter-image {
72+ display : none; /* Hide images by default */
73+ width : 100px ;
74+ border-radius : 8px ;
75+ margin-right : 10px ;
76+ float : left;
77+ object-fit : cover;
78+ aspect-ratio : 4 / 3 ; /* Maintain aspect ratio */
79+ }
80+
81+ .chapter-item {
82+ list-style-type : none;
83+ margin : 20px 0 ;
84+ padding : 1.5rem ;
85+ background-color : # ffffff ;
86+ border-radius : 8px ;
87+ font-size : 17px ;
88+ box-shadow : 0 4px 6px rgba (0 , 0 , 0 , 0.1 );
89+ transition : all 0.3s ease;
90+ }
91+
92+ .chapter-item : hover {
93+ background-color : # f9f9f9 ;
94+ border-color : # d0d0d0 ;
95+ transform : translateY (-2px );
96+ box-shadow : 0 6px 10px rgba (0 , 0 , 0 , 0.15 );
97+ cursor : pointer;
98+ }
99+
100+ .chapter-emoji {
101+ position : absolute;
102+
103+ left : -12px ;
104+ transform : translateY (-100% );
105+ font-size : 28px ;
106+ z-index : 1 ;
107+ }
108+
109+ .chapter-item {
110+ position : relative;
111+ }
112+
113+ .chapter-title {
114+ font-weight : bold;
115+ margin : 0 0 5px ;
116+ color : # 333 ;
117+ font-size : large;
118+ }
119+
120+ .chapter-description {
121+ margin : 0 ;
122+ color : # 666 ;
123+ font-size : 14px ;
124+ white-space : pre-wrap;
125+ overflow : hidden;
126+ text-overflow : ellipsis;
127+ display : -webkit-box;
128+ -webkit-line-clamp : 2 ; /* Limit to 2 lines */
129+ -webkit-box-orient : vertical;
130+ line-height : 1.5rem ; /* Adjusted line height for readability */
131+ max-height : 3rem ; /* Limit height to 2 lines */
132+ }
133+
134+ .chapter-item : focus-within {
135+ outline : 2px solid # 0078d4 ;
136+ outline-offset : 2px ;
137+ }
138+
139+ .chapter-item : hover .chapter-title {
140+ color : # 0078d4 ;
141+ }
142+
143+ html [class ~= "dark" ] {
144+ .chapter-item {
145+ color : # ffffff ;
146+ background-color : # 1e293b ;
147+ box-shadow : 0 4px 6px rgba (0 , 0 , 0 , 0.5 );
148+ }
149+
150+ .chapter-item : hover {
151+ box-shadow : 0 6px 10px rgba (0 , 0 , 0 , 0.7 );
152+ }
153+
154+ .chapter-title {
155+ color : # ffffff ;
156+ }
157+
158+ .chapter-description {
159+ color : # dddddd ;
160+ }
161+ }
162+
163+ @media (min-width : 769px ) {
164+ .chapter-image {
165+ display : block; /* Show items on larger screens */
166+ }
167+ }
168+
169+ @media (max-width : 768px ) {
170+ .chapter-image {
171+ display : none; /* Hide images on smaller screens */
172+ }
173+ }
174+ </ style >
0 commit comments