Skip to content

Commit

Permalink
edit header in accordance with the main site (#235)
Browse files Browse the repository at this point in the history
* edit header in accordance with the main site

* replace fa icons with svg

* remove logos from mobile menu
  • Loading branch information
VladyslavBondarenko authored Dec 23, 2020
1 parent a2e8a2a commit 75d1393
Show file tree
Hide file tree
Showing 13 changed files with 392 additions and 32 deletions.
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 120,
"bracketSpacing": true,
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"overrides": [
{
"files": ["*.md", "*.markdown"],
"options": { "tabWidth": 2 }
}
]
}
15 changes: 15 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ $('h1, h2, h3, h4, h5, h6').on('click', 'i.ctc', function() {
})

$(document).ready(function() {
addMenuListeners()
createTableOfContents()
// Wrap tables for responsiveness
var contentTable = $('#main-content main table')
Expand Down Expand Up @@ -320,3 +321,17 @@ $(window).ready(function () {
observer.observe(header);
});
});

const addMenuListeners = () => {
$('[data-js-toggle-menu-product-dropdown]').on('click', function () {
$(this).toggleClass('open')
$('[data-js-menu-product-dropdown]').toggleClass('open')
})
window.addEventListener('click', function (e) {
const select = document.querySelector('[data-js-menu-product-dropdown], [data-js-toggle-menu-product-dropdown]')
if (!select.contains(e.target)) {
select.classList.remove('open')
$('[data-js-menu-product-dropdown]').removeClass('open')
}
})
}
146 changes: 132 additions & 14 deletions assets/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,84 @@
display: block;
}
}
.menu-dropdown {
display: none;
position: absolute;
box-shadow: 0px 3px 60px #06225d29;
background: white;
top: 100%;
border-radius: 20px;
padding: 30px;
&.open {
display: block;
}
}
.menu-link.toggle-dropdown-button {
position: relative;
&::after {
content: '\f078';
font-family: 'Font Awesome 5 Free';
transition: all 160ms linear;
display: inline-block;
font-weight: 600;
font-size: 9px;
margin-left: 10px;
vertical-align: middle;
}
&.open {
&::after {
transform: rotate(180deg);
}
}
}
.menu-block {
&__header {
color: $black-l;
font-size: 12px;
margin-bottom: 10px;
text-transform: uppercase;
}
&__links {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px 20px;
}
&__link {
font-size: 13px;
display: flex;
height: 56px;
align-items: center;
padding: 0 20px;
border-radius: 10px;
color: $black-l;
box-shadow: 0px 3px 46px $shadow-blue;
svg {
width: 20px;
height: 20px;
margin-right: 10px;
vertical-align: middle;
* {
transition: fill 200ms linear;
stroke: none;
fill: $black-l;
opacity: 1;
}
&.ios {
position: relative;
bottom: 3px;
}
}
&:hover {
color: $blue;
svg * {
fill: $blue;
}
}
}
&:not(:last-child) {
margin-bottom: 30px;
}
}
#header-menu-wrap {
flex: 1;
display: flex;
Expand Down Expand Up @@ -230,7 +308,7 @@
transition: color 300ms linear;

&:hover {
color: $red;
color: $blue;
}
@at-root #header-authentication.loading & {
display: none;
Expand Down Expand Up @@ -264,7 +342,8 @@
height: 100vh;
overflow: auto;

.menu-link {
.menu-link,
.menu-block__link {
position: relative;
display: block;
color: $black;
Expand All @@ -273,9 +352,11 @@
padding: 0 50px;
border-bottom: 1px solid $grey-l;

&::after {
&:not(.toggle-dropdown-button)::after {
content: '\f061';
font-family: 'Font Awesome 5 Free';
}
&::after {
position: absolute;
right: 50px;
transition: right 300ms ease-in-out;
Expand All @@ -284,10 +365,40 @@
&:focus {
background-color: $grey-xl;
color: $blue;
&::after {
right: 46px;
}
&:not(.toggle-dropdown-button) {
&:hover,
&:focus {
&::after {
right: 46px;
}
}
}
}
.menu-dropdown {
position: static;
box-shadow: none;
border-radius: 0;
padding: 0;
}
.menu-block {
&__links {
display: block;
}
&__link {
box-shadow: none;
border-radius: 0;
padding: 0 80px;
svg {
display: none;
}
}
&__header {
display: none;
}
&:not(:last-child) {
margin: 0;
}
}
}
#header-main-menu {
Expand Down Expand Up @@ -408,14 +519,21 @@
}
}
@media (max-width: 420px) {
#header-menu-wrap .menu-link {
padding: 0 20px;

&::after {
right: 20px;
#header-menu-wrap {
.menu-link {
padding: 0 20px;
}
&:hover::after {
right: 16px;
.menu-block__link {
padding: 0 50px;
}
.menu-link,
.menu-block__link {
&::after {
right: 20px;
}
&:not(.toggle-dropdown-button):hover::after {
right: 16px;
}
}
}
}
Expand Down Expand Up @@ -456,7 +574,7 @@
height: 48px;
line-height: 48px;
padding: 0 40px;
border-radius: 50px;
border-radius: 10px;
text-align: center;
cursor: pointer;
transition: all 160ms linear;
Expand All @@ -468,4 +586,4 @@
button:not(:disabled),
button:not(:disabled) * {
cursor: pointer;
}
}
2 changes: 2 additions & 0 deletions assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $yellow: #FBB03B;
$magenta: #E944FF;
$cyan: #33CCFF;
$black: #151515;
$black-l: #06225d;
$blue-gradient: linear-gradient(20deg, $blue-hover 0%, $blue 100%);
$magenta-gradient: linear-gradient(20deg, $magenta 0%, $yellow 100%);
$cyan-gradient: linear-gradient(20deg, $magenta 0%, $cyan 100%);
Expand All @@ -21,6 +22,7 @@ $grey-bg: #eaeaea;
$grey-l: #eeeeee;
$grey-xl: #f8f8f8;
$grey-m: #cccccc;
$shadow-blue: #e4e8f7;

// Fonts
$font-family-default: 'ProximaNova-Regular';
Expand Down
3 changes: 3 additions & 0 deletions assets/svg/book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/svg/platforms/android.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/svg/platforms/cordova.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/svg/platforms/flutter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/svg/platforms/ionic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/svg/platforms/ios.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions assets/svg/platforms/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/svg/plug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 75d1393

Please sign in to comment.