move logic to js
mapping function and configs, reorg demo page
update