From ece56f340afdd40d87b0b95076ac93e0ac89d0a4 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Thu, 30 Mar 2023 18:07:52 -0500 Subject: [PATCH] Added support for generic screen sizes through scrolling --- _includes/navigation.html | 6 +- _layouts/banner.html | 14 ++- _sass/main.scss | 191 ++++++++++++++++++++++---------------- index.md | 4 +- 4 files changed, 130 insertions(+), 85 deletions(-) diff --git a/_includes/navigation.html b/_includes/navigation.html index b382389..a55977b 100644 --- a/_includes/navigation.html +++ b/_includes/navigation.html @@ -1,12 +1,16 @@ diff --git a/_layouts/banner.html b/_layouts/banner.html index 80d791c..4926510 100644 --- a/_layouts/banner.html +++ b/_layouts/banner.html @@ -80,11 +80,15 @@ {%- endif -%} -
- {{ pair[0] }} -
-
- {{ pair[1] | prepend: "" }} +
+
+
+ {{ pair[0] }} +
+
+ {{ pair[1] | prepend: "" }} +
+
{%- endif -%} diff --git a/_sass/main.scss b/_sass/main.scss index 41353e3..38c5088 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -18,6 +18,10 @@ $font-lighter-color: #525252; /** Element Setup **/ +html { + overflow-x: hidden; +} + html, body { width: 100%; height: 100%; @@ -94,18 +98,21 @@ nav { width: 100%; height: 4em; - z-index: 100; + z-index: 10; background-color: $neutral1; box-shadow: 0 0.25rem 0.25rem rgba(0,0,0,0.5); ul { - max-width: 70%; + width: 98%; margin: 0 auto 0 auto; padding: 0; height: 3.5em; - text-align: right; - align-items: center; + display: flex; + justify-content: space-between; + + overflow-x: auto; + white-space: nowrap; #logo { font-family: $font; @@ -117,6 +124,10 @@ nav { float: left; } + #navItems { + margin-left: 3em; + } + li { width: 10em; height: 100%; @@ -215,7 +226,7 @@ nav { margin: 0 auto 0 auto; text-align: center; - z-index: 10; + z-index: 5; animation: slideUp 0.5s; filter: drop-shadow(0.25em 0.3em 0.4em rgba(0,0,0,0.8)); @@ -285,6 +296,11 @@ nav { } +#bannerContent > h1 { + padding: 1em 2em 0 2em; + text-align: center; +} + #bannerContent { padding-top: 6em !important; background-color: rgba($blue1, 0.1); @@ -295,87 +311,101 @@ nav { left: 0; } - h1 { - padding-left: 2em; - } - .item { width: 100%; - height: 20em; - display: flex; - - padding-top: 7em; - padding-bottom: 7em; + min-height: 25em; + padding-top: 5em; + padding-bottom: 5em; position: relative; - flex-direction: row; - justify-content: space-evenly; - align-items: center; - .description { - width: 40%; - height: 100%; - display: flex; - flex-direction: column; - justify-content: center; - text-align: left; + .itemScroll { + overflow-x: scroll; - h2 { - width: 100%; - margin: 0; - font-size: 2em; - } - - p { - width: 100%; - font-size: 1.2em; - } + position: relative; + z-index: 2; + } - p:last-child { - position: relative; - z-index: 50; - text-align:right; - } - - a { - margin-right: 1em; - padding: 0.8em; - background-color: lighten($blue2, 20%); - color: $neutral1; - border-radius: 13px; - transition: background-color ease-in-out 0.1s; - } + .itemScroll .itemInner { + width: 100%; + min-width: 60em; + padding: 2em 0 2em 0; - a:hover { - background-color: darken(lighten($blue2, 20%), 10%); + + + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + + .description { + width: 40%; + + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + text-align: left; + white-space: normal; + + h2 { + width: 100%; + margin: 0; + font-size: 2em; + } + + p { + width: 100%; + font-size: 1.2em; + margin: 0.5em 0 0.5em 0; + } + + p:last-child { + text-align:right; + } + + a { + margin-right: 1em; + padding: 0.8em; + + font-size: 0.8em; + + background-color: lighten($blue2, 20%); + color: $neutral1; + border-radius: 13px; + transition: background-color ease-in-out 0.1s; + } + + a:hover { + background-color: darken(lighten($blue2, 20%), 10%); + } + + a:active { + background-color: darken(lighten($blue2, 20%), 15%); + } } - a:active { - background-color: darken(lighten($blue2, 20%), 15%); + .image { + width: 20em; + padding-bottom: 20em; + position: relative; + z-index: 20; } - } + img { + position: absolute; + width: 100%; + height: 100%; + top: 0; + bottom: 0; + left: 0; + right: 0; + object-fit: cover; + border-radius: 50%; + border: 5px solid rgba($blue2, 30%); + } - .image { - width: 20em; - padding-bottom: 20em; - position: relative; - z-index: 20; - } - - img { - position: absolute; - width: 100%; - height: 100%; - top: 0; - bottom: 0; - left: 0; - right: 0; - object-fit: cover; - border-radius: 50%; - border: 5px solid rgba($blue2, 30%); } - } .item:nth-child(2) .upAccent { @@ -389,13 +419,9 @@ nav { .item:nth-child(odd) { padding-bottom: 2em; padding-top: 2em; - - .description { - order: 1; - } - .image { - order: 0; + .itemScroll { + direction: rtl; } } } @@ -416,6 +442,11 @@ nav { padding: 2em 4em 4em 4em; z-index: 1; } + + img { + width: 100%; + + } } #afterItems { @@ -430,6 +461,10 @@ nav { padding: 0; } + img { + width: 100%; + } + } diff --git a/index.md b/index.md index c2d242e..a783fed 100644 --- a/index.md +++ b/index.md @@ -26,7 +26,9 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i ## Sample 2 -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [Read More](/research/sample1)