legacy purge
This commit is contained in:
parent
d4358479f6
commit
cbc27f1706
6 changed files with 0 additions and 252 deletions
|
@ -18,12 +18,6 @@ import RegisterForm from '@/components/forms/Register.vue'
|
|||
export default {
|
||||
name: 'Home',
|
||||
|
||||
data() {
|
||||
return {
|
||||
dialog: false
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
Header,
|
||||
LoginForm,
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
# libs
|
||||
window.$ = require('jquery')
|
||||
|
||||
# on load
|
||||
$ ->
|
||||
# libs requiring full DOM
|
||||
require 'craftyjs/dist/crafty'
|
||||
io = require 'socket.io-client'
|
||||
|
||||
# style sheet
|
||||
require './style/custom.scss'
|
||||
|
||||
# fftcg libs
|
||||
require './game/config.coffee'
|
||||
require './game/components/Card.coffee'
|
||||
require './game/scenes/Battle.coffee'
|
||||
|
||||
# init Socket.IO
|
||||
socket = io()
|
||||
|
||||
# init CraftyJS framework
|
||||
Crafty.init()
|
||||
|
||||
# Load base scene
|
||||
Crafty.scene "Battle"
|
||||
|
||||
# Testing some entities
|
||||
Crafty.sprite 480, 670, '//www.fftcgmognet.com/images/cards/hd/1/1/107.jpg',
|
||||
shantotto: [
|
||||
0
|
||||
0
|
||||
]
|
||||
|
||||
backups = [
|
||||
|
||||
Crafty.e 'shantotto, AllyCard'
|
||||
.attr {
|
||||
card:
|
||||
type: 'backup'
|
||||
}
|
||||
|
||||
Crafty.e 'shantotto, AllyCard'
|
||||
.attr {
|
||||
card:
|
||||
type: 'backup'
|
||||
}
|
||||
|
||||
Crafty.e 'shantotto, AllyCard'
|
||||
.attr {
|
||||
card:
|
||||
type: 'backup'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
Crafty 'AllyCard'
|
||||
.each (index) ->
|
||||
switch @card.type
|
||||
when 'backup'
|
||||
@trigger 'Place',
|
||||
x: CONF.coord.x.main + index * CONF.coord.x.step
|
||||
y: CONF.coord.y.bkup
|
||||
return
|
||||
|
||||
|
||||
Crafty.e 'shantotto, EnemyCard'
|
||||
.trigger 'Place',
|
||||
x: 900
|
||||
y: 0
|
||||
|
||||
return
|
105
src/index.coffee
105
src/index.coffee
|
@ -1,105 +0,0 @@
|
|||
# libs
|
||||
window.$ = require('jquery')
|
||||
|
||||
# import bootstrap
|
||||
require './style/custom.scss'
|
||||
require 'bootstrap/js/dist/alert'
|
||||
|
||||
window.showAlert = (level, content) ->
|
||||
($ '.alert').alert 'close'
|
||||
|
||||
($ '#alert-area').append ($ '<div>',
|
||||
class: "alert alert-#{level} alert-dismissible fade show"
|
||||
role: 'alert'
|
||||
.append content, ($ '<button>',
|
||||
type: 'button'
|
||||
class: 'close'
|
||||
'data-dismiss': 'alert',
|
||||
'aria-label': 'Close'
|
||||
.append ($ '<span>',
|
||||
'aria-hidden': 'true'
|
||||
.append '×'
|
||||
)))
|
||||
|
||||
# on load
|
||||
$ ->
|
||||
# reset forms
|
||||
$('form').each ->
|
||||
@fullReset = ->
|
||||
$('input', @).each ->
|
||||
$(@).removeClass 'is-invalid'
|
||||
$(@).removeClass 'is-valid'
|
||||
@reset()
|
||||
|
||||
# login form
|
||||
$('form[name="login"]').submit (event) ->
|
||||
that = @
|
||||
# inhibit normal form submission
|
||||
event.preventDefault()
|
||||
|
||||
# gather form data
|
||||
login = $('input[name="login"]', @)
|
||||
password = $('input[name="password"]', @)
|
||||
|
||||
# transmit form data
|
||||
$.post '/login',
|
||||
login: login.val()
|
||||
password: password.val()
|
||||
.done (data) ->
|
||||
if data.status == 'ok'
|
||||
that.fullReset()
|
||||
showAlert 'success', "successfully logged in '#{data.login}'"
|
||||
location.reload()
|
||||
|
||||
else
|
||||
switch data.text
|
||||
when 'login'
|
||||
showAlert 'warning', 'Invalid username and/or password.'
|
||||
login.addClass 'is-invalid'
|
||||
password.addClass 'is-invalid'
|
||||
when 'db' or 'hash'
|
||||
showAlert 'danger', 'Internal failure, try again later.'
|
||||
else
|
||||
showAlert 'danger', 'Unknown failure. Can you reproduce this?'
|
||||
|
||||
# registration form
|
||||
$('form[name="register"]').submit (event) ->
|
||||
that = @
|
||||
# inhibit normal form submission
|
||||
event.preventDefault()
|
||||
|
||||
# gather form data
|
||||
login = $('input[name="login"]', @)
|
||||
password = $('input[name="password"]', @)
|
||||
confirm = $('input[name="confirm"]', @)
|
||||
|
||||
# check form data
|
||||
if password.val() != confirm.val()
|
||||
confirm.addClass 'is-invalid'
|
||||
confirm.focus()
|
||||
|
||||
else
|
||||
# transmit form data
|
||||
$.post '/register',
|
||||
login: login.val()
|
||||
password: password.val()
|
||||
.done (data) ->
|
||||
if data.status == 'ok'
|
||||
that.fullReset()
|
||||
showAlert 'success', "successfully registered '#{data.login}'"
|
||||
|
||||
else
|
||||
switch data.text
|
||||
when 'invalid'
|
||||
showAlert 'warning', 'Invalid user input. Please provide username AND password.'
|
||||
login.addClass 'is-invalid'
|
||||
password.addClass 'is-invalid'
|
||||
login.focus()
|
||||
when 'hash'
|
||||
showAlert 'danger', 'Internal failure, try again later.'
|
||||
when 'db'
|
||||
showAlert 'danger', 'Internal failure or user name already taken.'
|
||||
login.addClass 'is-invalid'
|
||||
login.focus()
|
||||
else
|
||||
showAlert 'danger', 'Unknown failure. Can you reproduce this?'
|
|
@ -1,11 +0,0 @@
|
|||
# libs
|
||||
window.$ = require('jquery')
|
||||
|
||||
# import bootstrap
|
||||
require './style/custom.scss'
|
||||
require 'bootstrap/js/dist/alert'
|
||||
require 'bootstrap/js/dist/collapse'
|
||||
|
||||
# on load
|
||||
$ ->
|
||||
return
|
|
@ -1,6 +0,0 @@
|
|||
doctype html
|
||||
html
|
||||
head
|
||||
title Crafty Things
|
||||
script(src='/game.bundle.js')
|
||||
body
|
|
@ -1,53 +0,0 @@
|
|||
doctype html
|
||||
html
|
||||
|
||||
head
|
||||
title Crafty Things
|
||||
script(src='/index.bundle.js')
|
||||
|
||||
body
|
||||
|
||||
header.jumbotron.jumbotron-fluid.py-4.bg-primary.text-light.text-center
|
||||
div.container
|
||||
h1 Hello World!
|
||||
h2 App under development, please don't submit any valuable data!
|
||||
|
||||
div.container.bg-light
|
||||
div#alert-area
|
||||
div.row
|
||||
|
||||
div.col-md-6
|
||||
h3 Yavook!FFTCG
|
||||
p Lorem ipsum dolor sit amet
|
||||
|
||||
div.col-md-3
|
||||
h3 Login
|
||||
form(name="login")
|
||||
div.form-group
|
||||
label(for="login") User name:
|
||||
input.form-control(name="login" required)
|
||||
|
||||
div.form-group
|
||||
label(for="password") Password:
|
||||
input.form-control(name="password" type="password" required)
|
||||
|
||||
div.form-group
|
||||
button.btn.btn-primary.w-100(type="submit") Login
|
||||
|
||||
div.col-md-3
|
||||
h3 Register
|
||||
form(name="register")
|
||||
div.form-group
|
||||
label(for="login") User name:
|
||||
input.form-control(name="login" required)
|
||||
div.invalid-feedback User name invalid or taken.
|
||||
|
||||
div.form-group
|
||||
label(for="password") Password:
|
||||
input.form-control(name="password" type="password" required)
|
||||
|
||||
label(for="confirm") Confirm password:
|
||||
input.form-control(name="confirm" type="password")
|
||||
div.invalid-feedback Passwords do not match.
|
||||
|
||||
button.btn.btn-primary.w-100(type="submit") Register
|
Reference in a new issue