Skip to content

Commit

Permalink
Even more formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ofcoursenopewastaken committed Jul 29, 2024
1 parent 3ba909a commit 9d358c2
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 66 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Rhodes Database

The database of Rhodes Island, open to anyone to access!

Rhodes Database is a collection of tools for [Arknights](https://arknights.global).

# Minimal JavaScript

Rhodes Database aims to avoid JavaScript anywhere possible. Core features (listed below) are guaranteed to have 0 JavaScript delivered to your browser when they are loaded. This provides an extremely lightweight, fast and smooth experience.

The core features are:
- Operator information
- Depot
- Enemies archive

- Operator information
- Depot
- Enemies archive

Side features that may have JavaScript:
- Planner
- Requires JavaScript to function. No other way around it ):
- Story reader
- Only requires JavaScript to change Doctor's name. It functions perfectly fine otherwise.

- Planner
- Requires JavaScript to function. No other way around it ):
- Story reader
- Only requires JavaScript to change Doctor's name. It functions perfectly fine otherwise.
4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
autoprefixer: {}
}
}
2 changes: 1 addition & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const SERVER_TO_LANGCODE_MAP: { [region: string]: string } = {
en: "en_US",
cn: "zh_CN",
jp: "ja_JP",
kr: "ko_KR",
kr: "ko_KR"
}
12 changes: 6 additions & 6 deletions src/lib/logic/depot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ASSETS_REPO,
SERVER_TO_LANGCODE_MAP,
SERVERS,
ASSETS_PATH,
ASSETS_PATH
} from "$lib/constants"

import type { GHContent, GHTrees } from "$lib/types"
Expand Down Expand Up @@ -50,7 +50,7 @@ for (const region of SERVERS) {
const rawTable = JSON.parse(
(
await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/item_table.json`)
).toString(),
).toString()
) as RawItemTable

for (const rawItem of Object.values(rawTable.items)) {
Expand All @@ -64,15 +64,15 @@ export const IconPaths: { [k: string]: string } = {}
{
const response = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts/items`,
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts/items`
)
).json()) as GHContent[]

const sha = response.find((v) => v.name === "icons")?.sha

const tree = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`,
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`
)
).json()) as GHTrees

Expand All @@ -87,15 +87,15 @@ export const IconPaths: { [k: string]: string } = {}
{
const response = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/activity/commonassets/`,
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/activity/commonassets/`
)
).json()) as GHContent[]

const sha = response.find((v) => v.name === "[uc]items")?.sha

const tree = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`,
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`
)
).json()) as GHTrees

Expand Down
24 changes: 12 additions & 12 deletions src/lib/logic/enemies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ASSETS_REPO,
SERVER_TO_LANGCODE_MAP,
SERVERS,
ASSETS_PATH,
ASSETS_PATH
} from "$lib/constants"

import type { GHContent, GHTrees } from "$lib/types"
Expand Down Expand Up @@ -119,17 +119,17 @@ for (const region of SERVERS) {
const rawHandbook = JSON.parse(
(
await fs.readFile(
`${GAMEDATA_PATH}/${langCode}/gamedata/excel/enemy_handbook_table.json`,
`${GAMEDATA_PATH}/${langCode}/gamedata/excel/enemy_handbook_table.json`
)
).toString(),
).toString()
) as RawHandbookTable

const rawTable = JSON.parse(
(
await fs.readFile(
`${GAMEDATA_PATH}/${langCode}/gamedata/levels/enemydata/enemy_database.json`,
`${GAMEDATA_PATH}/${langCode}/gamedata/levels/enemydata/enemy_database.json`
)
).toString(),
).toString()
) as RawDatabaseTable

RaceData[region] = rawHandbook.raceData
Expand All @@ -140,7 +140,7 @@ for (const region of SERVERS) {
const rawHandbookEnemy = rawHandbook.enemyData[rawEnemyData.Key] || {
enemyIndex: "",
sortId: Number.parseInt(idx) + largestSortId,
abilityList: [],
abilityList: []
}

const levels: ParsedEnemyLevels = []
Expand All @@ -150,7 +150,7 @@ for (const region of SERVERS) {
const attributes: ParsedAttributes = {
lifePointReduce: rawLevel.enemyData.lifePointReduce.m_defined
? rawLevel.enemyData.lifePointReduce.m_value
: rawLevel0.enemyData.lifePointReduce.m_value,
: rawLevel0.enemyData.lifePointReduce.m_value
}

for (const [attrKey, attrVal] of Object.entries(rawLevel.enemyData.attributes)) {
Expand All @@ -170,7 +170,7 @@ for (const region of SERVERS) {
priority: rawSkill.priority,
cooldown: rawSkill.cooldown,
initCooldown: rawSkill.initCooldown,
spCost: rawSkill.spCost,
spCost: rawSkill.spCost
}

if (rawSkill.blackboard) {
Expand All @@ -185,7 +185,7 @@ for (const region of SERVERS) {
levels.push({
attributes: attributes,
talentBlackboard: rawLevel.enemyData.talentBlackboard || [],
skills: parsedSkills,
skills: parsedSkills
})
}

Expand All @@ -201,7 +201,7 @@ for (const region of SERVERS) {
sortId: rawHandbookEnemy.sortId,

abilities: rawHandbookEnemy.abilityList,
levels: levels,
levels: levels
}
}
}
Expand All @@ -212,15 +212,15 @@ export const IconPaths: { [k: string]: string } = {}
{
const response = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts`,
`https://api.github.com/repos/${ASSETS_REPO}/contents/${ASSETS_PATH}/arts`
)
).json()) as GHContent[]

const sha = response.find((v) => v.name === "enemies")?.sha

