-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from namecheap/spinnerDoc
chore: doc to include spinner
- Loading branch information
Showing
5 changed files
with
97 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Animation during reroute | ||
|
||
## Demo | ||
![Animation during reroute](./assets/demoSpinner.gif) | ||
|
||
|
||
## Implementation details | ||
- Spinner appears only if transition from one route to another took more then 200ms. | ||
- During transition ILC remove original MSs immediately and place fake cloned nodes to DOM, which in relust don't have | ||
any JS mouse listeners. so we strongly recommend to use backdrop for spinner. | ||
In any case, additionally it will cover any your bugs regarding interaction users with site during rerouting. | ||
|
||
## How to | ||
You can use your own spinner by setting `tmplSpinner` property of `ilcConfig` in your main html template. | ||
Example: | ||
```html | ||
<!-- ILC spinner stylesheets --> | ||
<style type="text/css"> | ||
.ilc-spinner { | ||
position: fixed; | ||
right: 0; | ||
left: 0; | ||
top: 0; | ||
bottom: 0; | ||
z-index: 9999; | ||
background: rgba(255,255,255,0.4); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.ilc-spinner .ilc-spinner__loader { | ||
display: block; | ||
width: 30px; | ||
height: 30px; | ||
} | ||
@keyframes gb-spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
.ilc-spinner .ilc-spinner__loader::after { | ||
display: block; | ||
width: 30px; | ||
height: 30px; | ||
border: 3px solid; | ||
border-radius: 50%; | ||
animation: gb-spin 1s linear infinite; | ||
content: ""; | ||
border-color: #8cc1c1 #6d6e70 #6d6e70 #6d6e70; | ||
} | ||
</style> | ||
|
||
<script> | ||
window.ilcConfig = { | ||
tmplSpinner: | ||
'<div class="ilc-spinner">' + | ||
'<div class="ilc-spinner__loader"></div>' + | ||
'</div>' | ||
, | ||
} | ||
</script> | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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