Created
November 21, 2017 07:27
-
-
Save ishiduca/1037036771fc45ac053eae62a6d54d61 to your computer and use it in GitHub Desktop.
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
var button = require('../button') | |
var i = 0 | |
var cs = ('abcdefg').split('') | |
var btn = button('hello', { | |
attributes: { | |
title: 'hoge hoge' | |
}, | |
styles: { | |
border: '1px solid #bbddff', | |
'border-radius': '1em', | |
padding: '.5em', | |
'font-size': '12px', | |
'background-color': '#ddeeff' | |
}, | |
events: { | |
mouseover (e) { | |
btn.update('HELLO', { | |
styles: { | |
border: '1px solid #ffddbb', | |
'background-color': '#ffeedd' | |
} | |
}) | |
}, | |
mouseout (e) { | |
btn.update('hello', { | |
styles: { | |
border: '1px solid #bbddff', | |
'background-color': '#ddeeff' | |
} | |
}) | |
} | |
} | |
}, btn => { | |
console.log(cs[i]) | |
i = (i + 1) % cs.length | |
}) | |
document.body.appendChild(btn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment