Skip to content

Commit ea69080

Browse files
author
aryan
committed
fixed image
1 parent d6e0c30 commit ea69080

1 file changed

Lines changed: 69 additions & 76 deletions

File tree

layouts/partials/playstore-card-grid.html

Lines changed: 69 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -43,146 +43,139 @@ <h2 class="section-title">{{ $title }}</h2>
4343
<!-- Get all subpages of the current page -->
4444
{{- range $subPages }}
4545
<a href="{{ .RelPermalink }}">
46-
<div class="card">
47-
<div class="card-image-container">
48-
{{- $img := .Resources.GetMatch .Params.image -}} {{- if $img -}} {{
49-
$thumb := $img.Fill "400x240 webp q80" }}
50-
<img
51-
class="card-image"
52-
src="{{ $thumb.RelPermalink }}"
53-
width="{{ $thumb.Width }}"
54-
height="{{ $thumb.Height }}"
55-
alt="{{ .Title }}"
56-
loading="lazy"
57-
/>
58-
{{- else -}}
59-
<img
60-
class="card-image"
61-
src="https://via.placeholder.com/300/abcdef/ffffff?Text=Placeholder%20Image"
62-
alt="Placeholder Image"
63-
width="300"
64-
height="180"
65-
loading="lazy"
66-
/>
67-
{{- end }}
68-
</div>
69-
<div class="card-content">
70-
<h3 class="card-title">{{ .Title }}</h3>
71-
<p class="card-subtitle">
72-
{{- partial "utils/page-description" . -}}
73-
</p>
74-
</div>
46+
<div class="card">
47+
<div class="card-image-container">
48+
{{- if .Params.image }}
49+
50+
<img class="card-image" src="{{ .Params.image }}" alt="{{ .Title }}" loading="lazy"
51+
method="Resize"
52+
options="600x q80 webp" />
53+
{{- else }}
54+
<img
55+
class="card-image"
56+
src="https://via.placeholder.com/300/abcdef/ffffff?Text=Placeholder%20Image"
57+
alt="Placeholder Image"
58+
/>
59+
{{- end }}
7560
</div>
61+
<div class="card-content">
62+
<h3 class="card-title">{{ .Title }}</h3>
63+
<p class="card-subtitle"> {{- partial "utils/page-description" . -}}</p>
64+
</div>
65+
</div>
7666
</a>
7767
{{- end }}
78-
<div class="card">{{ partial "google/notes-In-feed-ad.html" . }}</div>
68+
<div class="card">
69+
{{ partial "google/notes-In-feed-ad.html" . }}
70+
</div>
7971
</div>
8072
</div>
8173
{{ end -}}
8274

8375
<style>
84-
.section-container {
76+
.section-container {
8577
margin: 32px 0; /* Elegant spacing between sections */
86-
}
78+
}
8779

88-
.section-header {
80+
.section-header {
8981
display: flex;
9082
justify-content: space-between;
9183
align-items: center;
9284
padding: 0 20px; /* Balanced horizontal padding */
93-
}
85+
}
9486

95-
.section-title {
87+
.section-title {
9688
position: relative;
9789
font-size: 20px;
9890
font-weight: 600;
9991
color: #202124; /* Dark grey text */
10092
cursor: pointer;
10193
transition: color 0.3s ease;
102-
}
94+
}
10395

104-
.section-title:hover {
96+
.section-title:hover {
10597
color: #1a73e8; /* Subtle hover effect */
106-
}
98+
}
10799

108-
.section-controls {
100+
.section-controls {
109101
display: flex;
110102
align-items: center;
111-
}
103+
}
112104

113-
.section-controls button {
105+
.section-controls button {
114106
background: none;
115107
border: none;
116108
cursor: pointer;
117109
font-size: 28px; /* Adjusted size for elegance */
118110
color: #5f6368; /* Medium grey text */
119111
margin: 0 12px; /* Balanced spacing between arrows */
120112
transition: color 0.3s ease, transform 0.3s ease;
121-
}
113+
}
122114

123-
.section-controls button:hover {
115+
.section-controls button:hover {
124116
color: #1a73e8; /* Highlight on hover */
125117
transform: scale(1.1); /* Slight zoom effect */
126-
}
118+
}
127119

