// Size each section according to its content and background image ratio\r
sections.each(function () {\r
\r
+ if ($(this).data('section-name') === 'intro') {\r
+ $(this).css('height', 'auto');\r
+ return true;\r
+ }\r
+\r
var bgHolder = $(this).find('[data-bg-ratio]'),\r
bgHeight = 0,\r
contentHeight = $(this).find('.content-inner').outerHeight() + 100; // + extra padding height for content\r
\r
- if (bgHolder.length > 0) {\r
- bgHeight = Math.round(bgHolder.outerWidth() * bgHolder.data('bg-ratio')) + 50; // + extra space for background\r
- }\r
+ // if (bgHolder.length > 0) {\r
+ // bgHeight = Math.round(bgHolder.outerWidth() * bgHolder.data('bg-ratio')) + 50; // + extra space for background\r
+ // }\r
\r
$(this).css('height', Math.max(bgHeight, contentHeight));\r
});\r
function isTallEnough() {\r
\r
// Get available height for contents\r
- var wh = $(window).height() - $('#h').outerHeight();\r
+ var wh = $(window).height() - Math.round(zoom * $('#h').outerHeight()); // Subtract scaled header menu height\r
var ok = true;\r
var bgHeight = 0;\r
var contentHeight;\r
var sectionHeight;\r
\r
- $('section .content-wrapper').each(function () {\r
+ $('.home .section:not(.contactFooter)').each(function () {\r
\r
// First, check if the section has a background image that forces a minimum ratio for the size\r
- if ($(this).data('bg-ratio')) {\r
- bgHeight = $(this).data('bg-ratio') * $(this).outerWidth();\r
- }\r
+ // if ($(this).find('.content-wrapper').data('bg-ratio')) {\r
+ // bgHeight = $(this).find('.content-wrapper').data('bg-ratio') * $(this).outerWidth();\r
+ // }\r
+\r
+ //console.log(`wh: ${wh} | bgHeight: ${bgHeight}`);\r
\r
// Get height of actual content\r
contentHeight = $(this).find('.content-inner').outerHeight();\r
\r
// Largest dimension of the two wins\r
- // sectionHeight = Math.max(bgHeight, contentHeight);\r
- sectionHeight = contentHeight; // Not taking into account the bg height for now.\r
+ //sectionHeight = Math.max(bgHeight, contentHeight);\r
+ sectionHeight = contentHeight; // No longer taking into account the bg height because it's contained via object-fit\r
+\r
+ // Special case: if there's a logo bar present, we need to add that to the height\r
+ var logos = $(this).find('.logos-wrapper');\r
+ var logosHeight = logos.length ? logos.outerHeight() : 0;\r
\r
+ //console.log('logosHeight', logosHeight);\r
+ sectionHeight = sectionHeight + logosHeight;\r
+ // console.log('Section height', sectionHeight);\r
+ sectionHeight = Math.round(sectionHeight * zoom);\r
+ // console.log('Section height SCALED', sectionHeight);\r
\r
- //console.info(sectionHeight + ' > ' + wh + '? ' + $(this).parent().data('section-name'));\r
+ //console.info(sectionHeight + ' > ' + wh + '? ' + logosHeight + ' [' + (wh - sectionHeight) + ']' + $(this).data('section-name'));\r
if (sectionHeight > wh) {\r
- //console.warn($(this).parent().data('section-name') + ' section is too tall...');\r
+ //console.warn($(this).data('section-name') + ' section is too tall... ' + sectionHeight + ' vs ' + wh);\r
ok = false;\r
return false;\r
}\r
$(".contactFooter .content-wrapper").css({paddingTop: '5%'});\r
}\r
\r
-}
\ No newline at end of file
+}\r
@import "000-imports";\r
\r
.home {\r
- .content-wrapper.fullheight {\r
- position: relative;\r
- background-position: bottom right;\r
-\r
- @media @m900 {\r
- background-size: 180%;\r
- }\r
+ .content-wrapper {\r
+ &.fullheight {\r
+ position: relative;\r
+ background-position: bottom right;\r
\r
- &[data-has-mobile="1"] .content-inner {\r
@media @m900 {\r
- padding-bottom: 55%;\r
+ background-size: 180%;\r
+ }\r
+\r
+ &[data-has-mobile="1"] .content-inner {\r
+ @media @m900 {\r
+ padding-bottom: 55%;\r
+ }\r
}\r
}\r
- }\r
+\r
+ // Make picture element behave like a background image so it doesn't overlap\r
+ // the header area (image itself should have necessary whitespace included)\r
+ .picture picture img {\r
+ height: 100%; // Needed along with width:100% so that object-fit works\r
+ object-fit: contain;\r
+ object-position: bottom right;\r
+ }\r
+}\r
\r
.content-inner {\r
position: absolute;\r
- padding: 0 5%;\r
+ padding: 3% 5%;\r
top: 50%;\r
left: 0;\r
width: 100%;\r
padding-top: 5%;\r
padding-bottom: 80%;\r
text-align: center;\r
-\r
-\r
}\r
-\r
-\r
}\r
\r
.btn {\r
span {\r
display: none;\r
}\r
-}
\ No newline at end of file
+}\r