Skip to content

Commit

Permalink
Feature/tci 1221 location new hero banner (#888)
Browse files Browse the repository at this point in the history
* initial commit

* Initial Commit for location details page. Implemented hero section

* Added Additional component section for hero.

* Added a location details building image for demo.

* Added css styling and removed obselete code in hero.twig from previous commit.

* Deleted unused files.

* Location details sections implementation.

---------

Co-authored-by: Aditya R Joshi <aditya.joshi-t@jud.ca.gov>
  • Loading branch information
adityajoshi94 and Aditya R Joshi authored Aug 13, 2024
1 parent d09081c commit d1cfc83
Show file tree
Hide file tree
Showing 11 changed files with 493 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/_patterns/01-atoms/icon/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions source/_patterns/02-molecules/body/_body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,32 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
@include grid-row();
@include grid-gap(4);
}

}

@media(max-width:30em){
.jcc-body__content.jcc-location-page{
display:flex;
flex-direction: column-reverse;
}
.jcc-body__content.jcc-location-page .jcc-location__map{
display:none;
}
.jcc-section-heading__title--partial::before,.jcc-body__aside-bar::before{
height:0px !important;
}
.jcc-section-heading__title--partial::after{
height:0px !important;
}
aside.jcc-body__aside.jcc-location-page .jcc-body__aside-bar {
display:none;
}
.jcc-location-page .jcc-body__main + .jcc-body__aside {
margin-top: 0rem !important;
}
}


.jcc-body__main {
@include at-media(desktop) {
@include grid-col(8);
Expand Down
92 changes: 92 additions & 0 deletions source/_patterns/02-molecules/hero/_hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,55 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
}
}

.jcc-hero--layout-location-details .jcc-hero__container{
padding-right:0rem !important;
padding-top:0rem !important;
padding-bottom:0rem !important;

@include at-media(tablet) {
@include u-padding-top(2);
@include u-padding-bottom(2);
}

@include at-media(tablet-lg) {
@include u-padding-top(0);
@include u-padding-bottom(0);
@include u-padding-right(0);
}

@include at-media(mobile) {
@include u-padding-top(2);
@include u-padding-bottom(2);
@include u-padding-right(2);
}
}

.jcc-hero__content {
@include at-media(tablet-lg) {
@include grid-row();
@include grid-gap(6);
}
}

.jcc-hero--layout-location-details .jcc-hero__main {
@include u-position(relative);
@include at-media-max(tablet-lg) {
padding-top:2rem;
padding-bottom:2rem;
}

@include at-media(tablet-lg) {
@include grid-col(8);
padding-top:2rem;
padding-bottom:2rem;
}

.icon {
@include u-position(relative);
@include u-top(1);
}
}

.jcc-hero__main {
@include u-position(relative);

Expand All @@ -68,6 +110,10 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
.jcc-hero--layout-full-main & {
@include grid-col(12);
}

.jcc-hero--layout-full-main & {
@include grid-col(12);
}
}

.icon {
Expand Down Expand Up @@ -143,6 +189,7 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
}
}


.jcc-hero__aside {
@include at-media-max(tablet-lg) {
@include u-margin-top(2);
Expand All @@ -157,6 +204,31 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
@include u-display(none);
}
}
.jcc-hero--layout-location-details .jcc-hero__aside {
padding-right: 0 ;
padding-top: 0;
img{
object-fit:cover;
object-position:center;
height:100%;
}

@include at-media-max(tablet-lg) {
@include u-margin-top(2);
@include u-padding-top(0);
@include u-padding-right(0);
@include u-display(none);
}

@include at-media(tablet-lg) {
@include grid-col(4);
@include u-padding-right(0);
}

@include at-media-max(mobile-lg) {
@include u-display(none);
}
}

.jcc-hero__aside-title {
@include u-margin-bottom(2);
Expand Down Expand Up @@ -241,3 +313,23 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
background: rgba(45, 45, 45, 0.7);
padding: 0 8px;
}

.jcc-hero--layout-location-details{
margin-bottom:2rem;
}

.jcc-location-hero-link {
color: #5c5c5c;
line-height: 2.0;
a {
color: #5c5c5c;
text-decoration: underline;
text-underline-offset: .25em ;
}
>a {
&::after {
display: none;
}
}
}

8 changes: 7 additions & 1 deletion source/_patterns/02-molecules/hero/hero.twig
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
{% endif %}
</div>

{% if hero.aside.title or hero.aside.text or hero.aside.link.url %}

{% if hero.aside.title or hero.aside.text or hero.aside.link.url or hero.aside.media %}
<aside class="jcc-hero__aside">
{% if hero.aside.title %}
<h4 class="jcc-hero__aside-title">{{ hero.aside.title }}</h4>
Expand All @@ -78,6 +79,11 @@
<a {{ hero.aside.link.is_external ? 'class="ext"' -}} href="{{ hero.aside.link.url }}">{{ hero.aside.link.text }}</a>
</div>
{% endif %}

