Skip to content

Commit

Permalink
Merged in PGW-18-header-images (pull request civicrm#145)
Browse files Browse the repository at this point in the history
PGW-18: Header Images on paragraph pages and events details

Approved-by: Mukesh Ram <[email protected]>
  • Loading branch information
BorisCompucorp committed Jul 6, 2017
2 parents dacb568 + ab2962e commit daa6434
Show file tree
Hide file tree
Showing 11 changed files with 287 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function tpg_paragraphs_views_default_views() {
/* Display: Header Image Lightbox */
$handler = $view->new_display('block', 'Header Image Lightbox', 'header_image_lightbox');
$handler->display->display_options['defaults']['css_class'] = FALSE;
$handler->display->display_options['css_class'] = 'header-image';
$handler->display->display_options['css_class'] = 'header-image-lightbox';
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '1';
Expand All @@ -434,8 +434,8 @@ function tpg_paragraphs_views_default_views() {
$handler->display->display_options['fields']['field_header_image_lightbox']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_header_image_lightbox']['type'] = 'colorbox';
$handler->display->display_options['fields']['field_header_image_lightbox']['settings'] = array(
'colorbox_node_style' => 'responsive_custom_user_header_image_original_1x',
'colorbox_node_style_first' => 'responsive_custom_user_header_image_original_1x',
'colorbox_node_style' => '',
'colorbox_node_style_first' => '',
'colorbox_image_style' => '',
'colorbox_gallery' => 'post',
'colorbox_gallery_custom' => '',
Expand Down
119 changes: 104 additions & 15 deletions sites/all/themes/tpg_theme/dist/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sites/all/themes/tpg_theme/dist/main.min.css

Large diffs are not rendered by default.

Binary file added sites/all/themes/tpg_theme/dist/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sites/all/themes/tpg_theme/images/icons/caption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sites/all/themes/tpg_theme/sass/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ html {
background-color: color(page-bg);
box-sizing: border-box;
font-family: $main-font;
font-feature-settings: "lnum";
font-feature-settings: 'lnum';
font-size: 100%;
font-variant-numeric: lining-nums;
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,71 @@
right: 0;
top: auto;
}

.header-image-lightbox {
img {
@include rem(height, 640px);
margin-left: auto;
margin-right: auto;
width: auto;
}

[class*="field-caption"] {
@include container;
margin-bottom: 13px;
margin-top: 0;
min-height: 32px;
padding-top: 5px;
position: relative;
text-align: left;

&:before {
@include sprite($caption);
content: '';
display: block;
left: 0;
margin-top: -16px;
position: absolute;
top: 50%;
}

.field-content {
margin-left: 32px;
}
}

.field-content {
text-align: center;
}

a.colorbox {
display: inline-block;
max-width: 100%;
overflow: hidden;
position: relative;

&:after {
@include sprite($fullscreen);
bottom: 8px;
content: '';
display: block;
left: 8px;
position: absolute;
}
}
}

@include breakpoint($md-1 0) {
.header-image-lightbox {
a.colorbox {
@include rem(height, 580px);
display: block;
}

img {
@include centered-image;
@include rem(height, 580px);
max-width: none;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.header .flexslider {
@include rem(max-height, 540px);
@include rem(height, 640px);
background-color: color(darken-background);
border: 0;
border-radius: 0;
Expand All @@ -8,7 +8,7 @@
overflow: hidden;

.slides img {
height: 500px;
@include rem(height, 640px);
margin: 0 auto;
width: auto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
z-index: 9;
}

[class*='field-caption'] {
bottom: 0;
position: absolute;
right: 10px;
z-index: 9;
}

.embedded-video iframe {
display: block;
height: 500px;
Expand All @@ -28,6 +21,13 @@
}

.header-image {
[class*='field-caption'] {
bottom: 0;
position: absolute;
right: 10px;
z-index: 9;
}

.views-row {
@include rem(height, 500px);
overflow: hidden;
Expand All @@ -41,10 +41,6 @@
min-width: 100%;
}

&-lightbox img {
min-width: auto;
}

&-two-col {
@include rem(max-height, 400px);
margin-top: 24px;
Expand Down
101 changes: 101 additions & 0 deletions sites/all/themes/tpg_theme/sass/mixins/_sprite.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// SCSS variables are information about icon's compiled state, stored under its original file name
//
// .icon-home {
// width: $icon-home-width;
// }
//
// The large array-like variables contain all information about a single icon
// $icon-home: x y offset_x offset_y width height total_width total_height image_path;
//
// At the bottom of this section, we provide information about the spritesheet itself
// $spritesheet: width height image $spritesheet-sprites;
$caption-name: 'caption';
$caption-x: 0px;
$caption-y: 0px;
$caption-offset-x: 0px;
$caption-offset-y: 0px;
$caption-width: 32px;
$caption-height: 32px;
$caption-total-width: 53px;
$caption-total-height: 32px;
$caption-image: 'sprite.png';
$caption: (0px, 0px, 0px, 0px, 32px, 32px, 53px, 32px, 'sprite.png', 'caption', );
$fullscreen-name: 'fullscreen';
$fullscreen-x: 33px;
$fullscreen-y: 0px;
$fullscreen-offset-x: -33px;
$fullscreen-offset-y: 0px;
$fullscreen-width: 20px;
$fullscreen-height: 20px;
$fullscreen-total-width: 53px;
$fullscreen-total-height: 32px;
$fullscreen-image: 'sprite.png';
$fullscreen: (33px, 0px, -33px, 0px, 20px, 20px, 53px, 32px, 'sprite.png', 'fullscreen', );
$spritesheet-width: 53px;
$spritesheet-height: 32px;
$spritesheet-image: 'sprite.png';
$spritesheet-sprites: ($caption, $fullscreen, );
$spritesheet: (53px, 32px, 'sprite.png', $spritesheet-sprites, );

// The provided mixins are intended to be used with the array-like variables
//
// .icon-home {
// @include sprite-width($icon-home);
// }
//
// .icon-email {
// @include sprite($icon-email);
// }
//
// Example usage in HTML:
//
// `display: block` sprite:
// <div class="icon-home"></div>
//
// To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class:
//
// // CSS
// .icon {
// display: inline-block;
// }
//
// // HTML
// <i class="icon icon-home"></i>
@mixin sprite-width($sprite) {
width: nth($sprite, 5);
}

@mixin sprite-height($sprite) {
height: nth($sprite, 6);
}

@mixin sprite-position($sprite) {
$sprite-offset-x: nth($sprite, 3);
$sprite-offset-y: nth($sprite, 4);
background-position: $sprite-offset-x $sprite-offset-y;
}

@mixin sprite-image($sprite) {
$sprite-image: nth($sprite, 9);
background-image: url(#{$sprite-image});
}

@mixin sprite($sprite) {
@include sprite-image($sprite);
@include sprite-position($sprite);
@include sprite-width($sprite);
@include sprite-height($sprite);
}

// The `sprites` mixin generates identical output to the CSS template
// but can be overridden inside of SCSS
//
// @include sprites($spritesheet-sprites);
@mixin sprites($sprites) {
@each $sprite in $sprites {
$sprite-name: nth($sprite, 10);
.#{$sprite-name} {
@include sprite($sprite);
}
}
}

0 comments on commit daa6434

Please sign in to comment.