Skip to content

Commit 8379a20

Browse files
committed
front repair
1 parent 6c9fed2 commit 8379a20

File tree

3 files changed

+66
-13
lines changed

3 files changed

+66
-13
lines changed

img/home.jpg.opdownload

4.34 MB
Binary file not shown.

index.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6+
<meta name="HandheldFriendly" content="true">
67
<meta name="viewport" content="width=device-width, initial-scale=1.0">
78
<title>mohite-pi</title>
89
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
@@ -14,13 +15,12 @@
1415
<body>
1516

1617
<!-- <header> -->
17-
<script src="./navbar.js"></script>
1818
<!-- <button class="nav-toggle"></button>
1919
2020
<button class="nav-toggle">
2121
<span class="nav-button"></span>
2222
</button> -->
23-
<div class="navbar" >
23+
<div id="navbar" >
2424
<!-- <span class="logo flex">
2525
<img src="./img/pi-logo.png" alt="mohite-pi">
2626
</span> -->
@@ -35,10 +35,10 @@
3535
<!-- </nav> -->
3636
</div>
3737
<!-- </header> -->
38-
38+
<section class="content">
3939
<!-- Introduction -->
4040
<section class="intro" id="home">
41-
<div class="w3-display-container w3-animate-opacity w3-margin-top">
41+
<div class="w3-display-container w3-animate-opacity w3-margin-top" id="intro-div">
4242
<div class="w3-display-middle" id="intro_container">
4343
<h1 class="w3-panel w3-border w3-jumbo w3-animate-top w3-center" >Hello, I am <strong id="myname">Piyush Mohite</strong></h1>
4444
<!-- class="section__title section__title--intro" -->
@@ -94,9 +94,28 @@ <h2 class="section__title section__title--connect">Connect With Me</h2>
9494
</div>
9595
</section>
9696

97+
</section>
9798

9899

99-
100+
<script>
101+
// When the user scrolls the page, execute myFunction
102+
window.onscroll = function() {myFunction()};
103+
104+
// Get the navbar
105+
var navbar = document.getElementById("navbar");
106+
107+
// Get the offset position of the navbar
108+
var sticky = navbar.offsetTop;
109+
110+
// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
111+
function myFunction() {
112+
if (window.pageYOffset >= sticky) {
113+
navbar.classList.add("sticky")
114+
} else {
115+
navbar.classList.remove("sticky");
116+
}
117+
}
118+
</script>
100119

101120

102121

style.css

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
-webkit-font-smotthing: antialiased;
66
}
77

8+
/* Media Queries: Tablet Landscape */
9+
@media screen and (max-width: 1060px) {
10+
#primary { width:67%; }
11+
#secondary { width:30%; margin-left:3%;}
12+
}
13+
14+
/* Media Queries: Tabled Portrait */
15+
@media screen and (max-width: 768px) {
16+
#primary { width:100%; }
17+
#secondary { width:100%; margin:0; border:none; }
18+
}
19+
20+
21+
/* General Styling */
822
html{
923

1024
font-family: 'Quicksand', sans-serif;
@@ -21,8 +35,8 @@ body{
2135
}
2236

2337
section{
24-
margin: auto;
25-
padding: 12%;
38+
margin: 0;
39+
padding: 15%;
2640
justify-content: center;
2741
height: 100vh;
2842
}
@@ -59,23 +73,34 @@ header .nav-div nav a{
5973

6074

6175

76+
6277
/* navbar */
63-
.navbar{
78+
#navbar{
6479
overflow:hidden;
6580
background-color: #42f08d;
6681
}
6782

68-
.navbar a{
83+
#navbar a{
6984
float: left;
7085
display: block;
7186
color: #272525;
7287
text-align: center;
7388
padding: 14px;
7489
text-decoration: none;
7590
}
91+
92+
#navbar a:hover {
93+
background-color: #ddd;
94+
color: black;
95+
}
96+
97+
#navbar a.active {
98+
background-color: #272525;
99+
color: #42f08d;
100+
}
76101
/* Page content */
77102
.content {
78-
padding: 16px;
103+
padding: 0;
79104
}
80105

81106
/* The sticky class is added to the navbar with JS when it reaches its scroll position */
@@ -94,7 +119,13 @@ header .nav-div nav a{
94119

95120

96121

122+
123+
97124
/* Intro page */
125+
#intro-div{
126+
margin-top: 4em;
127+
}
128+
98129

99130

100131
/* strong{
@@ -106,10 +137,12 @@ header .nav-div nav a{
106137
}
107138

108139
#myname{
109-
display:inline-block
140+
display:inline-block;
110141
}
111142

112-
143+
#my_work_title{
144+
padding: 100px;
145+
}
113146

114147

115148

@@ -127,6 +160,7 @@ header .nav-div nav a{
127160

128161

129162

163+
130164
/* About Me */
131165
.aboutme{
132166
background-image: url(./img/abtme-img.jpg);

0 commit comments

Comments
 (0)