{% if hero.aside.media %}
<img src="{{ hero.aside.media.src }}" alt="{{ hero.aside.media.alt }}">
{% endif %}

</aside>
{% endif %}
</div>
Expand Down
117 changes: 117 additions & 0 deletions source/_patterns/02-molecules/location-details/_location-details.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
$_config_schemes: (
base: (
aside-title: primary-dark,
aside-dash-visibility: block,
aside-title-margin-top: 0,
),
local: (),
pro: (
aside-title: gray-warm-90,
aside-dash-visibility: none,
aside-title-margin-top: 1,
),
);

$_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);

.jcc-body__content.jcc-location-page{
@include at-media(desktop) {
@include u-display(none);

}
}


.jcc-location_detail__content {
@include at-media(desktop) {
@include grid-row();
@include grid-gap(4);
}
}

.jcc-location_detail__main {
@include at-media(desktop) {
@include grid-col(8);
}

.jcc-section-heading__lead,
.jcc-location_detail__main-text {
@include u-measure(6);
@include u-maxw(full);
}

.align-left {
@include u-float(left);
@include u-margin-right(3);
}

.align-right {
@include u-float(right);
@include u-margin-left(3);
}

&:only-child {
@include at-media(desktop) {
@include grid-col(12);
}
}
}

.jcc-location_detail__main-text {
@include u-padding-bottom(1);

.jcc-section-heading__title {
@include u-width(full);
@include u-overflow(hidden);
}
}

.jcc-location_detail__aside {
@include at-media(desktop) {
@include grid-col(4);
}

.jcc-location_detail__main + & {
@include at-media-max(desktop) {
@include u-margin-top(10);
}
}
}

.jcc-location_detail__aside-bar {
@include u-display($dash-color: map-get($_config, aside-dash-visibility));
@include add-dash($dash-position: "above-center", $dash-width: 100%);
@include u-padding-top(4);
@include u-text-align(left);
}

.jcc-location_detail__aside-title {
@include u-margin-top(map-get($_config, aside-title-margin-top));
@include u-color(map-get($_config, aside-title));
@include u-font-size(location_detail, sm);
@include u-text(uppercase);
letter-spacing: 3.84615px;
}

.jcc-location_detail__aside-text {
@include u-color(base-dark);

p {
@include typeset(location_detail, xs, 6);
@include at-media(desktop) {
@include u-font-size(location_detail, sm);
}
@include u-margin-bottom(3);
@include u-margin-top(2);
}

h4 {
@extend .jcc-location_detail__aside-title;
@include u-margin-bottom(1);
@include u-margin-top(3);
}

ul li {
@include u-margin-top(1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{#
/**
* Available variables:
* - location_detail - primary variable
* - main: the main content
* - title: the title
* - lead: lead text
* - text: the text
* - aside: secondary content
* - title: the title
* - text: the text
* - classes: array of classes to add to component
*/
#}

{% set classes = [
'jcc-body',
]|merge(location_detail.classes|default([''])) %}

{% set content %}
<div class="{{ classes|join(' ')|trim }}">
<div class="jcc-body__content jcc-location-page">
<div class="jcc-body__main">
{% if location_details.main.title or location_details.main.lead %}
{% include "@molecules/section/section-heading.twig" with {
section_heading: {
title: location_details.main.title,
lead: location_details.main.lead,
width: "partial",
}
} %}
{% endif %}
{% if location_details.main.enteries %}
{% set sections = location_details.main %}
{% include '@organisms/sections/sections.twig' with {
sections: sections
} %}
{% endif %}
</div>

{% if location_details.aside.title or location_details.aside.text or location_details.aside.enteries %}
<aside class="jcc-body__aside">
<div class="jcc-body__aside-bar jcc-location-page"></div>
{% if location_details.aside.title %}
<h4 class="jcc-body_detail__aside-title">{{ location_details.aside.title }}</h4>
{% endif %}

{% if location_details.aside.enteries %}
{% include "@organisms/sections/sections.twig" with {
sections: location_details.aside
} %}
{% endif %}
</aside>
{% endif %}
</div>
</div>
{% endset %}



{% include "@molecules/section/section.twig" with {
section: {
content: content
}
} %}
6 changes: 6 additions & 0 deletions source/_patterns/02-molecules/section/_section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ $_config: map-merge-by-keys($_config_schemes, base, $_config_schemes, $scheme);
}
}

@media(max-width:30em){
.jcc-section.location_details{
padding-top:0px !important;
}
}

.jcc-section--background-alt {
@include u-margin-top(map-get($_config, alt-margin-top));
@include u-padding-bottom(8);
Expand Down
Loading

0 comments on commit d1cfc83

Please sign in to comment.