Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New "Shards" Spinner #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ Given that you have included `spinkit.min.css` in your project, these snippets w
</div>
```

### Shards

```html
<div class="sk-shards">
<div class="sk-shards-up sk-shards-top"></div>
<div class="sk-shards-up"></div>
<div class="sk-shards-down"></div>
<div class="sk-shards-up"></div>
</div>
```

## Web browser compatibility

SpinKit uses CSS animations and variables:
Expand Down
9 changes: 9 additions & 0 deletions examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,14 @@
</div>
</div>

<div class="example">
<div class="sk-shards">
<div class="sk-shards-up"></div>
<div class="sk-shards-up"></div>
<div class="sk-shards-down"></div>
<div class="sk-shards-up"></div>
</div>
</div>

</body>
</html>
48 changes: 47 additions & 1 deletion spinkit.css
Original file line number Diff line number Diff line change
Expand Up @@ -572,4 +572,50 @@
} 100% {
transform: rotate(-360deg);
}
}
}


/* Shards

<div class="sk-shards">
<div class="sk-shards-up sk-shards-top"></div>
<div class="sk-shards-up"></div>
<div class="sk-shards-down"></div>
<div class="sk-shards-up"></div>
</div>
*/
.sk-shards {
width: var(--sk-size);
height: var(--sk-size);
position: relative;
/* Shards positions
* 1
* 2 3 4
*/
}
.sk-shards-up {
border-left: calc(var(--sk-size)/2) solid transparent;
border-right: calc(var(--sk-size)/2) solid transparent;
border-bottom: calc(var(--sk-size)/2) solid var(--sk-color);
float: left;
animation: sk-shards 1.3s infinite ease-in-out;
}
.sk-shards-down {
border-left: calc(var(--sk-size)/2) solid transparent;
border-right: calc(var(--sk-size)/2) solid transparent;
border-top: calc(var(--sk-size)/2) solid var(--sk-color);
float: left;
animation: sk-shards 1.3s infinite ease-in-out;
}
.sk-shards-up:nth-child(1) { margin-bottom: calc(var(--sk-size)/10); animation-delay: 0.2s; }
.sk-shards-up:nth-child(2) { margin-left: calc(-1.2 * var(--sk-size)/2); animation-delay: 0.0s; }
.sk-shards-down:nth-child(3) { margin: calc(-1 * var(--sk-size)/2) 0; animation-delay: 0.1s; }
.sk-shards-up:nth-child(4) { margin-left: calc(1.2 * var(--sk-size)/2);margin-top: calc(-1 * var(--sk-size)/2); animation-delay: 0.3s; }

@keyframes sk-shards {
0%, 70%, 100% {
transform: scale3D(1, 1, 1);
} 35% {
transform: scale3D(0, 0, 1);
}
}
Loading