Files: 514e4db9740ba4ba968e7bed35cdf34c6eb5bab8 / stores / songs.js
438 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('changeSong', function (song) { |
9 | song = song.replace(/\s+/g, '-').toLowerCase() |
10 | document.getElementById('tracklist').classList.toggle('fade-in') |
11 | emitter.emit('pushState', '/#songbook/'+song) |
12 | document.getElementById('text').classList.toggle('fade-in') |
13 | }) |
14 | } |
15 | |
16 |
Built with git-ssb-web