Skip to content

Commit 7667f2d

Browse files
Scroll To Top Added
1 parent 4b7be97 commit 7667f2d

File tree

5 files changed

+73
-5
lines changed

5 files changed

+73
-5
lines changed

css/style.css

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/style.scss

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@ body {
2020
}
2121

2222
/* Loader Screen Ends */
23+
/* Top Slider */
24+
25+
.top {
26+
position: fixed;
27+
width: 50px;
28+
height: 50px;
29+
background-color: rgb(255, 88, 116);
30+
bottom: 0;
31+
right: 0;
32+
color: #fff;
33+
display: none;
34+
z-index: 999999;
35+
36+
i {
37+
position: absolute;
38+
top: 50%;
39+
left: 50%;
40+
transform: translate(-50%, -50%);
41+
font-size: 30px;
42+
}
43+
}
44+
45+
/* Top Slider Ends */
46+
2347
hr {
2448
border: 1px solid #000000;
2549
width: 20%;
@@ -77,7 +101,6 @@ hr {
77101
.owl-carousel .owl-item img {
78102
margin-left: auto;
79103
margin-right: auto;
80-
width: 80%;
81104
}
82105

83106
div.type-wrap {
@@ -96,6 +119,12 @@ div.type-wrap {
96119
top: 50%;
97120
left: 50%;
98121
transform: translate(-50%, -50%);
122+
123+
.work {
124+
img {
125+
width: 50%;
126+
}
127+
}
99128
}
100129

101130
/* Title Ends */

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
<!-- Loader screen -->
5252
<div class="se-pre-con"></div>
5353
<!-- Loader Screen Ends -->
54+
<!-- Top Slider -->
55+
<div class="top">
56+
<i class="fas fa-long-arrow-alt-up"></i>
57+
</div>
58+
<!-- Top Slider Ends -->
5459
<!-- Navigation Bar Starts -->
5560
<div class="container-fluid m-0 p-0">
5661
<nav class="navbar navbar-expand-lg navbar-dark py-0 m-0">
@@ -66,7 +71,7 @@ <h1 class="">Programmer Gaurav</h1>
6671
<div class="collapse navbar-collapse" id="navbarSupportedContent">
6772
<ul class="navbar-nav ml-auto">
6873
<li class="nav-item active">
69-
<a title="Home Navigation" class="nav-link" href="/#home">Home</a>
74+
<a title="Home Navigation" class="nav-link" href="#home">Home</a>
7075
</li>
7176
<li class="nav-item">
7277
<a title="About Navigation" class="nav-link" href="#about">About</a>
@@ -87,7 +92,7 @@ <h1 class="">Programmer Gaurav</h1>
8792
<div class="parallax" id="home">
8893
<!-- Title Starts -->
8994
<div class="title">
90-
<div class="container">
95+
<div class="container-fluid">
9196
<div class="row">
9297
<div class="col-12">
9398
<div class="type-wrap mb">

js/script.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ $(document).ready(function () {
1111
$(window).scroll(function () {
1212
if ($(document).scrollTop() > 50) {
1313
$(".navbar").css("background-color", "#111111");
14+
$(".top").css("display", "block");
1415
} else {
1516
$(".navbar").css("background-color", "transparent");
17+
$(".top").css("display", "none");
1618
}
1719
});
1820
$('.navbar-collapse a').click(function () {
1921
$(".navbar-collapse").collapse('hide');
2022
});
2123
});
24+
$(".top").click(function () {
25+
$("html, body").animate({
26+
scrollTop: 0
27+
}, "slow");
28+
return false;
29+
});
2230

2331
var typed = new Typed("#typed", {
2432
stringsElement: '#typed-strings',

0 commit comments

Comments
 (0)