Skip to content

Commit

Permalink
Added media queries
Browse files Browse the repository at this point in the history
  • Loading branch information
demilad committed Jan 20, 2019
1 parent 7a85c90 commit 8c531cd
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="logo">
<img src="images/NigeriaLogos_logo.svg" alt="NigeriaLogos logo">
</div>
<h1>An <a href="#!">open source</a> collection of high quality, pixel perfect Nigerian company logos for free use.</h1>
<h1>An <a href="#!">open source</a> collection of high quality, <br> pixel perfect Nigerian company logos <br> for free use.</h1>
</div>
<div class="searchbar">
<div class="select">
Expand Down
3 changes: 2 additions & 1 deletion scss/layout/_background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
grid-template-rows: 1fr;
}
&__stripe {
border-right: .25px $col-grey-3;
border-right: .035rem $col-grey-3;
opacity: .6;
width: 100%;
height: 100%;
border-right-style: dashed;

&:nth-child(even) {
border-right-style: solid;
opacity: .45;
}

}
Expand Down
3 changes: 2 additions & 1 deletion scss/layout/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ header {
margin-top: 0;

& img {
width: 100%;
width: 5vh;
transform: translateY(-15%);
}
}
Expand Down Expand Up @@ -60,6 +60,7 @@ header {
}
.select {
flex-basis: 30%;
min-width: 120px;
position: relative;
cursor: pointer;

Expand Down
14 changes: 10 additions & 4 deletions scss/layout/_section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ main {
margin-bottom: 10%;
}
.logo {
width: 17.6vw;
margin-top: 5%;
width: calc(25% - 20px); //20px accounts for the margin
margin-top: 8%;

&__holder {
border-radius: 4px;
width: 100%;
height: 17.6vw;
background-color: $col-grey-4;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
position: relative;

&:hover > .logo__download{
&::before {
content: "";
display: block;
padding-top: 100%;
}

&:hover > .logo__download {
opacity: 1;
}
}
Expand All @@ -33,6 +38,7 @@ main {
&__text {
width: 100%;
overflow-x: hidden;
white-space: nowrap;

&--primary {
font-weight: $fw-medium;
Expand Down
4 changes: 4 additions & 0 deletions scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
@import 'layout/background';
@import 'layout/footer';
@import 'layout/section';

@import 'responsive/background';
@import 'responsive/header';
@import 'responsive/section';
19 changes: 19 additions & 0 deletions scss/responsive/_background.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@media screen and (max-width: 1215px){
.background__stripe {
opacity: .4;

&:nth-child(even) {
opacity: .25;
}
}
}

@media screen and (max-width: 600px){
.background__stripe {
opacity: .2;

&:nth-child(even) {
opacity: .05;
}
}
}
71 changes: 71 additions & 0 deletions scss/responsive/_header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@media screen and (max-width: 750px){
.searchbar {
min-width: 50vw;

& .search {
margin-right: 6vw;
}
}
}

@media screen and (max-width: 450px){
header {
padding: 0;
overflow-x: hidden;

.heading {
width: 100vw;

& .logo {

& img {
width: 5vh;
transform: translateX(32vw) translateY(2vh);
}
}
}
h1{
margin-bottom: 20vh;
width: 100vw;
}
.searchbar {
flex-direction: column;
justify-content: center;
align-items: center;
margin: 0 auto;
margin-left: -2vw;
margin-top: 30vh;
margin-bottom: 50vh;
padding: 0;
width: 80vw;
height: 20vh;
position: absolute;

& .search {
width: 94%;
height: 8vh;

input{
opacity: .7;
}

&::after {
right: -3%;
top: .4rem;
width: 1.2rem;
height: 1.2rem;
transform: scale(.6);
}
}
& .select {
position: absolute;
top: 5vh;
min-width: 100%;
height: 20vh;
font-size: 170%;
}
}

}
}

21 changes: 21 additions & 0 deletions scss/responsive/_section.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@media screen and (max-width: 1215px){
.logo {
width: calc(33.333333% - 20px); //20px accounts for the margin
}
}

@media screen and (max-width: 650px){
body {
font-size: 85%;
}

.logo {
width: calc(50% - 20px); //20px accounts for the margin
}
}

@media screen and (max-width: 450px){
body {
font-size: 60%;
}
}

0 comments on commit 8c531cd

Please sign in to comment.