generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo): fix example with
maskitoRejectEvent
plugin (#767)
- Loading branch information
1 parent
8a3e724
commit 1d0ab10
Showing
5 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
projects/demo/src/pages/documentation/plugins/examples/reject/animation.less
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,21 @@ | ||
@red: rgba(244, 87, 37, 1); | ||
|
||
@keyframes reject-0 { | ||
from { | ||
box-shadow: 0 0 @red; | ||
} | ||
|
||
to { | ||
box-shadow: 0 0 1rem fade(@red, 12%); | ||
} | ||
} | ||
|
||
@keyframes reject-1 { | ||
from { | ||
box-shadow: 0 0 @red; | ||
} | ||
|
||
to { | ||
box-shadow: 0 0 1rem fade(@red, 12%); | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
projects/demo/src/pages/documentation/plugins/examples/reject/component.less
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
projects/demo/src/pages/documentation/plugins/examples/reject/index.ts
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,20 @@ | ||
import './animation.less'; | ||
|
||
import {Maskito} from '@maskito/core'; | ||
|
||
import maskitoOptions from './mask'; | ||
|
||
const element = document.querySelector('input')!; | ||
const maskedInput = new Maskito(element, maskitoOptions); | ||
|
||
let reject = -1; | ||
|
||
element.style.animation = '0.3s 1'; | ||
|
||
element.addEventListener('maskitoReject', () => { | ||
reject += 1; | ||
element.style.animationName = `reject-${reject % 2}`; | ||
}); | ||
|
||
// Call this function when the element is detached from DOM | ||
maskedInput.destroy(); |
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