From 0a33eb0ed0fffda1e3f6af61e425c2444165fcd5 Mon Sep 17 00:00:00 2001 From: muskan shaikh Date: Sat, 3 Oct 2020 15:18:06 +0530 Subject: [PATCH] added scrolltotop function and changes font style --- app.js | 20 ++++++++++++++++++++ index.html | 4 +++- style.css | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index d5591aea..8ac3263c 100644 --- a/app.js +++ b/app.js @@ -23,3 +23,23 @@ menu_item.forEach((item) => { mobile_menu.classList.toggle('active'); }); }); + +var mybutton = document.getElementById("back2Top"); + + +window.onscroll = function() {scrollFunction()}; + +function scrollFunction() { + if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { + mybutton.style.display = "block"; + } else { + mybutton.style.display = "none"; + } +} + +// When the user clicks on the button, scroll to the top of the document +function topFunction() { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; +} + diff --git a/index.html b/index.html index 6624159e..6fb92dd0 100644 --- a/index.html +++ b/index.html @@ -212,6 +212,8 @@

Your Complete Web Solution

+ + - \ No newline at end of file + diff --git a/style.css b/style.css index 62948890..bdacf550 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,5 @@ -@import 'https://fonts.googleapis.com/css?family=Montserrat:300, 400, 700&display=swap'; + +@import 'https://fonts.googleapis.com/css2?family=David+Libre&display=swap'; * { padding: 0; margin: 0; @@ -6,7 +7,7 @@ } html { font-size: 10px; - font-family: 'Montserrat', sans-serif; + font-family: 'David Libre', serif; scroll-behavior: smooth; } a { @@ -36,7 +37,7 @@ p { font-size: 4rem; font-weight: 300; color: black; - margin-bottom: 10px; + margin-bottom: 30px; text-transform: uppercase; letter-spacing: .2rem; text-align: center; @@ -298,6 +299,11 @@ p { z-index: 1; overflow: hidden; } + +#services .service-item:hover{ + transform: scale(1.09); + +} #services .service-item::after { content: ''; position: absolute; @@ -530,6 +536,32 @@ p { } /* End Footer */ +#back2Top { + width: 40px; + line-height: 40px; + overflow: hidden; + z-index: 999; + display: none; + cursor: pointer; + -moz-transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -o-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); + position: fixed; + bottom: 30px; + right: 20px; + background-color: #DDD; + color: #555; + text-align: center; + font-size: 30px; + text-decoration: none; +} +#back2Top:hover { + background-color: #DDF; + color: #000; +} + /* Keyframes */ @keyframes hamburger_puls { 0% {