recode smart-tip demo.js