-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Four Kitchens Release - Sprint 47 (#1495)
* SHS-5567: Implementation: Hide "Show as Expanded" toggle in menu settings on node form (#1490) * SHS-5515: Implementation: Adjustments to vertical cards (#1487) * SHS-5561: Implementation: Responsive styles for h4 and h5 (#1497)
- Loading branch information
Showing
19 changed files
with
226 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
docroot/themes/humsci/humsci_basic/src/js/shared/vertical-card/vertical-card.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function verticalCard() { | ||
// find all hb-vertical-card elements | ||
const cards = document.querySelectorAll('.hb-vertical-card'); | ||
|
||
// Loop through each card | ||
cards.forEach((card) => { | ||
// Find the main link within each card | ||
const mainLink = card.querySelector('[data-vertical-card-link]'); | ||
|
||
if (!mainLink) { | ||
return; | ||
} | ||
|
||
// Add a click event listener to each card | ||
function handleClick() { | ||
mainLink.click(); | ||
} | ||
|
||
// Add a focus event listener to each main link | ||
mainLink.addEventListener('focus', () => { | ||
// Add a focus state class to card | ||
card.classList.add('is-focused'); | ||
}); | ||
|
||
// Add a blur event listener to each main link | ||
mainLink.addEventListener('blur', () => { | ||
// Remove focus state class from card | ||
card.classList.remove('is-focused'); | ||
}); | ||
|
||
card.addEventListener('click', handleClick); | ||
}); | ||
} | ||
|
||
verticalCard(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
docroot/themes/humsci/humsci_basic/src/scss/components/_vertical-card.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.hb-vertical-card { | ||
// Needed to make the styles work when the anchor is the wrapper. | ||
.hb-card__title a:not([class]), | ||
.hb-card__title a > div > * { | ||
@include hb-link; | ||
} | ||
|
||
// Needed to make the styles work when the anchor is the wrapper. | ||
.hb-card__title a > div > * { | ||
display: inline; | ||
} | ||
|
||
&:hover, | ||
&:focus { | ||
cursor: pointer; | ||
|
||
@include hb-colorful { | ||
.hb-raised-cards & { | ||
@include hb-pairing-color('border-color', 'secondary-darken-12'); | ||
} | ||
} | ||
|
||
.hb-card__img img { | ||
transform: scale($hb-image-hover-scale); | ||
} | ||
|
||
.hb-card__title a, | ||
// Needed to make the styles work when the anchor is the wrapper. | ||
.hb-card__title a:not([class]), | ||
.hb-card__title a > div > * { | ||
@include hb-global-color('color', 'black'); | ||
|
||
@include hb-themes(('airy', 'colorful')) { | ||
@include hb-pairing-color('border-bottom-color', 'tertiary-highlight-darken-10'); | ||
transition-delay: 0s, 0s; | ||
box-shadow: inset 0 hb-calculate-rems(-14px) 0 hb-get-pairing-color('tertiary-highlight', $hb-colorful-default, $hc-colorful-pairings); | ||
box-shadow: inset 0 hb-calculate-rems(-14px) 0 var(--palette--tertiary-highlight); | ||
} | ||
|
||
@include hb-traditional { | ||
@include hb-global-color('color', 'black'); | ||
background-image: none; | ||
@include hb-pairing-color('text-decoration-color', 'primary'); | ||
} | ||
} | ||
} | ||
|
||
.hb-card__img { | ||
overflow: hidden; | ||
|
||
img { | ||
width: 100%; | ||
transition: hb-transition(transform); | ||
} | ||
} | ||
|
||
.field-media-image { | ||
margin: 0; | ||
} | ||
} |
Oops, something went wrong.