Files: d118d1c2ea174b51ca37f6c0c981c07850a83897 / stores / songs.js
581 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 | }) |
19 | }) |
20 | |
21 | } |
22 | |
23 |
Built with git-ssb-web