Browse Source

navbar: ajout de styles

Lou 3 years ago
parent
commit
7324579acd
2 changed files with 58 additions and 32 deletions
  1. 2
    2
      src/components/navbar/index.jsx
  2. 56
    30
      src/components/navbar/index.scss

+ 2
- 2
src/components/navbar/index.jsx View File

@@ -23,8 +23,8 @@ const Navbar = () => {
23 23
 
24 24
 	return (
25 25
 		<div id="navbar-container">
26
-			<nav style={handleShowNavbar(headerContext)} className={toggleMenu ? "nav-o" : "nav-c"}>
27
-				<div className="details">
26
+			<nav style={handleShowNavbar(headerContext)} className={toggleMenu ? "nav-open" : ""}>
27
+				<div className={toggleMenu ? "details-open" : "details"}>
28 28
 					<Link
29 29
 						to="/services"
30 30
 						className={toggleMenu ? "menu-item" : "menu-item-hidden"}>

+ 56
- 30
src/components/navbar/index.scss View File

@@ -93,45 +93,71 @@ nav {
93 93
 		padding-right: var(--bs-gutter-x, 0.75rem);
94 94
 		padding-left: var(--bs-gutter-x, 0.75rem);
95 95
 		margin: 4rem auto 0 auto;
96
+		display: flex;
97
+		flex-direction: column-reverse;
98
+		align-items: center;
99
+	}
100
+	
101
+	
102
+	.details {
103
+		position: absolute;
104
+		display: flex;
105
+		flex-direction: column;
106
+		align-items:center;
107
+		justify-content: flex-end;
108
+		top: 5rem;
109
+
110
+		.menu-item-hidden {
111
+			display: none;
112
+		}
113
+	}
96 114
 
97
-		.details {
98
-			position: absolute;
115
+	.details-open {
116
+		position: absolute;
117
+		display: flex;
118
+		flex-direction: column;
119
+		align-items:center;
120
+		top: 5rem;
121
+		background-color: white;
122
+		width: 100%;
123
+		
124
+		.menu-item {
125
+			width: 100%;
126
+			line-height: 2rem;
99 127
 			display: flex;
100
-			flex-direction: column;
101
-			align-items: center;
102
-						
128
+			justify-content: center;
103 129
 
104
-			.menu-item-hidden {
105
-				display: none;
130
+			&:hover, &:focus{
131
+				background-color: $light;
106 132
 			}
107 133
 		}
134
+	}
108 135
 
109
-		.title-and-menu {
110
-			margin-left: .5rem;
111
-			display: flex;
112
-			width: 100%;
136
+	.title-and-menu {
137
+		margin-left: .5rem;
138
+		display: flex;
139
+		width: 100%;
113 140
 
114
-			button.menu-toggle-container {
115
-				display: inline-block;
116
-				margin-left: auto;
117
-				margin-right: 1.5rem;
118
-				padding: 0.25rem 0.75rem;
119
-				font-size: 1.25rem;
120
-				line-height: 1;
121
-				background-color: transparent;
122
-				border: 1px solid transparent;
123
-				border-radius: 0.25rem;
124
-				transition: box-shadow 0.15s ease-in-out;
125
-
126
-				&:hover, &:focus {
127
-					cursor: pointer;
128
-					box-shadow: 0 0 1px 1px $dark;
129
-				}
141
+		button.menu-toggle-container {
142
+			display: inline-block;
143
+			margin-left: auto;
144
+			margin-right: 1.5rem;
145
+			padding: 0.25rem 0.75rem;
146
+			font-size: 1.25rem;
147
+			line-height: 1;
148
+			background-color: transparent;
149
+			border: 1px solid transparent;
150
+			border-radius: 0.25rem;
151
+			transition: box-shadow 0.15s ease-in-out;
152
+
153
+			&:hover, &:focus {
154
+				cursor: pointer;
155
+				box-shadow: 0 0 1px 1px $dark;
130 156
 			}
131 157
 		}
158
+	}
132 159
 
133
-		#contact-btn {
134
-			display: none;
135
-		}
160
+	#contact-btn {
161
+		display: none;
136 162
 	}
137 163
 }

Loading…
Cancel
Save