Skip to content

Commit cfdd301

Browse files
authored
Enhancement : Application cards and Accept/Reject button (#826)
* Make Application Cards responsive on small screen size & Add Click/Hover Action for Accept/Reject Buttons * Prettier Run Fix * Add :is pseduo class for combining :hover and :active states to reduce lines of code * Resolve change requests
1 parent 1182360 commit cfdd301

File tree

2 files changed

+90
-14
lines changed

2 files changed

+90
-14
lines changed

applications/index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,18 @@ <h2>Status</h2>
7777
</button>
7878
<div class="application-details-main"></div>
7979
<div class="application-details-actions">
80-
<button class="application-details-accept">Accept</button>
81-
<p class="application-details-reject">Reject</p>
80+
<button
81+
class="application-details-accept"
82+
aria-label="Accept Application"
83+
>
84+
Accept
85+
</button>
86+
<button
87+
class="application-details-reject"
88+
aria-label="Reject Application"
89+
>
90+
Reject
91+
</button>
8292
</div>
8393
</div>
8494
<main class="application-container"></main>

applications/style.css

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
font-family: 'Inter', sans-serif;
33
--color-primary: #1d1283;
44
--color-primary-hover: #11085c;
5+
--color-button-hover: #2c1bc6;
56
--white: #fff;
67
--color-gray: #666;
78
--black-color: black;
@@ -48,7 +49,7 @@ body {
4849
.container {
4950
max-width: 1100px;
5051
margin: 0 auto;
51-
padding: 2rem;
52+
padding: 1rem;
5253
overflow-y: auto;
5354
}
5455

@@ -145,7 +146,6 @@ body {
145146
.application-container {
146147
display: flex;
147148
flex-wrap: wrap;
148-
justify-content: space-between;
149149
padding-bottom: 10px;
150150
padding-top: 32px;
151151
gap: 25px;
@@ -159,7 +159,10 @@ body {
159159
border-radius: 15px;
160160
box-shadow: var(--elevation-1);
161161
padding: 24px;
162-
width: 44%;
162+
width: 85%;
163+
max-width: 800px;
164+
box-sizing: border-box;
165+
margin: 0 auto;
163166
display: flex;
164167
flex-direction: column;
165168
gap: 2px;
@@ -364,16 +367,57 @@ body {
364367

365368
.application-details .application-details-actions .application-details-reject {
366369
color: var(--red-color);
367-
height: auto;
368370
background-color: white;
369-
margin-left: auto;
370-
margin-right: auto;
371-
text-decoration: underline;
371+
margin: 0 auto;
372+
width: 40%;
373+
border: 2px solid var(--red-color);
374+
}
375+
376+
.application-details
377+
.application-details-actions
378+
.application-details-reject:is(:hover, :active, :focus-visible) {
379+
background: var(--red-color);
380+
color: var(--white);
381+
transition: transform 0.2s ease;
382+
will-change: transform;
383+
}
384+
385+
.application-details
386+
.application-details-actions
387+
.application-details-reject:hover {
388+
transform: scale(1.05);
389+
}
390+
391+
.application-details
392+
.application-details-actions
393+
.application-details-reject:active {
394+
animation: bounceBackAnimation 0.4s ease forwards;
372395
}
373396

374397
.application-details .application-details-actions .application-details-accept {
375398
background: var(--color-primary);
376-
width: 50%;
399+
margin: 0 auto;
400+
width: 40%;
401+
}
402+
403+
.application-details
404+
.application-details-actions
405+
.application-details-accept:is(:hover, :active, :focus-visible) {
406+
background: var(--color-button-hover);
407+
transition: transform 0.2s ease;
408+
will-change: transform;
409+
}
410+
411+
.application-details
412+
.application-details-actions
413+
.application-details-accept:hover {
414+
transform: scale(1.05);
415+
}
416+
417+
.application-details
418+
.application-details-actions
419+
.application-details-accept:active {
420+
animation: bounceBackAnimation 0.4s ease forwards;
377421
}
378422

379423
.application-details-actions .hidden {
@@ -442,6 +486,28 @@ body {
442486
opacity: 0.2;
443487
}
444488

489+
@keyframes bounceBackAnimation {
490+
0% {
491+
transform: scale(1);
492+
}
493+
494+
25% {
495+
transform: scale(0.9);
496+
}
497+
498+
55% {
499+
transform: scale(1.1);
500+
}
501+
502+
75% {
503+
transform: scale(0.9);
504+
}
505+
506+
100% {
507+
transform: scale(1);
508+
}
509+
}
510+
445511
@keyframes slideIn {
446512
from {
447513
right: -300px;
@@ -463,10 +529,6 @@ body {
463529
}
464530

465531
@media screen and (max-width: 850px) {
466-
.application-card {
467-
width: 100%;
468-
}
469-
470532
.container {
471533
padding: 1rem;
472534
}
@@ -478,4 +540,8 @@ body {
478540
height: 100%;
479541
border-radius: 0;
480542
}
543+
544+
.application-card {
545+
width: 90%;
546+
}
481547
}

0 commit comments

Comments
 (0)