Created base frame for pokemon pages, added/updated a few sprites
|
@ -0,0 +1,99 @@
|
|||
style
|
||||
table.forme{
|
||||
display: inline-table;
|
||||
border: 1px solid black;
|
||||
}
|
||||
td{
|
||||
border: 1px solid black;
|
||||
|
||||
}
|
||||
.img{
|
||||
}
|
||||
.imgcell{
|
||||
width: 400px;
|
||||
height: 200px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.description{
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
|
||||
each forme, i in data.formedata
|
||||
table.forme
|
||||
tr
|
||||
th #{data.name}
|
||||
- var dexno = data.speciesdata.id.toString()
|
||||
if dexno.length == 1
|
||||
- dexno = "00" + dexno
|
||||
else if data.speciesdata.id.length == 2
|
||||
- dexno = "0" + dexno
|
||||
th #{dexno}
|
||||
if i != "default"
|
||||
- var imgname = dexno + "-" + i
|
||||
else
|
||||
- var imgname = dexno
|
||||
tr
|
||||
td(colspan=2) #{i}
|
||||
tr
|
||||
td.imgcell(colspan=2)
|
||||
img.img(src="/Sprites/front/#{imgname}.png")
|
||||
tr
|
||||
td Types
|
||||
td #{forme.types}
|
||||
tr
|
||||
td Abilities
|
||||
td #{forme.abilities}
|
||||
tr
|
||||
td Hidden Ability
|
||||
td #{forme.hiddenAbility}
|
||||
tr
|
||||
td Stats
|
||||
td
|
||||
table
|
||||
tr
|
||||
td HP
|
||||
td #{forme.stats.hp}
|
||||
tra
|
||||
td Attack
|
||||
td #{forme.stats.attack}
|
||||
tr
|
||||
td Defense
|
||||
td #{forme.stats.defense}
|
||||
tr
|
||||
td Sp. Att.
|
||||
td #{forme.stats.specialAttack}
|
||||
tr
|
||||
td Sp. Def.
|
||||
td #{forme.stats.specialDefense}
|
||||
tr
|
||||
td Speed
|
||||
td #{forme.stats.speed}
|
||||
tr
|
||||
td Tier
|
||||
td #{forme.tier}
|
||||
tr
|
||||
td Generation
|
||||
td #{data.speciesdata.generation}
|
||||
|
||||
table
|
||||
tr
|
||||
th Learnset
|
||||
tr
|
||||
th Name
|
||||
th Type
|
||||
th Power
|
||||
th Damage
|
||||
th Accuracy
|
||||
th Priority
|
||||
th Description
|
||||
each move in data.learnablemoves
|
||||
tr
|
||||
td #{move}
|
||||
td #{move_data[move].type}
|
||||
td #{move_data[move].power}
|
||||
td #{move_data[move].damage}
|
||||
td #{move_data[move].accuracy}
|
||||
td #{move_data[move].priority}
|
||||
td.description #{move_data[move].description}
|
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 767 B After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 17 KiB |
|
@ -169,7 +169,8 @@ function makeObject(next) {
|
|||
else { formeObj.tier = "Unsorted" }
|
||||
formeObj.types = forme.types;
|
||||
formeObj.Abilities = forme.abilities;
|
||||
formeObj.HA = forme.hiddenAbility;
|
||||
if (forme.hiddenAbility) { formeObj.HA = forme.hiddenAbility; }
|
||||
else { formeObj.HA = "" }
|
||||
formeObj.stats = forme.stats;
|
||||
formeObj.unreleased = forme.unreleased;
|
||||
pokeObj.formes[formeName] = formeObj
|
||||
|
|
|
@ -29,7 +29,7 @@ loggedin = false
|
|||
exports.middleware = -> (req, res, next) ->
|
||||
cookies = new Cookies( req, res )
|
||||
|
||||
return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/tiers|^\/replays\/\b/)
|
||||
return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/tiers|^\/pokemon|^\/replays\/\b/)
|
||||
return next() if req.path.match(/^\/leaderboard/) # add some proper site authentication later instead
|
||||
|
||||
authenticate req, (body) ->
|
||||
|
|
|
@ -19,6 +19,8 @@ config = require('./config')
|
|||
alts = require('./alts')
|
||||
replays = require('./replays')
|
||||
modify = require('./modify')
|
||||
learnsets = require '../shared/learnsets'
|
||||
|
||||
|
||||
MAX_MESSAGE_LENGTH = 250
|
||||
MAX_RANK_DISPLAYED = 25
|
||||
|
@ -61,6 +63,28 @@ CLIENT_VERSION = assets.getVersion()
|
|||
app.delete("/replays/:id", replays.routes.destroy)
|
||||
app.get("/replays", replays.routes.index)
|
||||
|
||||
app.get "/pokemon/:id", (req, res) ->
|
||||
thispokemon = req.params.id
|
||||
thispokemon = thispokemon.replace("_", " ")
|
||||
pokeObj = {}
|
||||
pokeObj.name = thispokemon
|
||||
pokeObj.formedata = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].FormeData[thispokemon]
|
||||
pokeObj.speciesdata = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].SpeciesData[thispokemon]
|
||||
pokeObj.learnablemoves = learnsets.learnableMoves(generations.GenerationJSON, {species:thispokemon, forme:"default"}, 7)
|
||||
moveObj = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].MoveData
|
||||
res.render('pokemon.jade', data:pokeObj, move_data:moveObj)
|
||||
|
||||
app.get "/pokemon/:id/json", (req, res) ->
|
||||
thispokemon = req.params.id
|
||||
thispokemon = thispokemon.replace("_", " ")
|
||||
pokeObj = {}
|
||||
pokeObj.name = thispokemon
|
||||
pokeObj.formedata = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].FormeData[thispokemon]
|
||||
pokeObj.speciesdata = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].SpeciesData[thispokemon]
|
||||
pokeObj.learnablemoves = learnsets.learnableMoves(generations.GenerationJSON, {species:thispokemon, forme:"default"}, 7)
|
||||
moveObj = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].MoveData
|
||||
res.json(data:pokeObj, move_data:moveObj)
|
||||
|
||||
app.get '/leaderboard', (req, res) ->
|
||||
page = req.param('page')
|
||||
perPage = req.param('per_page')
|
||||
|
|