diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 74777b5..011f9c1 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -41,3 +41,10 @@ $(document).ready(function () { }); {{ end }} + + + diff --git a/layouts/shortcodes/box.html b/layouts/shortcodes/box.html index 39a9694..acad83f 100644 --- a/layouts/shortcodes/box.html +++ b/layouts/shortcodes/box.html @@ -1,3 +1,4 @@ -
+{{ $numOfParams := ( len .Params ) }} +
{{ .Inner }}
diff --git a/layouts/shortcodes/embed.html b/layouts/shortcodes/embed.html index 5cdd8f1..7e3a67a 100644 --- a/layouts/shortcodes/embed.html +++ b/layouts/shortcodes/embed.html @@ -1,20 +1,16 @@ {{ if .IsNamedParams }} -
+
{{ with .Get "title" }}
{{ . }}
{{ end }} -
- {{ .Inner }} -
+ {{ .Inner }} {{ with .Get "caption"}}
{{ . }}
{{ end }}
{{ else }} -
-
- {{ .Inner }} -
+
+ {{ .Inner }}
{{ end }} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 9123a09..65273bd 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -1,10 +1,13 @@ {{ $path := "/images/" }} +{{ $filename := .Get "filename" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
{{ with .Get "title" }}
{{ . }}
{{ end }} -{{ with .Get "link"}}{{ end }} +{{ with .Get "link"}} +{{ if eq . "modal" }}{{ else }}{{ end }} +{{ end }} {{ if .Get "link"}}{{ end }} {{ with .Get "caption"}} diff --git a/static/css/base.css b/static/css/base.css index 887f1d2..4bde20a 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -128,7 +128,7 @@ a:hover, } img { - max-width: 100%; + max-width: 95vw; } img.avatar { diff --git a/static/css/page.css b/static/css/page.css index f17ae1d..9187246 100644 --- a/static/css/page.css +++ b/static/css/page.css @@ -8,13 +8,14 @@ display: flex; flex-direction: column; align-items: center; + max-width: 95%; } .section__content ul { display: flex; flex-direction: column; align-items: flex-start; - max-width: 80%; + max-width: 85%; padding-top: 0.3em; padding-bottom: 1em; padding-left: 0.5em; @@ -209,11 +210,6 @@ font-weight: bold; } -.box--image { - max-width: 450px; - padding: 0.5em; -} - .box--headline { } diff --git a/static/js/docready.js b/static/js/docready.js index 03636f7..55570bf 100644 --- a/static/js/docready.js +++ b/static/js/docready.js @@ -1,6 +1,8 @@ // TODO register these individually with window resize use self callled function function resizeElements() { navbarSpacer(); + $('.box--embed > iframe').fitToWindow() + $('.box--image > img').fitToWindow() heroResize(); typeResize(); // for section content $('.section__content--modal').perfectScrollbar('update'); diff --git a/static/js/fitToWindow.js b/static/js/fitToWindow.js index 33a7e87..e8bc5fb 100644 --- a/static/js/fitToWindow.js +++ b/static/js/fitToWindow.js @@ -13,15 +13,16 @@ this.each(function () { let $el = $(this); - console.log(`${maxWidth} ${wPad} ${$el.data('maxWidth')} ${$el.data('wPad')}`) - + console.log(`element ${$el.prop("tagName")} ${$el.attr("class")} parent ${$el.parent().attr('class')}`) + console.log(`before ${maxWidth} ${wPad} ${$el.data('maxWidth')} ${$el.data('wPad')}`) maxWidth = (maxWidth || $el.data('maxWidth')) || 450 + wPad = $el.parent().css("padding-left") > 0 ? $el.parent().css("padding-left") : wPad wPad = (wPad || $el.data('wPad')) || 5 let windowWidth = $(window).width() let newWidth = (windowWidth > maxWidth) ? maxWidth : windowWidth - 2 * wPad - console.log(`${maxWidth} ${wPad} ${newWidth} ${$el.parent().attr('youtube_id')}`) + console.log(`after ${maxWidth} ${wPad} ${newWidth}`) // Initial Aspect given in attributes by element itself let setWidth = $el.attr('width'); @@ -54,7 +55,6 @@ // Set new size of element $el.width(newWidth); $el.height(newHeight); - }); }