forked from SidebarJS/angular-sidebarjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
518 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,130 @@ | ||
[sidebarjs-backdrop], [sidebarjs] { | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; } | ||
[sidebarjs-backdrop], | ||
[sidebarjs] { | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
[sidebarjs].sidebarjs--left, [sidebarjs].sidebarjs--left [sidebarjs-container] { | ||
-webkit-transform: translate(-100%, 0); | ||
transform: translate(-100%, 0); } | ||
.sidebarjs--left[sidebarjs], | ||
[sidebarjs].sidebarjs--left [sidebarjs-container] { | ||
transform: translate(-100%, 0); | ||
} | ||
|
||
[sidebarjs].sidebarjs--right, [sidebarjs].sidebarjs--right [sidebarjs-container] { | ||
-webkit-transform: translate(100%, 0); | ||
transform: translate(100%, 0); } | ||
.sidebarjs--right[sidebarjs], | ||
[sidebarjs].sidebarjs--right [sidebarjs-container] { | ||
transform: translate(100%, 0); | ||
} | ||
|
||
[sidebarjs].sidebarjs--left [sidebarjs-container] { | ||
-webkit-box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2); | ||
box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2); } | ||
box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
[sidebarjs].sidebarjs--right [sidebarjs-container] { | ||
-webkit-box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2); | ||
box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2); | ||
margin-left: auto; } | ||
box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2); | ||
margin-left: auto; | ||
} | ||
|
||
[sidebarjs-backdrop] { | ||
position: absolute; | ||
background: #000; | ||
opacity: 0; | ||
-webkit-transition: opacity 0.3s ease; | ||
transition: opacity 0.3s ease; | ||
will-change: opacity; } | ||
position: absolute; | ||
background: #000; | ||
opacity: 0; | ||
transition: opacity 0.3s ease; | ||
will-change: opacity; | ||
} | ||
|
||
[sidebarjs-container] { | ||
position: relative; | ||
z-index: 1; | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-orient: vertical; | ||
-webkit-box-direction: normal; | ||
-ms-flex-direction: column; | ||
flex-direction: column; | ||
width: 90%; | ||
max-width: 300px; | ||
height: 100%; | ||
background: #fff; | ||
-webkit-transition: -webkit-transform ease 0.3s; | ||
transition: -webkit-transform ease 0.3s; | ||
transition: transform ease 0.3s; | ||
transition: transform ease 0.3s, -webkit-transform ease 0.3s; | ||
will-change: transform; } | ||
position: relative; | ||
z-index: 1; | ||
display: flex; | ||
flex-direction: column; | ||
width: 90%; | ||
max-width: 300px; | ||
height: 100%; | ||
background: #fff; | ||
transition: transform ease 0.3s; | ||
will-change: transform; | ||
} | ||
|
||
[sidebarjs] { | ||
position: fixed; | ||
z-index: 9999; | ||
-webkit-transition: -webkit-transform 0s ease 0.3s; | ||
transition: -webkit-transform 0s ease 0.3s; | ||
transition: transform 0s ease 0.3s; | ||
transition: transform 0s ease 0.3s, -webkit-transform 0s ease 0.3s; } | ||
[sidebarjs].sidebarjs--is-visible { | ||
-webkit-transform: translate(0, 0); | ||
transform: translate(0, 0); | ||
-webkit-transition: -webkit-transform 0s ease 0s; | ||
transition: -webkit-transform 0s ease 0s; | ||
position: fixed; | ||
z-index: 9999; | ||
transition: transform 0s ease 0.3s; | ||
} | ||
|
||
[sidebarjs].sidebarjs--is-visible { | ||
transform: translate(0, 0); | ||
transition: transform 0s ease 0s; | ||
transition: transform 0s ease 0s, -webkit-transform 0s ease 0s; } | ||
[sidebarjs].sidebarjs--is-visible [sidebarjs-container] { | ||
-webkit-transform: translate(0, 0); | ||
transform: translate(0, 0); } | ||
[sidebarjs].sidebarjs--is-moving { | ||
-webkit-transition: none; | ||
} | ||
|
||
[sidebarjs].sidebarjs--is-visible [sidebarjs-container] { | ||
transform: translate(0, 0); | ||
} | ||
|
||
[sidebarjs].sidebarjs--is-moving { | ||
transition: none; | ||
-webkit-transform: translate(0, 0); | ||
transform: translate(0, 0); } | ||
[sidebarjs].sidebarjs--is-moving [sidebarjs-container], [sidebarjs].sidebarjs--is-moving [sidebarjs-backdrop] { | ||
-webkit-transition: none; | ||
transition: none; } | ||
transform: translate(0, 0); | ||
} | ||
|
||
[sidebarjs].sidebarjs--is-moving [sidebarjs-container] { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
transform: none !important; | ||
} | ||
|
||
[sidebarjs].sidebarjs--is-moving [sidebarjs-container], | ||
[sidebarjs].sidebarjs--is-moving [sidebarjs-backdrop] { | ||
transition: none; | ||
} | ||
|
||
[sidebarjs-content] { | ||
position: relative; | ||
width: 100%; | ||
min-height: 100%; | ||
transition: width 0.3s ease; | ||
} | ||
|
||
[sidebarjs-content].sidebarjs-content--left { | ||
margin-left: auto; | ||
margin-right: 0; | ||
} | ||
|
||
[sidebarjs-content].sidebarjs-content--right { | ||
margin-left: 0; | ||
margin-right: auto; | ||
} | ||
|
||
@media (min-width: 1025px) { | ||
[sidebarjs].sidebarjs--responsive { | ||
transform: translate(0, 0) !important; | ||
transition: transform 0s ease 0s; | ||
width: 300px; | ||
} | ||
[sidebarjs].sidebarjs--responsive [sidebarjs-container] { | ||
transform: translate(0, 0) !important; | ||
} | ||
[sidebarjs].sidebarjs--responsive.sidebarjs--left { | ||
left: 0; | ||
right: auto; | ||
} | ||
[sidebarjs].sidebarjs--responsive.sidebarjs--left [sidebarjs-container] { | ||
box-shadow: 1px 0 0 rgba(0, 0, 0, 0.1); | ||
} | ||
[sidebarjs].sidebarjs--responsive.sidebarjs--right { | ||
right: 0; | ||
left: auto; | ||
} | ||
[sidebarjs].sidebarjs--responsive.sidebarjs--right [sidebarjs-container] { | ||
box-shadow: -1px 0 0 rgba(0, 0, 0, 0.1); | ||
} | ||
[sidebarjs].sidebarjs--responsive [sidebarjs-container] { | ||
max-width: none; | ||
width: 100%; | ||
box-shadow: none; | ||
} | ||
[sidebarjs-content] { | ||
width: calc(100% - 300px); | ||
} | ||
[sidebarjs-content].sidebarjs-content--left.sidebarjs-content--right { | ||
width: calc(100% - 600px); | ||
margin: 0 auto; | ||
} | ||
} |
Oops, something went wrong.
This is generated when updating the sidebarjs.scss file and compiled the css.
Added the following in the --is-moving class:
in the following.
The issue is that everytime the user moves up and down the transform property always gets updated. That's the reason of the flickering issue. To fix that, I added an override to force the transform to none.