Merge pull request #33 from Lumm1t/master

fix typos, remove deprecated HTML attribute
This commit is contained in:
ryo-ma 2021-02-15 22:24:50 +09:00 • committed by GitHub
commit 0d025e6d1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
.vscode .vscode
.env .env
.idea

View file

@ -26,7 +26,7 @@ export class Card {
private maxRow: number, private maxRow: number,
private panelSize: number, private panelSize: number,
private marginWidth: number, private marginWidth: number,
private marginHight: number, private marginHeight: number,
private noBackground: boolean, private noBackground: boolean,
private noFrame: boolean, private noFrame: boolean,
) { ) {
@ -85,7 +85,7 @@ export class Card {
if (row > this.maxRow) { if (row > this.maxRow) {
row = this.maxRow; row = this.maxRow;
} }
this.height = this.panelSize * row + this.marginHight * (row - 1); this.height = this.panelSize * row + this.marginHeight * (row - 1);
// Join all trophy // Join all trophy
const renderedTrophy = trophyList.reduce( const renderedTrophy = trophyList.reduce(
@ -93,7 +93,7 @@ export class Card {
const currentColumn = i % this.maxColumn; const currentColumn = i % this.maxColumn;
const currentRow = Math.floor(i / this.maxColumn); const currentRow = Math.floor(i / this.maxColumn);
const x = this.panelSize * currentColumn + this.marginWidth * currentColumn; const x = this.panelSize * currentColumn + this.marginWidth * currentColumn;
const y = this.panelSize * currentRow + this.marginHight * currentRow; const y = this.panelSize * currentRow + this.marginHeight * currentRow;
return sum + trophy.render(theme, x, y, this.panelSize, this.noBackground, this.noFrame); return sum + trophy.render(theme, x, y, this.panelSize, this.noBackground, this.noFrame);
}, },
"", "",

View file

@ -2,7 +2,7 @@ import { RANK } from "./utils.ts";
import { Theme } from "./theme.ts"; import { Theme } from "./theme.ts";
const leafIcon = (laurel: string): string => { const leafIcon = (laurel: string): string => {
return `<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="90pt" height="90pt" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet"> return `<svg xmlns="http://www.w3.org/2000/svg" width="90pt" height="90pt" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid meet">
<metadata> <metadata>
Created by potrace 1.15, written by Peter Selinger 2001-2017 Created by potrace 1.15, written by Peter Selinger 2001-2017
</metadata> </metadata>
@ -31,7 +31,7 @@ export const getNextRankBar = (
percentage: number, percentage: number,
color: string, color: string,
): string => { ): string => {
const maxWidht = 80; const maxWidth = 80;
return ` return `
<style> <style>
@keyframes ${title}RankAnimation { @keyframes ${title}RankAnimation {
@ -39,7 +39,7 @@ export const getNextRankBar = (
width: 0px; width: 0px;
} }
to { to {
width: ${maxWidht * percentage}px; width: ${maxWidth * percentage}px;
} }
} }
#${title}-rank-progress{ #${title}-rank-progress{
@ -50,7 +50,7 @@ export const getNextRankBar = (
x="15" x="15"
y="101" y="101"
rx="1" rx="1"
width="${maxWidht}" width="${maxWidth}"
height="3.2" height="3.2"
opacity="0.3" opacity="0.3"
fill="${color}" fill="${color}"

View file

@ -38,11 +38,11 @@ export class CustomURLSearchParams extends URLSearchParams {
} }
export function parseParams(req: ServerRequest): CustomURLSearchParams { export function parseParams(req: ServerRequest): CustomURLSearchParams {
const splitedURL = req.url.split("?"); const splittedURL = req.url.split("?");
if (splitedURL.length < 2) { if (splittedURL.length < 2) {
return new CustomURLSearchParams(); return new CustomURLSearchParams();
} }
return new CustomURLSearchParams(splitedURL[1]); return new CustomURLSearchParams(splittedURL[1]);
} }
export function abridgeScore(score: number): string { export function abridgeScore(score: number): string {