-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62165ee
commit b8e85ef
Showing
18 changed files
with
473 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# video | ||
*.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { studentInfo } from "./students/students"; | ||
|
||
type keyofDefaultStyle = 'content' | 'student'; | ||
const DefaultStyle: { [K in keyofDefaultStyle]: React.CSSProperties } = { | ||
content: { | ||
margin: 'auto', | ||
marginTop: 20, | ||
marginBottom: 5, | ||
}, | ||
student: { | ||
margin: 10, | ||
}, | ||
} | ||
|
||
interface ImgColProps { | ||
style: React.CSSProperties | keyofDefaultStyle; | ||
size: number; | ||
info: studentInfo; | ||
} | ||
|
||
export default function ImgCol({ style, size, info }: ImgColProps) { | ||
if (typeof style === 'string') style = DefaultStyle[style]; | ||
const imgStyle: React.CSSProperties = { | ||
width: size, | ||
height: size, | ||
...style, | ||
} | ||
return (<div className='imgCol' style={imgStyle}> | ||
<img | ||
className='col' | ||
src={ | ||
info.schale?.CollectionTexture && | ||
`https://schale.gg/images/student/collection/${info.schale?.CollectionTexture}.webp` | ||
} | ||
alt={`${info.schale?.Name || ''} collection image`} | ||
/> | ||
</div>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export function downloadFile(json: object, filename: string) { | ||
const data = JSON.stringify(json, null, 4); | ||
const blob = new Blob([data], { type: 'application/json' }); | ||
const url = URL.createObjectURL(blob); | ||
const anchor = document.createElement('a'); | ||
anchor.href = url; | ||
anchor.download = filename; | ||
document.body.appendChild(anchor); | ||
anchor.click(); | ||
//Remove the Element and the Url | ||
document.body.removeChild(anchor); | ||
URL.revokeObjectURL(url); | ||
} | ||
|
||
export function uploadFile(fileOnLoad: FileReader['onload']) { | ||
const anchor = document.createElement('input'); | ||
anchor.type = 'file'; | ||
anchor.accept = 'application/json'; | ||
document.body.appendChild(anchor); | ||
anchor.addEventListener('change', () => { | ||
if (!anchor.files?.[0]) return; | ||
const reader = new FileReader(); | ||
reader.readAsText(anchor.files?.[0]); | ||
reader.onload = fileOnLoad; | ||
}); | ||
anchor.click(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { NextApiRequest, NextApiResponse } from 'next' | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<string> | ||
) { | ||
res.setHeader('Access-Control-Allow-Origin', '*'); | ||
res.setHeader('Content-Type', 'image/svg+xml'); | ||
let { fill = 'fff' } = req.query; | ||
if (fill instanceof String) fill = fill.substring(0, 6); | ||
res.status(200).send(`<?xml version="1.0" encoding="utf-8"?> | ||
<svg width="90px" height="90px" viewBox="0 0 90 90" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> | ||
<g id="download"> | ||
<path d="M0 90L90 90L90 0L0 0L0 90Z" transform="matrix(1 0 0 -1 0 90)" id="Rectangle-2" fill="#FFFFFF" fill-opacity="0" fill-rule="evenodd" stroke="none" /> | ||
<g id="Group-2" transform="translate(12.5 12)"> | ||
<g id="Group" transform="matrix(1 0 0 -1 21.5 51)"> | ||
<path d="M12 0L12 51" id="Line-3" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
<path d="M12 0.5L0 13" id="Line-4" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
<path d="M12 0.5L24 12.5" id="Line-5" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
</g> | ||
<path d="M12.5 22L9 22C9 22 5 22.25 3 24C1 25.75 0 30 0 30L1.19209e-07 60.5C1.19209e-07 60.5 0.125 62.875 1.5 64.5C2.875 66.125 5.5 67 5.5 67L60.5 67C60.5 67 63.5 66.125 65 64.5C66.5 62.875 66.5 60.5 66.5 60.5L66.5 28C66.5 28 66.5 25.5 65 24C63.5 22.5 60.5 22 60.5 22L54.5 22" id="Line-2" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
</g> | ||
</g> | ||
</svg>`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { NextApiRequest, NextApiResponse } from 'next' | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<string> | ||
) { | ||
res.setHeader('Access-Control-Allow-Origin', '*'); | ||
res.setHeader('Content-Type', 'image/svg+xml'); | ||
let { fill = 'fff' } = req.query; | ||
if (fill instanceof String) fill = fill.substring(0, 6); | ||
res.status(200).send(`<?xml version="1.0" encoding="utf-8"?> | ||
<svg width="90px" height="90px" viewBox="0 0 90 90" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> | ||
<g id="upload"> | ||
<path d="M0 0L90 0L90 90L0 90L0 0Z" id="Rectangle-2" fill="#FFFFFF" fill-opacity="0" fill-rule="evenodd" stroke="none" /> | ||
<g id="Group-2" transform="translate(12.5 11.5)"> | ||
<path d="M12.5 22L9 22C9 22 5 22.25 3 24C1 25.75 0 30 0 30L1.19209e-07 60.5C1.19209e-07 60.5 0.125 62.875 1.5 64.5C2.875 66.125 5.5 67 5.5 67L60.5 67C60.5 67 63.5 66.125 65 64.5C66.5 62.875 66.5 60.5 66.5 60.5L66.5 28C66.5 28 66.5 25.5 65 24C63.5 22.5 60.5 22 60.5 22L54.5 22" id="Line-2" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
<g id="Group" transform="translate(21.500004 0)"> | ||
<path d="M12 0L12 51" id="Line-3" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
<path d="M12 0.5L0 13" id="Line-4" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
<path d="M12 0.5L24 12.5" id="Line-5" fill="none" fill-rule="evenodd" stroke="#${fill}" stroke-width="6" stroke-linecap="round" /> | ||
</g> | ||
</g> | ||
</g> | ||
</svg>`); | ||
} |
Oops, something went wrong.
b8e85ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
momotalk-editor – ./
momotalk-editor.vercel.app
momotalk-editor-git-main-slouchwind.vercel.app
momotalk.slouchwind.tk
momotalk-editor-slouchwind.vercel.app