diff --git a/assets/css/base.css b/assets/css/base.css index 3f0a636..496d04b 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -26,6 +26,8 @@ body{ display: flex; flex-direction: column; align-items: center; + padding-top: 1em; + padding-bottom: 1em; } /* mobile first column */ diff --git a/assets/css/page.css b/assets/css/page.css index fa0a03e..e3bd920 100644 --- a/assets/css/page.css +++ b/assets/css/page.css @@ -87,6 +87,11 @@ padding-left:1em justify-content: center; } +.box--column { + flex-direction: column; + align-items: center; +} + .box--headline {} .box--text {} @@ -96,8 +101,12 @@ padding-left:1em } .box__embed { + /*height: 100vh;*/ + width: 100%; display: flex; flex-direction: column; + flex-wrap: nowrap; + justify-content: center; align-items: center; } diff --git a/assets/js/docready.js b/assets/js/docready.js index cfeb389..5da9d55 100644 --- a/assets/js/docready.js +++ b/assets/js/docready.js @@ -7,7 +7,7 @@ $(document).ready(function () { thumbWidth: 80, controls: true, loop: false, - download: true, + download: false, counter: true, // videojs: true }); @@ -20,14 +20,9 @@ $(document).ready(function () { $('.nav-bar').css("display", "flex") }); - lg.on('onBeforeOpen.lg', function (event) { - $('.nav-bar').css("display", "none") - }); - // initialize hero size heroResize(); - // iframeResize(); - // jQuery('iframe').fitToParent(); // for all iframes + iframeResize(); $('section').flowtype({ // maximum: 1000, @@ -42,10 +37,9 @@ $(document).ready(function () { }); // resize elements on change - $(window).resize(function () { + $(window).smartresize(function () { heroResize(); - // iframeResize(); - // jQuery('iframe').fitToParent(); + iframeResize(); }); }); diff --git a/assets/js/junk.js b/assets/js/junk.js index 2c0e97d..e0027ea 100644 --- a/assets/js/junk.js +++ b/assets/js/junk.js @@ -1,3 +1,13 @@ +// +// // get all original iframe dimensions +// (function iframeInit() { +// $('iframe').each(function (i) { +// console.log(i, $(this).attr('height'), $(this).attr('width')); +// this.aspect = $(this).attr('height') / $(this).attr('width') +// console.log('aspect iframe', i, this.aspect) +// }) +// }()); + // videos - preload (function videoInit() { diff --git a/assets/js/page.js b/assets/js/page.js index 3625350..1bf9e60 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -1,8 +1,8 @@ // hero resizer function heroResize() { - jQuery('#hero').css({ - width: jQuery(window).width(), - height: jQuery(window).height() + $('#hero').css({ + width: $(window).width(), + height: $(window).height() }); } @@ -22,7 +22,7 @@ $('a[href*="#"]:not([href="#"])').click(function () { } }); -// navbar - preload +// navbar mobile toggle - preload (function navbarInit() { function toggleMobileMenu() { @@ -33,24 +33,47 @@ $('a[href*="#"]:not([href="#"])').click(function () { }()); -// function iframeResize(percent = 1) { -// console.log('window width', percent, $(window).width()) -// console.log('section_content', percent, $('.section__content').width()) -// console.log('box embed width', percent, $('.box__embed').width()) -// $('iframe').each(function (i) { -// console.log('aspect', this.aspect) -// $(this).attr('height', this.aspect * $('.box__embed').width()) -// $(this).attr('width', $('.box__embed').width()) -// }) -// console.log('new width and height', $('iframe')[0].width, $('iframe')[0].height) -// console.log('new width and height', $('iframe')[1].width, $('iframe')[1].height) -// } -// -// // get all original iframe dimensions -// (function iframeInit() { -// $('iframe').each(function (i) { -// console.log(i, $(this).attr('height'), $(this).attr('width')); -// this.aspect = $(this).attr('height') / $(this).attr('width') -// console.log('aspect iframe', i, this.aspect) -// }) -// }()); +function iframeResize(maxWidth = 450) { + var windowWidth = $(window).width() + var width = (windowWidth > maxWidth) ? maxWidth : windowWidth - 20 + // alert(`before ww width ${windowWidth} ${width}`) + jQuery('iframe').fitToParent({ + heightOffset: 0, // (int) Put some space around the element + // widthOffset: 5, // (int) Put some space around the element + // boxHeight: , // (int) Will look for .size-parent, or fallback to parent size + boxWidth: width, // (int) Will look for .size-parent, or fallback to parent size + callback: function (newWidth, newHeight) { + // alert(`after w h ${newWidth} ${newHeight}`) + // Fires after fitting is complete + } + }) +} + +// debouncing function for window resize from John Hann +// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ +(function ($, sr) { + var debounce = function (func, threshold, execAsap) { + var timeout; + + return function debounced() { + var obj = this, + args = arguments; + + function delayed() { + if (!execAsap) + func.apply(obj, args); + timeout = null; + }; + + if (timeout) + clearTimeout(timeout); + else if (execAsap) + func.apply(obj, args); + + timeout = setTimeout(delayed, threshold || 100); + }; + } + // smartresize + jQuery.fn[sr] = function (fn) { return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; + +})(jQuery, 'smartresize'); diff --git a/content/about.md b/content/about.md index bd6b5d0..5669630 100644 --- a/content/about.md +++ b/content/about.md @@ -10,5 +10,5 @@ anchor="atext ut" Built in 1977 in Central Point, Oregon this 1548 sq. ft. Rambler/Ranch Style House has 3 bedrooms, 2 baths, covered patio, and an attached 2-car garage. It would be perfect for two child family or a couple wanting a spare bedroom and an office. Since 2007 the house has had numerous updates and is move-in ready. It is located within easy walking distance to Central Point's high and middle schools as well as the Bear Creek Greenway, Jackson County Expo and a RVTD bus stop. {{< embed type="google-map" title="A Title" caption="A caption" >}} - + {{< /embed >}} diff --git a/content/photos.md b/content/photos.md index 3b48c83..da0ad13 100644 --- a/content/photos.md +++ b/content/photos.md @@ -4,4 +4,4 @@ title = "Photo Gallery" link_text = "Photos" weight = 2 +++ -{{% gallery %}} +{{% 4005-gallery %}} diff --git a/content/video.md b/content/video.md index bd65b88..36e0b78 100644 --- a/content/video.md +++ b/content/video.md @@ -4,6 +4,6 @@ title = "Video Walk Through" weight = 3 link_text = "Video" +++ -{{< embed youtube-video >}} - +{{< embed youtube >}} + {{< /embed }} diff --git a/layouts/partials/js.html b/layouts/partials/js.html index e0edcd4..f663872 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -16,6 +16,9 @@ {{ end }} + + + diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/4005-gallery.html similarity index 100% rename from layouts/shortcodes/gallery.html rename to layouts/shortcodes/4005-gallery.html diff --git a/layouts/shortcodes/embed.html b/layouts/shortcodes/embed.html index a18e728..84c002f 100644 --- a/layouts/shortcodes/embed.html +++ b/layouts/shortcodes/embed.html @@ -1,19 +1,20 @@ {{ if .IsNamedParams }}
- {{ with .Get "title" }} -
{{ . }}
- {{ end }} {{ with .Get "caption"}} -
{{ . }}
- {{ end }} + {{ with .Get "title" }} +
{{ . }}
+ {{ end }}
{{ .Inner }}
-
- {{ else }} -
-
- {{ .Inner }} -
-
+ {{ with .Get "caption"}} +
{{ . }}
{{ end }} + +{{ else }} +
+
+ {{ .Inner }} +
+
+{{ end }}