Introduce BEM naming
This commit is contained in:
|
Before Width: | Height: | Size: 464 KiB After Width: | Height: | Size: 464 KiB |
@@ -23,44 +23,47 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper" id="wrapper">
|
||||
<nav class="navbar navbar-expand-lg sticky-top" id="nav">
|
||||
<nav class="navbar navbar-expand-lg sticky-top">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header" id="navbar-header">
|
||||
<img src="img/logo.svg" alt="Forkio logo">
|
||||
<span class="navbar-brand">Fork<em>IO</em></span>
|
||||
<div class="navbar__header navbar-header">
|
||||
<img class="navbar__logo" src="img/logo.svg" alt="Forkio logo">
|
||||
<span class="navbar__brand">Fork</span>
|
||||
<span class="navbar__brand navbar__brand--emph">IO</span>
|
||||
</div>
|
||||
<ul class="navbar-nav" id="navbar-body">
|
||||
<ul class="navbar__body navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="default-link nav-link" href="#">Overview</a>
|
||||
<a class="navbar__link nav-link" href="#">Overview</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="default-link nav-link" href="#">About fork</a>
|
||||
<a class="navbar__link nav-link" href="#">About fork</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="default-link nav-link" href="#">Buying options</a>
|
||||
<a class="navbar__link nav-link" href="#">Buying options</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="default-link nav-link" href="#">Support</a>
|
||||
<a class="navbar__link nav-link" href="#">Support</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="raised-button nav-link" href="#">Buy now</a>
|
||||
<a href="#">
|
||||
<button class="rounded-button rounded-button--strong">Buy now</button>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<header id="hero">
|
||||
<!--<img src="img/hero/img.png">-->
|
||||
<header class="header">
|
||||
<div>
|
||||
<h1>Fork app</h1>
|
||||
<h2>A real gamechanger in the world of web development</h2>
|
||||
<h3>V. 2.8 for Mac and Windows</h3>
|
||||
<p class="header__h1">Fork app</p>
|
||||
<p class="header__h2">A real gamechanger in the world of web development</p>
|
||||
<p class="header__h3">V. 2.8 for Mac and Windows</p>
|
||||
</div>
|
||||
</header>
|
||||
<section id="download">
|
||||
<a href="#" class="raised-button">Download for free now</a>
|
||||
<p>Unlimited 30-Days trial period</p>
|
||||
<section class="download">
|
||||
<a href="#" class="rounded-button rounded-button--very-strong download__rounded-button--translated">
|
||||
Download for free now
|
||||
</a>
|
||||
<p class="download__description">Unlimited 30-Days trial period</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ $(document).ready(function () {
|
||||
scrollTop = $(window).scrollTop();
|
||||
|
||||
if (scrollTop >= 100) {
|
||||
$('#nav').addClass('shrink');
|
||||
$('.navbar').addClass('navbar--shrink');
|
||||
} else if (scrollTop < 100) {
|
||||
$('#nav').removeClass('shrink');
|
||||
$('.navbar').removeClass('navbar--shrink');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
a.raised-button {
|
||||
$hover-transition-duration: 0.4s;
|
||||
|
||||
.rounded-button {
|
||||
padding: 7px 35px;
|
||||
background-color: $primary;
|
||||
font-family: Montserrat, sans-serif;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 30px;
|
||||
transition: $hover-transition-duration;
|
||||
transition: $hover-duration;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $primary-dark;
|
||||
transition: $hover-transition-duration;
|
||||
text-decoration: none;
|
||||
}
|
||||
.rounded-button:hover {
|
||||
background-color: $primary-light;
|
||||
transition: $hover-duration;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.rounded-button--strong {
|
||||
font-weight: bold;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.rounded-button--very-strong {
|
||||
@extend .rounded-button--strong;
|
||||
font-size: 21px;
|
||||
padding: 15px 60px;
|
||||
}
|
||||
@@ -1,20 +1,17 @@
|
||||
#download {
|
||||
.download {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
a.raised-button {
|
||||
position: absolute;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 21px;
|
||||
font-weight: bold;
|
||||
text-transform: capitalize;
|
||||
padding: 15px 60px;
|
||||
}
|
||||
.download__rounded-button--translated {
|
||||
position: absolute;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
p {
|
||||
padding-top: 45px;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 14px;
|
||||
color: $regular-text;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.download__description {
|
||||
padding-top: 45px;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: $regular-text;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
32
src/scss/_header.scss
Normal file
32
src/scss/_header.scss
Normal file
@@ -0,0 +1,32 @@
|
||||
.header {
|
||||
background: url(../img/header/img.png) no-repeat 50% 30% / cover;
|
||||
height: 900px;
|
||||
padding-top: 110px;
|
||||
}
|
||||
|
||||
.header__h1 {
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 82px;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
text-transform: capitalize;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.header__h2 {
|
||||
font-family: Lato, sans-serif;
|
||||
font-size: 30px;
|
||||
color: $primary;
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.header__h3 {
|
||||
margin-top: 20px;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: $regular-text;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#hero {
|
||||
background: url(../img/hero/img.png) no-repeat 50% 40% / contain;
|
||||
height: 900px;
|
||||
padding-top: 110px;
|
||||
|
||||
h1 {
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 82px;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
text-transform: capitalize;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: Lato, sans-serif;
|
||||
font-size: 30px;
|
||||
color: $primary;
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 20px;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: $regular-text;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,53 @@
|
||||
#nav {
|
||||
$shrinking-duration: 0.4s;
|
||||
$shrinking-duration: 0.4s;
|
||||
|
||||
.navbar {
|
||||
margin: 0 0;
|
||||
padding: 0 90px;
|
||||
height: 100px;
|
||||
background-color: white;
|
||||
transition: height $shrinking-duration;
|
||||
}
|
||||
|
||||
&.shrink {
|
||||
height: 50px;
|
||||
transition: height $shrinking-duration;
|
||||
}
|
||||
.navbar--shrink {
|
||||
height: 50px;
|
||||
transition: height $shrinking-duration;
|
||||
}
|
||||
|
||||
#navbar-header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.navbar__header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 45px;
|
||||
}
|
||||
.navbar__logo {
|
||||
height: 45px;
|
||||
margin-right: 17px;
|
||||
}
|
||||
|
||||
span {
|
||||
margin-left: 17px;
|
||||
font-family: Lato, sans-serif;
|
||||
text-transform: uppercase;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
.navbar__brand {
|
||||
font-family: Lato, sans-serif;
|
||||
text-transform: uppercase;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
em {
|
||||
color: $primary;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
.navbar__brand--emph {
|
||||
color: $primary;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#navbar-body {
|
||||
a {
|
||||
text-transform: capitalize;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.navbar__link {
|
||||
text-transform: capitalize;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: bolder;
|
||||
margin: 0 20px;
|
||||
color: $primary-dark;
|
||||
transition: $hover-duration;
|
||||
}
|
||||
|
||||
a.default-link {
|
||||
margin: 0 20px;
|
||||
color: $primary-dark;
|
||||
}
|
||||
|
||||
a.raised-button {
|
||||
@extend .raised-button
|
||||
}
|
||||
}
|
||||
}
|
||||
.navbar__link:hover {
|
||||
color: $primary;
|
||||
transition: $hover-duration;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
$primary: #8d81ac;
|
||||
$primary-dark: #635c73;
|
||||
$regular-text: #848e97;
|
||||
$primary-light: #a599c8;
|
||||
$regular-text: #848e97;
|
||||
|
||||
$hover-duration: 0.3s;
|
||||
@@ -1,5 +1,5 @@
|
||||
@import "variables";
|
||||
@import "buttons";
|
||||
@import "navbar";
|
||||
@import "hero";
|
||||
@import "header";
|
||||
@import "download";
|
||||
Reference in New Issue
Block a user