diff --git a/src/index.coffee b/src/index.coffee new file mode 100644 index 0000000..df09196 --- /dev/null +++ b/src/index.coffee @@ -0,0 +1,21 @@ +# libs +window.$ = require('jquery') + +# on load +$ -> + # libs requiring full DOM + io = require 'socket.io-client' + + # style sheet + require './style/custom.scss' + + # init Socket.IO + socket = io() + + $('form[name="fftcg-login"]').submit -> + data = + uname: $('input[name="uname"]').val() + password: $('input[name="password"]').val() + @reset() + socket.emit 'login', data + false diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 3619e41..0000000 --- a/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import $ from 'jquery' - -// import 'bootstrap' -import 'bootstrap/js/dist/carousel' - -import './style/custom.scss' diff --git a/src/scripts/index/10-init-framework.coffee b/src/scripts/index/10-init-framework.coffee deleted file mode 100644 index d7db864..0000000 --- a/src/scripts/index/10-init-framework.coffee +++ /dev/null @@ -1,10 +0,0 @@ -# init Socket.IO -socket = io() - -$('form[name="fftcg-login"]').submit -> - data = - uname: $('input[name="uname"]').val() - password: $('input[name="password"]').val() - @reset() - socket.emit 'login', data - false diff --git a/webpack.config.js b/webpack.config.js index f196f95..25512da 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ module.exports = { mode: 'development', entry: { - index: './src/index.js', + index: './src/index.coffee', game: './src/game.coffee' },