Files: 5d1f36788ffa9716c5b636bec75ced5b68ebf7ae / stores / songs.js
627 bytesRaw
1 | module.exports = store |
2 | |
3 | function store (state,emitter) { |
4 | var songs = require('../songs.json') |
5 | state.songs = songs.songs |
6 | state.currentSong = '' |
7 | |
8 | emitter.on('DOMContentLoaded', function () { |
9 | emitter.on('changeSong', function (song) { |
10 | song = song.replace(/\s+/g, '-').toLowerCase() |
11 | emitter.emit('pushState', '/#songbook/'+song) |
12 | setTimeout("document.getElementById('track').classList.toggle('change-color')", 1500) |
13 | }) |
14 | }) |
15 | emitter.on('DOMContentLoaded', function (){ |
16 | emitter.on('close', function (song) { |
17 | state.lastSong = song |
18 | emitter.emit('pushState', '/#songbook') |
19 | }) |
20 | }) |
21 | |
22 | } |
23 | |
24 |
Built with git-ssb-web