-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
168 changed files
with
310 additions
and
227 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<canvas id="character" width="256" height="256"></canvas> | ||
<ColorPicker v-model="skinColor" /> | ||
{{ skinColor }} | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import ColorPicker from "primevue/colorpicker"; | ||
import { hexToRgb } from "@/utils"; | ||
import { onMounted, ref, watch } from "vue"; | ||
const skinColor = ref("#ffffff"); | ||
let baseImage: HTMLImageElement | null = null; | ||
let spriteImage: HTMLImageElement | null = null; | ||
const applyTint = () => { | ||
const charEl = document.getElementById("character") as HTMLCanvasElement; | ||
const char = charEl.getContext("2d", { willReadFrequently: true })!; | ||
if (baseImage && spriteImage) { | ||
char.clearRect(0, 0, charEl.width, charEl.height); // Clear the canvas | ||
char.drawImage(baseImage, 0, 0); | ||
const imageData = char.getImageData(0, 0, charEl.width, charEl.height); | ||
const data = imageData.data; | ||
const { r, g, b } = hexToRgb(skinColor.value); | ||
for (let i = 0; i < data.length; i += 4) { | ||
const alpha = data[i + 3] / 255; | ||
data[i] *= (r / 255) * alpha; | ||
data[i + 1] *= (g / 255) * alpha; | ||
data[i + 2] *= (b / 255) * alpha; | ||
} | ||
char.putImageData(imageData, 0, 0); | ||
drawSpriteImage(char, spriteImage, 5, 0); | ||
} | ||
}; | ||
const loadImage = (url: string): Promise<HTMLImageElement> => { | ||
return new Promise((resolve) => { | ||
const img = new Image(); | ||
img.src = url; | ||
img.onload = () => resolve(img); | ||
}); | ||
}; | ||
const drawSpriteImage = ( | ||
char: CanvasRenderingContext2D, | ||
img: HTMLImageElement, | ||
x: number, | ||
y: number, | ||
) => { | ||
char.drawImage(img, x * 32, y * 32, 32, 32, 64, 64, 128, 128); | ||
}; | ||
onMounted(async () => { | ||
baseImage = await loadImage("/assets/growtopia/character/body/head.23.png"); | ||
spriteImage = await loadImage("/assets/growtopia/game/player_faceitem.png"); | ||
applyTint(); | ||
}); | ||
watch(skinColor, () => { | ||
applyTint(); | ||
}); | ||
</script> |
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,130 @@ | ||
<template> | ||
<div class="flex gap-4"> | ||
<div | ||
style="border-right-width: 1px; border-color: rgba(255, 255, 255, 0.2)" | ||
class="sm:flex flex-col justify-between items-center w-auto h-screen p-4 hidden" | ||
> | ||
<div class="font-bold text-3xl">G</div> | ||
|
||
<div class="flex flex-col items-center gap-4"> | ||
<template v-for="(item, key) in items[0].items" :key="key"> | ||
<Button | ||
v-bind="item" | ||
@click=" | ||
() => { | ||
if (!checkRoute(item.route as string)) $router.push({ name: item.route }); | ||
} | ||
" | ||
></Button> | ||
</template> | ||
</div> | ||
<div class="flex flex-col items-center gap-4"> | ||
<template v-for="(item, key) in items[1].items" :key="key"> | ||
<Button v-bind="item"></Button> | ||
</template> | ||
</div> | ||
</div> | ||
|
||
<div class="h-full w-full"> | ||
<header class="flex sm:justify-center justify-between items-center p-6"> | ||
<Button as="div" text plain class="font-bold" size="large"> | ||
<slot name="header-name"></slot> | ||
</Button> | ||
<div class="sm:hidden block"> | ||
<Button | ||
type="button" | ||
text | ||
plain | ||
icon="pi pi-bars" | ||
@click="toggle" | ||
aria-haspopup="true" | ||
aria-controls="overlay_menu" | ||
/> | ||
<Menu ref="menu" id="overlay_menu" :model="items" :popup="true" /> | ||
</div> | ||
</header> | ||
<slot name="content" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useRouter, useRoute } from "vue-router"; | ||
import Button from "primevue/button"; | ||
import Menu from "primevue/menu"; | ||
import { ref } from "vue"; | ||
const $router = useRouter(); | ||
const $route = useRoute(); | ||
const menu = ref(); | ||
const items = ref([ | ||
{ | ||
label: "Navigation", | ||
items: [ | ||
{ | ||
label: "Home", | ||
route: "dashboard", | ||
icon: "pi pi-home", | ||
plain: true, | ||
text: $route.name !== "dashboard", | ||
command: () => { | ||
if (!checkRoute("dashboard")) $router.push({ name: "dashboard" }); | ||
}, | ||
}, | ||
{ | ||
label: "Search", | ||
route: "search", | ||
icon: "pi pi-search", | ||
plain: true, | ||
text: $route.name !== "search", | ||
command: () => { | ||
if (!checkRoute("search")) $router.push({ name: "search" }); | ||
}, | ||
}, | ||
{ | ||
label: "Profile", | ||
route: "profile", | ||
icon: "pi pi-user", | ||
plain: true, | ||
text: $route.name !== "profile", | ||
command: () => { | ||
if (!checkRoute("profile")) $router.push({ name: "profile" }); | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
label: "Misc", | ||
items: [ | ||
{ | ||
label: "Github", | ||
icon: "pi pi-github", | ||
as: "a", | ||
href: "https://github.com/StileDevs/GrowServer", | ||
url: "https://github.com/StileDevs/GrowServer", | ||
target: "_blank", | ||
rel: "noopener", | ||
plain: true, | ||
text: true, | ||
}, | ||
{ | ||
label: "Settings", | ||
route: "settings", | ||
icon: "pi pi-bars", | ||
plain: true, | ||
text: $route.name !== "settings", | ||
command: () => { | ||
if (!checkRoute("settings")) $router.push({ name: "settings" }); | ||
}, | ||
}, | ||
], | ||
}, | ||
]); | ||
const checkRoute = (route: string) => $route.name === route; | ||
const toggle = (event: MouseEvent) => { | ||
menu.value.toggle(event); | ||
}; | ||
</script> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.