Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Create Against Hate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin King
Create Against Hate
Commits
4436b041
Commit
4436b041
authored
2 years ago
by
Robin King
Browse files
Options
Downloads
Patches
Plain Diff
feat(styles.css-&&-scripts.js): animate hamburger on click
parent
f8fae320
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts.js
+2
-0
2 additions, 0 deletions
scripts.js
styles.css
+20
-3
20 additions, 3 deletions
styles.css
with
22 additions
and
3 deletions
scripts.js
+
2
−
0
View file @
4436b041
...
...
@@ -19,6 +19,7 @@ window.addEventListener('resize', () => {
navigation
.
removeAttribute
(
'
style
'
);
navigation
.
classList
.
remove
(
'
show
'
);
burger
.
setAttribute
(
'
aria-expanded
'
,
'
false
'
);
burger
.
classList
.
remove
(
'
open
'
);
document
.
body
.
removeAttribute
(
'
style
'
);
});
...
...
@@ -54,6 +55,7 @@ function desktopNavControls() {
**/
burger
.
addEventListener
(
'
click
'
,
()
=>
{
navigation
.
classList
.
toggle
(
'
show
'
);
burger
.
classList
.
toggle
(
'
open
'
);
if
(
navigation
.
classList
.
contains
(
'
show
'
))
{
// Stops user from scrolling while nav is open
document
.
body
.
style
.
overflow
=
'
hidden
'
;
...
...
This diff is collapsed.
Click to expand it.
styles.css
+
20
−
3
View file @
4436b041
...
...
@@ -459,6 +459,23 @@
background-color
:
white
;
box-shadow
:
3px
5px
19px
0px
rgba
(
0
,
0
,
0
,
.41
);
transition
:
all
.3s
;
}
/** Animate hamburger **/
.hamburger.open
div
[
class
|=
"hamburger"
]
:nth-of-type
(
1
)
{
transform
:
rotate
(
-35deg
)
scaleX
(
.5
)
translate
(
-55%
,
0
);
}
.hamburger.open
div
[
class
|=
"hamburger"
]
:nth-of-type
(
2
)
{
transform-origin
:
left
;
transform
:
scaleX
(
.85
);
}
.hamburger.open
div
[
class
|=
"hamburger"
]
:nth-of-type
(
3
)
{
transform
:
rotate
(
35deg
)
scaleX
(
.5
)
translate
(
-55%
,
0
);
}
/*** Footer Styles ***/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment