Skip to content

Commit de46353

Browse files
Improved the images alignment in the cards (#87)
1 parent 5523943 commit de46353

File tree

3 files changed

+53
-12
lines changed

3 files changed

+53
-12
lines changed

assets/pastevents/pastevents.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ body.dark-mode .past-event-date,
3434
border-radius: 10px;
3535
overflow: hidden;
3636
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
37-
transition: all 0.3s ease;
3837
margin-bottom: 2rem;
3938
border: 2px solid #c3c6ce;
40-
transition: 0.5s ease-out;
4139
position: relative;
40+
transition: all 0.5s ease;
41+
}
42+
43+
.past-event-card:not(:hover) {
44+
transition: all 0.1s ease;
4245
}
4346

4447
.past-event-card a {
@@ -50,15 +53,19 @@ body.dark-mode .past-event-date,
5053
transform: translateY(-5px);
5154
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
5255
border-color: var(--primary-color);
53-
box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.25);
56+
}
57+
58+
.past-event-card:hover .blurred-image {
59+
opacity: 0.6;
60+
filter: blur(10px);
5461
}
5562

5663
.past-event-image {
5764
position: relative;
5865
padding: 1rem;
5966
width: 100%;
6067
height: 250px;
61-
object-fit: cover;
68+
object-fit: scale-down;
6269
border-radius: 10px;
6370
}
6471

@@ -97,7 +104,6 @@ body.dark-mode .past-event-date,
97104
left: 30%;
98105
bottom: 0;
99106
text-decoration: none;
100-
text-decoration: none;
101107
transition: background-color 0.3s ease;
102108
}
103109

script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ function createEventCard(event, isPastEvent = false) {
6565

6666
return `
6767
<div class="${isPastEvent ? 'past-event-card' : 'event-card'}">
68+
<div class="event-background">
69+
<img src="${event.image}" alt="Background" class="blurred-image">
70+
</div>
6871
<a href="${event.website || '#'}" target="_blank" rel="noopener noreferrer" class="${isPastEvent ? 'past-card-link' : 'card-link'}">
6972
<img src="${event.image}" alt="${event.title}" class="${isPastEvent ? 'past-event-image' : 'event-image'}">
7073
<div class="${isPastEvent ? 'past-event-details' : 'event-details'}">

style.css

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,18 +540,51 @@ body.dark-mode footer {
540540
border-radius: 10px;
541541
overflow: hidden;
542542
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
543-
transition: all 0.3s ease;
543+
transition: all 0.5s ease;
544544
margin-bottom: 2rem;
545545
border: 2px solid #c3c6ce;
546-
transition: 0.5s ease-out;
547546
position: relative;
548547
}
549548

549+
.event-card:not(:hover) {
550+
transition: all 0.1s ease;
551+
}
552+
553+
.event-background {
554+
position: absolute;
555+
top: 0;
556+
left: 0;
557+
width: 100%;
558+
height: 100%;
559+
overflow: hidden;
560+
z-index: -1;
561+
display: block;
562+
}
563+
564+
/* Blurred background image */
565+
.blurred-image {
566+
width: 100%;
567+
height: 100%;
568+
object-fit: cover;
569+
filter: blur(15px);
570+
transform: scale(1.2);
571+
opacity: 0.4;
572+
transition: opacity 0.3s ease, filter 0.3s ease;
573+
}
574+
575+
.blurred-image:not(:hover) {
576+
transition: opacity 0.1s ease, filter 0.1s ease;
577+
}
578+
550579
.event-card:hover {
551580
transform: translateY(-5px);
552581
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
553582
border-color: var(--primary-color);
554-
box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.25);
583+
}
584+
585+
.event-card:hover .blurred-image {
586+
opacity: 0.6;
587+
filter: blur(10px);
555588
}
556589

557590
.event-image {
@@ -910,10 +943,10 @@ footer {
910943

911944
.send-message textarea {
912945
resize: vertical;
913-
height: 50px;
914-
min-height: 50px;
946+
height: 50px;
947+
min-height: 50px;
915948
max-height: 100px;
916-
overflow-y: auto;
949+
overflow-y: auto;
917950
color: black;
918951
}
919952

@@ -1189,7 +1222,6 @@ footer {
11891222
@media (max-width: 380px) {
11901223
.event-grid {
11911224
display: block;
1192-
11931225
}
11941226

11951227
.event-card {

0 commit comments

Comments
 (0)