diff --git a/app.js b/app.js index d5591aea..8e3fb40f 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,10 @@ const hamburger = document.querySelector('.header .nav-bar .nav-list .hamburger' const mobile_menu = document.querySelector('.header .nav-bar .nav-list ul'); const menu_item = document.querySelectorAll('.header .nav-bar .nav-list ul li a'); const header = document.querySelector('.header.container'); +let buttonOfuP = document.getElementById('buttonOfuP') +let date = document.getElementById('date') + + hamburger.addEventListener('click', () => { hamburger.classList.toggle('active'); @@ -23,3 +27,24 @@ menu_item.forEach((item) => { mobile_menu.classList.toggle('active'); }); }); + + +window.addEventListener("DOMContentLoaded", + function () { + document.addEventListener('scroll', () => { + if (window.scrollY == 0) + buttonOfuP.classList.add("hideButtonOfuP") + else + buttonOfuP.classList.remove("hideButtonOfuP") + }) + buttonOfuP.addEventListener('click', () => { + window.scroll(0, 0) + }) + }); + + +window.addEventListener('DOMContentLoaded', () => { + newDate = new Date + date.innerText = newDate.getFullYear() +}) + diff --git a/img/go-up.png b/img/go-up.png new file mode 100644 index 00000000..c9e5ff2b Binary files /dev/null and b/img/go-up.png differ diff --git a/img/myHpoto.png b/img/myHpoto.png new file mode 100644 index 00000000..47b06e30 Binary files /dev/null and b/img/myHpoto.png differ diff --git a/index.html b/index.html index 1a429961..260c3396 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,10 @@ - +
@@ -231,17 +234,20 @@

Your Complete Web Solution

-
-

Copyright © 2020 Arfan. All rights reserved

+

Copyright © Arfan. All rights reserved

+ + +
+ image +
+ diff --git a/style.css b/style.css index 3f690465..5f605b0f 100644 --- a/style.css +++ b/style.css @@ -198,6 +198,18 @@ p { } /* End Header section */ +/* add my photo */ +#myPhoto{ + position: fixed; + height: 60px; + width: 41px; + top: 0px; + left: 0px; + z-index: 1000; + padding-right: 6px; +} +/* and small photo*/ + /* Hero Section */ #hero { background-image: url(./img/hero-bg.png); @@ -701,3 +713,18 @@ p { } } /* End Media Query For Desktop */ + +/* Button for go up */ +#buttonOfuP{ + height: 50px; + width: 50px; + position: fixed; + bottom: 0px; + right: 0px; + z-index: 100; +} + +.hideButtonOfuP{ + visibility: hidden; +} +/* Buttan for go up */