const tree = (await (
await fetchWithAuth(
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`,
`https://api.github.com/repos/${ASSETS_REPO}/git/trees/${sha}?recursive=1`
)
).json()) as GHTrees

Expand Down
10 changes: 5 additions & 5 deletions src/lib/logic/operators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ASSETS_REPO,
ASSETS_BRANCH,
SERVER_TO_LANGCODE_MAP,
SERVERS,
SERVERS
} from "$lib/constants"

import type { BlackboardEntry } from "$lib/types"
Expand Down Expand Up @@ -113,13 +113,13 @@ for (const region of SERVERS) {
const rawCharTable = JSON.parse(
(
await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/character_table.json`)
).toString(),
).toString()
) as RawCharacterTable

const RawSkillTable = JSON.parse(
(
await fs.readFile(`${GAMEDATA_PATH}/${langCode}/gamedata/excel/skill_table.json`)
).toString(),
).toString()
) as RawSkillTable

for (const [charId, rawChar] of Object.entries(rawCharTable)) {
Expand All @@ -146,7 +146,7 @@ for (const region of SERVERS) {
name: rawSkillData.levels[0].name,

levels: rawSkillData.levels,
masteryCosts: rawCharSkill.levelUpCostCond,
masteryCosts: rawCharSkill.levelUpCostCond
})
}
}
Expand All @@ -166,7 +166,7 @@ for (const region of SERVERS) {
profession: rawChar.profession,
subProfession: rawChar.subProfessionId,

skills: skills,
skills: skills
}

Data[region][charId] = parsedChar
Expand Down
6 changes: 3 additions & 3 deletions src/lib/logic/richtext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function ParseRichtextToNodes(text: string): RichtextNode[] {
alwaysCreateTextNode: true,
trimValues: false,
parseAttributeValue: false,
parseTagValue: false,
parseTagValue: false
})

const nodes: RichtextNode[] = []
Expand All @@ -37,8 +37,8 @@ export function ParseRichtextToNodes(text: string): RichtextNode[] {
const nodeData: RichtextNode = structuredClone(
parentNodeData || {
text: "",
formatters: [],
},
formatters: []
}
)

if (key === "#text") {
Expand Down
24 changes: 12 additions & 12 deletions src/localization/en.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"depot": "Depot",
"enemies": "Enemies",
"glossary": "Glossary",
"operators": "Operators",
"depot": "Depot",
"enemies": "Enemies",
"glossary": "Glossary",
"operators": "Operators",

"level": "Level",
"level_plural": "Levels",
"level": "Level",
"level_plural": "Levels",

"description": "Description",
"duration": "Duration",
"init_sp": "Initial SP",
"sp_cost": "SP Cost",
"blackboard": "Blackboard"
}
"description": "Description",
"duration": "Duration",
"init_sp": "Initial SP",
"sp_cost": "SP Cost",
"blackboard": "Blackboard"
}
8 changes: 4 additions & 4 deletions src/routes/[region]/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ for (const region of SERVERS) {
const rawTable = JSON.parse(
(
await fs.readFile(
`${GAMEDATA_PATH}/${SERVER_TO_LANGCODE_MAP[region]}/gamedata/excel/gamedata_const.json`,
`${GAMEDATA_PATH}/${SERVER_TO_LANGCODE_MAP[region]}/gamedata/excel/gamedata_const.json`
)
).toString(),
).toString()
) as RawGamedataConst

GamedataConst[region] = {
richTextStyles: rawTable.richTextStyles,
termDescriptionDict: rawTable.termDescriptionDict,
termDescriptionDict: rawTable.termDescriptionDict
}
}

Expand All @@ -40,6 +40,6 @@ export function load({ params }) {
return {
richtextTable: GamedataConst[params.region],
strings: localizationTable,
region: params.region,
region: params.region
}
}
2 changes: 1 addition & 1 deletion src/routes/[region]/depot/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { IconPaths, Data } from "$lib/logic/depot"
export function load({ params }) {
return {
itemTable: Data[params.region],
iconPaths: IconPaths,
iconPaths: IconPaths
}
}
4 changes: 2 additions & 2 deletions src/routes/[region]/depot/[itemId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function load({ params }) {
rarity: itemData.rarity,

itemId: itemData.itemId,
iconUrl: iconUrl,
iconUrl: iconUrl
}
}

Expand All @@ -25,7 +25,7 @@ export async function entries() {
for (const itemId of Object.keys(Data[region])) {
returns.push({
itemId: itemId,
region: region,
region: region
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[region]/enemies/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Data, IconPaths } from "$lib/logic/enemies"
export function load({ params }) {
return {
enemiesTable: Data[params.region],
iconPaths: IconPaths,
iconPaths: IconPaths
}
}
4 changes: 2 additions & 2 deletions src/routes/[region]/enemies/[enemyId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function load({ params }) {
levels: enemyData.levels,

iconUrl: iconUrl,
types: types,
types: types
}
}

Expand All @@ -34,7 +34,7 @@ export async function entries() {
for (const enemy of Object.values(Data[region])) {
returns.push({
enemyId: enemy.enemyId,
region: region,
region: region
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[region]/operators/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { Data } from "$lib/logic/operators"

export function load({ params }) {
return {
charTable: Data[params.region],
charTable: Data[params.region]
}
}
2 changes: 1 addition & 1 deletion src/routes/[region]/operators/[charId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { Data } from "$lib/logic/operators"

export function load({ params }) {
return {
charData: Data[params.region][params.charId],
charData: Data[params.region][params.charId]
}
}
6 changes: 3 additions & 3 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const config = {
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({}),
alias: {
$src: "src",
},
},
$src: "src"
}
}
}

export default config
Loading

0 comments on commit 9d358c2

Please sign in to comment.