diff --git a/assets/sass/abstracts/_responsive.scss b/assets/sass/abstracts/_responsive.scss new file mode 100644 index 00000000..9ea7da2a --- /dev/null +++ b/assets/sass/abstracts/_responsive.scss @@ -0,0 +1,9 @@ +@charset "UTF-8"; + +// Responsive Awesomeness +@media screen and (max-width: $responsive-width) { + @include responsive--global(); + @include responsive--home(); + @include responsive--notes(); + @include responsive--videos(); +} diff --git a/assets/sass/components/_logo.scss b/assets/sass/components/_logo.scss index 537df33d..b33c4568 100644 --- a/assets/sass/components/_logo.scss +++ b/assets/sass/components/_logo.scss @@ -1,7 +1,6 @@ @charset "UTF-8"; // nifty color swapping on svg logo hover - a#logo { &:hover { $logo-original1: #6fbc4e; @@ -9,13 +8,13 @@ a#logo { $logo-original3: #009cdf; svg { - g#color1 { + g#c1 { fill: $logo-original2; } - g#color2 { + g#c2 { fill: $logo-original3; } - g#color3 { + g#c3 { fill: $logo-original1; } } diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 5dddebe0..2c88f5e4 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -14,8 +14,8 @@ @import 'pages/notes'; @import 'pages/videos'; -// Responsive Pages -@import 'pages/responsive/global'; +// Responsive Mixins +@import 'abstracts/responsive'; // Miscellaneous @import 'components/logo'; diff --git a/assets/sass/pages/_global.scss b/assets/sass/pages/_global.scss index 7eeae736..7c2f7b21 100644 --- a/assets/sass/pages/_global.scss +++ b/assets/sass/pages/_global.scss @@ -33,3 +33,15 @@ body { } } } + + +// Responsive +@mixin responsive--global() { + body { + // Safari iOS menu bar reappers below 44px: + // https://www.eventbrite.com/engineering/mobile-safari-why/ + padding-bottom: 45px !important; + // Allows you to scroll below the viewport; default value is visible + overflow-y: scroll; + } +} diff --git a/assets/sass/pages/_home.scss b/assets/sass/pages/_home.scss index 004c3abf..5f0238d2 100644 --- a/assets/sass/pages/_home.scss +++ b/assets/sass/pages/_home.scss @@ -136,3 +136,48 @@ body#home { transform-origin: 70% 70%; } } + + +// Responsive +@mixin responsive--home() { + body#home { + font-size: 1em; + padding: 25px; + + p { + font-size: 1.1em; + } + + img#me { + width: 68px; + height: 68px; + padding: 2px; + } + + footer div { + &#panda { + display: none; + } + + &#blog, + &#info { + width: 50%; + } + + &#blog { + font-size: 1em; + line-height: 1.5; + } + + &#info { + font-size: 0.7em; + line-height: 2.1; // magic numbers don't judge + + span#copyright::after { + content: "\A"; + white-space: pre; + } + } + } + } +} diff --git a/assets/sass/pages/_notes.scss b/assets/sass/pages/_notes.scss index 1bf3bba6..6bc84cc0 100644 --- a/assets/sass/pages/_notes.scss +++ b/assets/sass/pages/_notes.scss @@ -215,7 +215,10 @@ body#notes { video.embed { display: block; - margin: 0 auto; + margin: 1em auto; + max-width: 100%; + height: auto; + border: 0; } div.embed.video-player { @@ -302,3 +305,74 @@ body#notes { } } } + + +// Responsive +@mixin responsive--notes() { + body#notes { + padding: 0 20px; + width: 100%; + max-width: 100%; + + header { + nav { + padding: 5px 0; + + a#logo { + padding: 10px; + + img, + svg { + height: 60px; + width: auto; + } + + span#name { + display: none; + } + } + + ul { + font-size: 1.75em; + margin-right: 10px; + + li { + width: 55px; + } + } + } + } + + footer div { + &#panda { + display: none; + } + + &#copyright, + &#poweredby { + line-height: 1.8; + width: 50%; + } + + &#poweredby { + a#hugo::after { + content: "\A"; + white-space: pre; + } + } + } + + main#archive section.year { + font-size: 1em; + } + + main#single article { + width: 100%; + max-width: 100%; + + div#info h1 { + font-size: 1.7em; + } + } + } +} diff --git a/assets/sass/pages/_videos.scss b/assets/sass/pages/_videos.scss index 73ee0073..c1f8d26a 100644 --- a/assets/sass/pages/_videos.scss +++ b/assets/sass/pages/_videos.scss @@ -30,3 +30,21 @@ body#videos { font-family: inherit; // for subtitles } } + + +// Responsive +@mixin responsive--videos() { + body#videos { + margin: 20px 0; + + h1 { + font-size: 1.6em; + padding: 0 10px; + } + + video { + width: 100%; + height: auto; + } + } +} diff --git a/assets/sass/pages/responsive/_global.scss b/assets/sass/pages/responsive/_global.scss deleted file mode 100644 index 09e860f6..00000000 --- a/assets/sass/pages/responsive/_global.scss +++ /dev/null @@ -1,16 +0,0 @@ -@charset "UTF-8"; - -// Responsive Awesomeness -@media screen and (max-width: $responsive-width) { - body { - // Safari iOS menu bar reappers below 44px: - // https://www.eventbrite.com/engineering/mobile-safari-why/ - padding-bottom: 45px !important; - // Allows you to scroll below the viewport; default value is visible - overflow-y: scroll; - } - - @import 'home'; - @import 'notes'; - @import 'videos'; -} diff --git a/assets/sass/pages/responsive/_home.scss b/assets/sass/pages/responsive/_home.scss deleted file mode 100644 index 3799804c..00000000 --- a/assets/sass/pages/responsive/_home.scss +++ /dev/null @@ -1,43 +0,0 @@ -@charset "UTF-8"; - -// Responsive Home -body#home { - font-size: 1em; - padding: 25px; - - p { - font-size: 1.1em; - } - - img#me { - width: 68px; - height: 68px; - padding: 2px; - } - - footer div { - &#panda { - display: none; - } - - &#blog, - &#info { - width: 50%; - } - - &#blog { - font-size: 1em; - line-height: 1.5; - } - - &#info { - font-size: 0.7em; - line-height: 2.1; // magic numbers don't judge - - span#copyright::after { - content: "\A"; - white-space: pre; - } - } - } -} diff --git a/assets/sass/pages/responsive/_notes.scss b/assets/sass/pages/responsive/_notes.scss deleted file mode 100644 index 35d137bb..00000000 --- a/assets/sass/pages/responsive/_notes.scss +++ /dev/null @@ -1,69 +0,0 @@ -@charset "UTF-8"; - -// Responsive Blog -body#notes { - padding: 0 20px; - width: 100%; - max-width: 100%; - - header { - nav { - padding: 5px 0; - - a#logo { - padding: 10px; - - img, - svg { - height: 60px; - width: auto; - } - - span#name { - display: none; - } - } - - ul { - font-size: 1.75em; - margin-right: 10px; - - li { - width: 55px; - } - } - } - } - - footer div { - &#panda { - display: none; - } - - &#copyright, - &#poweredby { - line-height: 1.8; - width: 50%; - } - - &#poweredby { - a#hugo::after { - content: "\A"; - white-space: pre; - } - } - } - - main#archive section.year { - font-size: 1em; - } - - main#single article { - width: 100%; - max-width: 100%; - - div#info h1 { - font-size: 1.7em; - } - } -} diff --git a/assets/sass/pages/responsive/_videos.scss b/assets/sass/pages/responsive/_videos.scss deleted file mode 100644 index cb264063..00000000 --- a/assets/sass/pages/responsive/_videos.scss +++ /dev/null @@ -1,16 +0,0 @@ -@charset "UTF-8"; - -// Responsive Videos -body#videos { - margin: 20px 0; - - h1 { - font-size: 1.6em; - padding: 0 10px; - } - - video { - width: 100%; - height: auto; - } -} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 49706593..8939fab6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,4 +1,3 @@ -{{ if eq hugo.Environment "production" }}{{ partial "stats.html" . }}{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a0a06853..504a8e17 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -44,7 +44,6 @@ - \ No newline at end of file diff --git a/layouts/partials/logo.html b/layouts/partials/logo.html index e892f59e..6c783809 100644 --- a/layouts/partials/logo.html +++ b/layouts/partials/logo.html @@ -1,14 +1,14 @@ - + - + - + diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index d971fa2b..58f8bd93 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -1,5 +1,4 @@ - {{- $original := .Page.Resources.GetMatch (.Get "src") -}} {{- .Scratch.Set "image" $original -}} @@ -24,13 +23,16 @@ {{- $image := .Scratch.Get "image" -}} +{{- $displayWidth := (math.Round (div $image.Width 2)) -}} +{{- $displayHeight := (math.Round (div $image.Height 2)) -}} + {{- if .Get "caption" -}}
{{- else -}}

{{- end -}} -{{ .Get +{{ .Get {{- if .Get "caption" -}}

{{ .Get "caption" }}
diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html index 39086d70..2134c0ed 100644 --- a/layouts/shortcodes/video.html +++ b/layouts/shortcodes/video.html @@ -1,7 +1,12 @@ - \ No newline at end of file +