Skip to content

Commit ec197d5

Browse files
Merge pull request #28 from raphaelfabeni/hotfix/#27
Change the default animation of loader bar - fix #27
2 parents adeba9a + f0827e4 commit ec197d5

File tree

8 files changed

+31
-7
lines changed

8 files changed

+31
-7
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The variations _data-half_, _data-text_ and _data-blink_ work together. 😄
120120
<div class="loader loader-bar is-active"></div>
121121
```
122122

123-
![loader-bar](https://cloud.githubusercontent.com/assets/1345662/19314685/6d719056-9071-11e6-88c8-2c3750ca0198.gif)
123+
![loader-bar-updated](https://cloud.githubusercontent.com/assets/1345662/23286931/5eae58a8-fa19-11e6-8718-ae28d633ed1e.gif)
124124

125125
[See it](http://raphaelfabeni.com.br/css-loader/#/loader-bar) :metal:
126126

@@ -131,6 +131,8 @@ Like the `loader` example, it's also possible to pass the `data-text` and `blink
131131
```html
132132
<div class="loader loader-bar is-active" data-text></div>
133133
<!-- -->
134+
<div class="loader loader-bar is-active" data-inverse></div>
135+
<!-- -->
134136
<div class="loader loader-bar is-active" data-text="Custom text"></div>
135137
<!-- -->
136138
<div class="loader loader-bar is-active" data-text data-blink></div>
@@ -140,14 +142,26 @@ Like the `loader` example, it's also possible to pass the `data-text` and `blink
140142

141143
**rounded**: passing the `data-rounded` attribute, it's possible to add a simple `border-radius` to the loader.
142144

143-
![loader-bar-rounded](https://cloud.githubusercontent.com/assets/1345662/19315031/ab850700-9072-11e6-9cd4-9fe899f05a10.gif)
145+
![loader-bar-rounded-updated](https://cloud.githubusercontent.com/assets/1345662/23287022/abe16980-fa19-11e6-87c3-c7a4c28e7bb5.gif)
144146

145147
```html
146148
<div class="loader loader-bar is-active" data-text data-rounded></div>
147149
```
148150

149151
[See it](http://raphaelfabeni.com.br/css-loader/#/loader-bar-rounded) :metal:
150152

153+
**inverse**: passing the `data-inverse` attribute, it's possible change the direction of the animation (from left to right).
154+
155+
![loader-bar](https://cloud.githubusercontent.com/assets/1345662/19314685/6d719056-9071-11e6-88c8-2c3750ca0198.gif)
156+
157+
```html
158+
<div class="loader loader-bar is-active" data-inverse></div>
159+
```
160+
161+
[See it](http://raphaelfabeni.com.br/css-loader/#/loader-bar-inverse) :metal:
162+
163+
*Obs*. It's also possible pass a parameter `data-text` with a content value that will show as a text loader, or with no value, and the default *loading* text it's going to show instead.
164+
151165
### Border
152166

153167
![loader-border](https://cloud.githubusercontent.com/assets/1345662/19314686/6d733622-9071-11e6-8167-a55e6c16a02f.gif)

dist/css-loader.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/loader-bar.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/loader-bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<body>
1919

2020
<!-- Loader -->
21-
<div class="loader loader-bar is-active" data-text data-rounded></div>
21+
<div class="loader loader-bar is-active"></div>
2222

2323
<!-- Fake content -->
2424
<div class="container">

examples/loader-curtain.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
</style>
1515

16-
<link rel="stylesheet" href="../dist/css-loader.css">
16+
<link rel="stylesheet" href="../dist/loader-bar.css">
1717
</head>
1818
<body>
1919

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var cssFiles = [
99
'src/css-loader.sass',
1010
'src/loader-default.sass',
1111
'src/loader-double.sass',
12+
'src/loader-bar.sass',
1213
'src/loader-border.sass',
1314
'src/loader-ball.sass',
1415
'src/loader-clock.sass',

src/loader-bar.sass

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import './config'
2+
3+
@import './general/base'
4+
5+
@import './loaders/loader-bar'

src/loaders/_loader-bar.sass

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
background: linear-gradient( -45deg, $loader-bar--color-secondary 25%, $loader-bar--color 25%, $loader-bar--color 50%, $loader-bar--color-secondary 50%, $loader-bar--color-secondary 75%, $loader-bar--color 75%, $loader-bar--color)
2020
background-size: 20px 20px
2121
box-shadow: inset 0 10px 0 rgba(255, 255, 255, .2), 0 0 0 5px rgba(0, 0, 0, .2)
22-
animation: moveBar 1.5s linear infinite
22+
animation: moveBar 1.5s linear infinite reverse
2323

24-
// Rounded version
2524
&[data-rounded]
2625
&:after
2726
border-radius: 15px
2827

28+
&[data-inverse]
29+
&:after
30+
animation-direction: normal
31+
2932
// Animation for bars
3033
@keyframes moveBar
3134
from

0 commit comments

Comments
 (0)