This file contains hidden or 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
const element = document.querySelector('#doorman'); | |
const doorman = new Doorman(element, { /* options */ }); | |
doorman.start(); |
This file contains hidden or 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
<div data-doorman>Welcome</div> |
This file contains hidden or 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
[data-doorman] { | |
visibility: hidden; | |
} |
This file contains hidden or 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
<script src="umd/doorman.min.js"></script> | |
<!-- OR CDN --> | |
<script src="https://unpkg.com/@blivesta/doorman/umd/doorman.min.js"></script> |
This file contains hidden or 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
import React from 'react' | |
class SvgIcon extends React.Component { | |
static get propTypes () { | |
return { | |
className: React.PropTypes.string, | |
iconName: React.PropTypes.string, | |
viewBox: React.PropTypes.string | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<style> | |
* { | |
margin: 0; | |
position: 0; |
This file contains hidden or 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
var chaffle = new Chaffle(el, { | |
lang: 'en', // default: 'en' | |
// 'en' || 'ja' || 'ja-hiragana' || 'ja-katakana' || 'ua' | |
speed: 20, // default: 20 | |
delay: 100, // default: 100 | |
}); |
This file contains hidden or 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
// Example: mouseover | |
import Chaffle from 'chaffle' | |
const elements = document.querySelectorAll('[data-chaffle]'); | |
Array.prototype.forEach.call(elements, function (el) { | |
const chaffle = new Chaffle(el, { /* options */ }); | |
el.addEventListener('mouseover', function () { | |
chaffle.init(); | |
}); |
This file contains hidden or 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
<p data-chaffle="en">English</p> | |
<p data-chaffle="ja">日本語</p> | |
<p data-chaffle="ja-hiragana">ひらがな</p> | |
<p data-chaffle="ja-katakana">カタカナ</p> | |
<p data-chaffle="ua">Українська</p> |
This file contains hidden or 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
<script src="YOUR-PROJECT/chaffle.min.js"></script> | |
<!-- CDN --> | |
<script src="https://npmcdn.com/chaffle/chaffle.min.js"></script> |