From 4a57f86f0da0dee93f97f55edf9234bd2cccdbd1 Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Mon, 5 Oct 2020 21:01:08 -0400 Subject: [PATCH 1/4] change to css based smooth scrolling --- assets/js/script.js | 16 ---------------- assets/scss/_common.scss | 14 +++++++++++++- layouts/partials/footer.html | 4 +++- layouts/partials/navbar.html | 3 +-- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index 9a943627..c6b9ba1e 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -66,22 +66,6 @@ $(document).ready(function () { } }); - // Smooth scrolling - var scrollLink = $(".scroll"); - scrollLink.click(function (e) { - e.preventDefault(); - $("body,html").animate( - { - scrollTop: $(this.hash).offset().top, - }, - 1000 - ); - }); - - $(".navbar-nav>li>a").on("click", function () { - $(".navbar-collapse").collapse("hide"); - }); - // service slider $(".service__slider").slick({ infinite: false, diff --git a/assets/scss/_common.scss b/assets/scss/_common.scss index a1387c55..d3c7e574 100644 --- a/assets/scss/_common.scss +++ b/assets/scss/_common.scss @@ -1,4 +1,4 @@ -.section{ +.section { padding: 100px 0; } @@ -8,3 +8,15 @@ margin-right: 0; } +/** + * Enable smooth scrolling on all pages + */ +html { + scroll-behavior: smooth; +} + +@media screen and (prefers-reduced-motion: reduce) { + html { + scroll-behavior: auto; + } +} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 966ec505..734b5830 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -45,7 +45,9 @@

Sitemap

diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index e7d28bf9..7ceafe47 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -14,8 +14,7 @@ {{ $menu := .Site.Menus.main }} {{ range $index, $element := $menu }} {{ end }} From 5bd5ad80cc20f4176d9d455a867b1a9a2eb4d1b9 Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Mon, 5 Oct 2020 22:40:38 -0400 Subject: [PATCH 2/4] update config.toml --- exampleSite/config.toml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 974fa04a..95b51492 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -10,46 +10,38 @@ url = "#home" weight = 1 [[menu.main]] name = "About" -url = "#about" +url = "/#about" weight = 2 [[menu.main]] name = "Service" -url = "#service" +url = "/#service" weight = 3 [[menu.main]] name = "Work" -url = "#portfolio" +url = "/#portfolio" weight = 4 [[menu.main]] name = "Resume" -url = "#resume" +url = "/#resume" weight = 5 [[menu.main]] name = "Blog" -url = "#blog" +url = "/blog" weight = 6 [[menu.main]] name = "Contact" -url = "#contact" +url = "/contact" weight = 7 # Sitemap Menu [[menu.sitemap]] name = "About me" -url = "about" +url = "/#about" weight = 1 [[menu.sitemap]] -name = "Frequently Ask Question" -url = "#" -weight = 2 -[[menu.sitemap]] -name = "Privacy & Policy" -url = "#" -weight = 3 -[[menu.sitemap]] name = "Latest Article" -url = "#" -weight = 4 +url = "/blog" +weight = 2 [params] blogPageURL = "blog" From 3fbbbd23f47a5b034274d17215ac86fe6366714e Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Mon, 5 Oct 2020 23:02:38 -0400 Subject: [PATCH 3/4] make header & footer configurable --- exampleSite/config.toml | 10 +++++++++- layouts/partials/footer.html | 8 ++++---- layouts/partials/navbar.html | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 95b51492..f9d818e3 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -47,11 +47,19 @@ weight = 2 blogPageURL = "blog" contactLink = "contact" copyright = "All right reserved copyright © Portio 2020" -footerLogo = "images/contact/widget-logo.png" formspreeURL = "YOUR FORMSPREE URL" googleAnalytics = "YOUR GOOGLE ANALYTICS CODE" logo = "images/site-navigation/logo.png" +footerButtonTarget = "/contact" +footerButtonText = "Get in Touch" +footerCallToAction = "Let's Start a Project" +footerLogo = "images/contact/widget-logo.png" +footerTopTitle = "Contact me" + +headerButtonTarget = "/contact" +headerButtonText = "Hire Me Now" + [params.address] address = "23 Khan Niketon, Grand Street, NYK." email = "hello@example.com" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 734b5830..a2c05e6a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -23,12 +23,12 @@ diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 7ceafe47..eba247ef 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -19,7 +19,8 @@ {{ end }} From 8da2935cdd70a4041d1567bbc29bb063942a1763 Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Tue, 6 Oct 2020 15:56:21 -0400 Subject: [PATCH 4/4] fix footer target --- layouts/partials/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a2c05e6a..e6b12802 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -28,7 +28,7 @@

{{ .Site.Params.FooterCallToAction }}