diff --git a/Natours/starter/css/style.css b/Natours/starter/css/style.css index 8a6e65e..faf1b50 100644 --- a/Natours/starter/css/style.css +++ b/Natours/starter/css/style.css @@ -554,6 +554,117 @@ body { width: 80%; float: right; } +.navigation__checkbox { + display: none; } + +.navigation__button { + background-color: #fff; + height: 7rem; + width: 7rem; + position: fixed; + top: 6rem; + right: 6rem; + border-radius: 50%; + z-index: 2000; + box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1); + text-align: center; + cursor: pointer; } + +.navigation__background { + height: 6rem; + width: 6rem; + border-radius: 50%; + position: fixed; + top: 6.5rem; + right: 6.5rem; + background-image: radial-gradient(#7ed56f, #28b485); + z-index: 1000; + transition: transform 0.8s cubic-bezier(0.83, 0, 0.17, 1); } + +.navigation__nav { + height: 100vh; + position: fixed; + top: 0; + left: 0; + z-index: 1500; + opacity: 0; + width: 0; + transition: all 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.6); } + +.navigation__list { + width: 100%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + list-style: none; + text-align: center; } + +.navigation__item { + margin: 1rem; } + +.navigation__link:link, .navigation__link:visited { + display: inline-block; + font-size: 3rem; + font-weight: 300; + padding: 1rem 2rem; + color: #fff; + text-decoration: none; + text-transform: uppercase; + background-image: linear-gradient(120deg, transparent 0%, transparent 50%, #fff 50%); + background-size: 250%; + transition: all 0.4s; } + .navigation__link:link span, .navigation__link:visited span { + margin-right: 1.5rem; + display: inline-block; } + +.navigation__link:hover, .navigation__link:active { + color: #28b485; + background-position: 100%; + transform: translateX(1rem); } + +.navigation__checkbox:checked ~ .navigation__background { + transform: scale(80); } + +.navigation__checkbox:checked ~ .navigation__nav { + opacity: 1; + width: 100%; } + +.navigation__icon { + position: relative; + margin-top: 3.4rem; } + .navigation__icon, .navigation__icon::before, .navigation__icon::after { + width: 3rem; + height: 2px; + background-color: #333; + display: inline-block; } + .navigation__icon::before, .navigation__icon::after { + content: ""; + position: absolute; + left: 0; + transition: all 0.2s; } + .navigation__icon::before { + top: -0.8rem; } + .navigation__icon::after { + top: 0.8rem; } + +.navigation__button:hover .navigation__icon::before { + top: -1rem; } + +.navigation__button:hover .navigation__icon::after { + top: 1rem; } + +.navigation__checkbox:checked + .navigation__button .navigation__icon { + background-color: transparent; } + +.navigation__checkbox:checked + .navigation__button .navigation__icon::before { + top: 0; + transform: rotate(135deg); } + +.navigation__checkbox:checked + .navigation__button .navigation__icon::after { + top: 0; + transform: rotate(-135deg); } + .section-about { background-color: #f7f7f7; padding: 25rem 0; diff --git a/Natours/starter/index.html b/Natours/starter/index.html index d22ac08..ba94f13 100644 --- a/Natours/starter/index.html +++ b/Natours/starter/index.html @@ -18,6 +18,48 @@
diff --git a/Natours/starter/sass/layout/_navigation.scss b/Natours/starter/sass/layout/_navigation.scss
new file mode 100644
index 0000000..5b68bf6
--- /dev/null
+++ b/Natours/starter/sass/layout/_navigation.scss
@@ -0,0 +1,164 @@
+.navigation {
+ &__checkbox {
+ display: none;
+ }
+
+ &__button {
+ background-color: $color-white;
+ height: 7rem;
+ width: 7rem;
+ position: fixed;
+ top: 6rem;
+ right: 6rem;
+ border-radius: 50%;
+ z-index: 2000;
+ box-shadow: 0 1rem 3rem rgba($color-black, 0.1);
+
+ text-align: center;
+
+ cursor: pointer;
+ }
+
+ &__background {
+ height: 6rem;
+ width: 6rem;
+ border-radius: 50%;
+ position: fixed;
+ top: 6.5rem;
+ right: 6.5rem;
+ background-image: radial-gradient(
+ $color-primary-light,
+ $color-primary-dark
+ );
+ z-index: 1000;
+ transition: transform 0.8s cubic-bezier(0.83, 0, 0.17, 1);
+
+ // transform: scale(80);
+ }
+
+ &__nav {
+ height: 100vh;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 1500;
+
+ opacity: 0;
+ width: 0;
+
+ transition: all 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.6);
+ }
+
+ &__list {
+ width: 100%;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ list-style: none;
+ text-align: center;
+ }
+
+ &__item {
+ margin: 1rem;
+ }
+
+ &__link {
+ &:link,
+ &:visited {
+ display: inline-block;
+ font-size: 3rem;
+ font-weight: 300;
+ padding: 1rem 2rem;
+ color: $color-white;
+ text-decoration: none;
+ text-transform: uppercase;
+
+ background-image: linear-gradient(
+ 120deg,
+ transparent 0%,
+ transparent 50%,
+ $color-white 50%
+ );
+
+ background-size: 250%;
+ transition: all 0.4s;
+
+ span {
+ margin-right: 1.5rem;
+ display: inline-block;
+ }
+ }
+
+ &:hover,
+ &:active {
+ color: $color-primary-dark;
+ background-position: 100%;
+ transform: translateX(1rem);
+ }
+ }
+
+ //FUNCTIONALITY
+ &__checkbox:checked ~ &__background {
+ transform: scale(80);
+ }
+
+ &__checkbox:checked ~ &__nav {
+ opacity: 1;
+ width: 100%;
+ }
+
+ //ICON
+ &__icon {
+ position: relative;
+ margin-top: 3.4rem;
+
+ &,
+ &::before,
+ &::after {
+ width: 3rem;
+ height: 2px;
+ background-color: $color-gray-dark-3;
+ display: inline-block;
+ }
+
+ &::before,
+ &::after {
+ content: "";
+ position: absolute;
+ left: 0;
+ transition: all 0.2s;
+ }
+
+ //TODO: check transform origin
+ &::before {
+ top: -0.8rem;
+ }
+
+ &::after {
+ top: 0.8rem;
+ }
+ }
+
+ &__button:hover &__icon::before {
+ top: -1rem;
+ }
+
+ &__button:hover &__icon::after {
+ top: 1rem;
+ }
+
+ &__checkbox:checked + &__button &__icon {
+ background-color: transparent;
+ }
+
+ &__checkbox:checked + &__button &__icon::before {
+ top: 0;
+ transform: rotate(135deg);
+ }
+
+ &__checkbox:checked + &__button &__icon::after {
+ top: 0;
+ transform: rotate(-135deg);
+ }
+}
diff --git a/Natours/starter/sass/main.scss b/Natours/starter/sass/main.scss
index 95e71d6..8ead117 100644
--- a/Natours/starter/sass/main.scss
+++ b/Natours/starter/sass/main.scss
@@ -18,5 +18,6 @@
@import "layout/header";
@import "layout/grid";
@import "layout/footer";
+@import "layout/navigation";
@import "pages/home";