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

feat: add spin-reversed animation. Closes #147 #793

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The `<box-icon>` custom element supports the following attributes:
- `rotate`: one of the following values: `90`, `180`, `270`
- `flip`: one of the following values: `horizontal`, `vertical`
- `border`: one of the following values: `square`, `circle`
- `animation`: One of the following values: `spin`, `tada`, `flashing`, `burst`, `fade-left`, `fade-right`, `spin-hover`, `tada-hover`, `flashing-hover`, `burst-hover`, `fade-left-hover`, `fade-right-hover`
- `animation`: One of the following values: `spin`, `spin-reverse`, `tada`, `flashing`, `burst`, `fade-left`, `fade-right`, `spin-hover`, `spin-reverse-hover`,`tada-hover`, `flashing-hover`, `burst-hover`, `fade-left-hover`, `fade-right-hover`
- `pull`: one of the following values: `left`,`right`
The Custom Element class (`BoxIconElement`) exposes the following static members:

Expand Down
37 changes: 37 additions & 0 deletions css/animations.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@
transform: rotate(359deg);
}
}
@-webkit-keyframes spin-reverse
{
0%
{
-webkit-transform: rotate(0);
transform: rotate(0);
}
100%
{
-webkit-transform: rotate(-359deg);
transform: rotate(-359deg);
}
}
@keyframes spin-reverse
{
0%
{
-webkit-transform: rotate(0);
transform: rotate(0);
}
100%
{
-webkit-transform: rotate(-359deg);
transform: rotate(-359deg);
}
}
@-webkit-keyframes burst
{
0%
Expand Down Expand Up @@ -312,6 +338,17 @@
animation: spin 2s linear infinite;
}

.bx-spin-reverse
{
-webkit-animation: spin-reverse 2s linear infinite;
animation: spin-reverse 2s linear infinite;
}
.bx-spin-reverse-hover:hover
{
-webkit-animation: spin-reverse 2s linear infinite;
animation: spin-reverse 2s linear infinite;
}

.bx-tada
{
-webkit-animation: tada 1.5s ease infinite;
Expand Down
37 changes: 37 additions & 0 deletions css/boxicons.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,32 @@
transform: rotate(359deg);
}
}
@-webkit-keyframes spin-reverse
{
0%
{
-webkit-transform: rotate(0);
transform: rotate(0);
}
100%
{
-webkit-transform: rotate(-359deg);
transform: rotate(-359deg);
}
}
@keyframes spin-reverse
{
0%
{
-webkit-transform: rotate(0);
transform: rotate(0);
}
100%
{
-webkit-transform: rotate(-359deg);
transform: rotate(-359deg);
}
}
@-webkit-keyframes burst
{
0%
Expand Down Expand Up @@ -364,6 +390,17 @@
animation: spin 2s linear infinite;
}

.bx-spin-reverse
{
-webkit-animation: spin-reverse 2s linear infinite;
animation: spin-reverse 2s linear infinite;
}
.bx-spin-reverse-hover:hover
{
-webkit-animation: spin-reverse 2s linear infinite;
animation: spin-reverse 2s linear infinite;
}

.bx-tada
{
-webkit-animation: tada 1.5s ease infinite;
Expand Down
2 changes: 2 additions & 0 deletions dev.box-icon-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ <h1>Development Page - <code>box-icon</code> Custom Element</h1>
<select name="animation">
<option value="" selected>(none)</option>
<option value="spin">spin</option>
<option value="spin-reverse">spin-reverse</option>
<option value="tada">tada</option>
<option value="flashing">flashing</option>
<option value="burst">burst</option>
<option value="fade-left">fade-left</option>
<option value="fade-right">fade-right</option>
<option value="spin-hover">spin-hover</option>
<option value="spin-reverse-hover">spin-reverse-hover</option>
<option value="tada-hover">tada-hover</option>
<option value="flashing-hover">flashing-hover</option>
<option value="burst-hover">burst-hover</option>
Expand Down