128-
.card-grid-container {
120+
.card-grid-container {
129121
position: relative;
130122
overflow-x: auto;
131123
white-space: nowrap;
132124
padding: 0 0; /* Balanced horizontal padding */
133125
scrollbar-width: none;
134126
-ms-overflow-style: none;
135-
}
127+
}
136128

137-
.card-grid-container::-webkit-scrollbar {
129+
.card-grid-container::-webkit-scrollbar {
138130
display: none;
139-
}
131+
}
140132

141-
.card {
133+
.card {
142134
height: 350px; /* Adjusted card height for better visibility */
143135
display: inline-block;
144136
border: 1px solid #c4c4c4; /* Light grey border */
145-
border-radius: 0.25rem; /* Softer corners */
137+
border-radius: .25rem; /* Softer corners */
146138
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Elegant shadow */
147139
margin: 12px;
148140
width: 250px; /* Slightly larger card width */
149141
flex-shrink: 0;
150142
overflow: hidden;
151143
transition: transform 0.2s ease, box-shadow 0.2s ease;
152-
}
144+
}
153145

154-
.card:hover {
146+
.card:hover {
155147
transform: scale(1.05);
156148
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15); /* Enhanced hover shadow */
157-
}
149+
}
158150

159-
.card:first-child {
160-
margin-left: 20px;
161-
}
151+
.card:first-child {
152+
margin-left: 20px;
153+
}
162154

163-
.card:last-child {
164-
margin-right: 20px;
165-
}
155+
.card:last-child {
156+
margin-right: 20px;
157+
}
166158

167-
.card-image-container {
159+
.card-image-container {
168160
width: 100%;
169161
height: 180px; /* Adjusted image height */
170162
overflow: hidden;
171-
border-radius: 0.25rem; /* Softer corners */
172-
}
163+
border-radius: .25rem; /* Softer corners */
164+
165+
}
173166

174-
.card-image {
167+
.card-image {
175168
width: 100%;
176169
height: 100%;
177170
object-fit: cover; /* Ensure image fills the container */
178171
display: block;
179-
}
172+
}
180173

181-
.card-content {
174+
.card-content {
182175
padding: 16px 0; /* More spacious content padding */
183-
}
176+
}
184177

185-
.card-title {
178+
.card-title {
186179
font-size: 16px;
187180
font-weight: 600;
188181
color: #202124;
@@ -195,9 +188,9 @@ <h3 class="card-title">{{ .Title }}</h3>
195188
-webkit-box-orient: vertical;
196189
line-height: 1.5rem; /* Adjusted line height for readability */
197190
max-height: 3rem; /* Limit height to 2 lines */
198-
}
191+
}
199192

200-
.card-subtitle {
193+
.card-subtitle {
201194
font-size: 14px;
202195
color: #5f6368; /* Medium grey text */
203196
white-space: pre-wrap;
@@ -208,20 +201,20 @@ <h3 class="card-title">{{ .Title }}</h3>
208201
-webkit-box-orient: vertical;
209202
line-height: 1.5rem; /* Adjusted line height for readability */
210203
max-height: 3rem; /* Limit height to 2 lines */
211-
}
204+
}
212205

213206
html[class~="dark"] {
207+
214208
.section-title {
215209
color: #e0e0e0; /* Light text for section titles */
216210
}
217211

218212
.section-title:hover {
219-
color: #1a73e8; /* Subtle hover effect */
220-
}
221-
222-
.card {
223-
border-color: #3f3f3f;
213+
color: #1a73e8; /* Subtle hover effect */
224214
}
215+
216+
.card{
217+
border-color: #3f3f3f;}
225218

226219
.card-title {
227220
color: #ffffff; /* White text for card titles */
@@ -259,7 +252,7 @@ <h3 class="card-title">{{ .Title }}</h3>
259252
.closest(".section-container")
260253
.querySelector(".arrow-next");
261254

262-
const scrollAmount = container.querySelector(".card").offsetWidth * 2; // Adjust scroll amount based on card width
255+
const scrollAmount = container.querySelector(".card").offsetWidth * 2 ; // Adjust scroll amount based on card width
263256

264257
// Add click event for the previous button
265258
prevButton.addEventListener("click", function () {

0 commit comments

Comments
 (0)