Skip to content

Commit

Permalink
0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
JadlionHD committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 97d9f78 commit 5b1872f
Showing 168 changed files with 310 additions and 227 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "growserver-frontend",
"version": "0.0.3",
"version": "0.0.4",
"private": true,
"type": "module",
"scripts": {
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.
Binary file added public/assets/growtopia/character/body3.23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/character/face1.23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/character/face2.23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/character/full_body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_arm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_arm2.png
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.
Binary file added public/assets/growtopia/game/player_arm_snd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_arm_sno.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_arm_thumbsup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_artifact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_back2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_back3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/growtopia/game/player_chestitem.png
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.
Binary file added public/assets/growtopia/game/player_extraleg.png
Binary file added public/assets/growtopia/game/player_extraleg2.png
Binary file added public/assets/growtopia/game/player_eyes.png
Binary file added public/assets/growtopia/game/player_eyes2.png
Binary file added public/assets/growtopia/game/player_eyes3.png
Binary file added public/assets/growtopia/game/player_face.png
Binary file added public/assets/growtopia/game/player_face2.png
Binary file added public/assets/growtopia/game/player_faceitem.png
Binary file added public/assets/growtopia/game/player_faceitem2.png
Binary file added public/assets/growtopia/game/player_faceitem3.png
Binary file added public/assets/growtopia/game/player_faceitem4.png
Binary file added public/assets/growtopia/game/player_faceitem5.png
Binary file added public/assets/growtopia/game/player_faceitem6.png
Binary file added public/assets/growtopia/game/player_faceitem7.png
Binary file added public/assets/growtopia/game/player_feet.png
Binary file added public/assets/growtopia/game/player_feet10.png
Binary file added public/assets/growtopia/game/player_feet11.png
Binary file added public/assets/growtopia/game/player_feet12.png
Binary file added public/assets/growtopia/game/player_feet13.png
Binary file added public/assets/growtopia/game/player_feet14.png
Binary file added public/assets/growtopia/game/player_feet15.png
Binary file added public/assets/growtopia/game/player_feet16.png
Binary file added public/assets/growtopia/game/player_feet2.png
Binary file added public/assets/growtopia/game/player_feet3.png
Binary file added public/assets/growtopia/game/player_feet4.png
Binary file added public/assets/growtopia/game/player_feet5.png
Binary file added public/assets/growtopia/game/player_feet6.png
Binary file added public/assets/growtopia/game/player_feet7.png
Binary file added public/assets/growtopia/game/player_feet8.png
Binary file added public/assets/growtopia/game/player_feet9.png
Binary file added public/assets/growtopia/game/player_feet_icon.png
Binary file added public/assets/growtopia/game/player_hair.png
Binary file added public/assets/growtopia/game/player_hair2.png
Binary file added public/assets/growtopia/game/player_hair3.png
Binary file added public/assets/growtopia/game/player_hair4.png
Binary file added public/assets/growtopia/game/player_hair5.png
Binary file added public/assets/growtopia/game/player_hairhair.png
Binary file added public/assets/growtopia/game/player_handitem.png
Binary file added public/assets/growtopia/game/player_handitem2.png
Binary file added public/assets/growtopia/game/player_handitem3.png
Binary file added public/assets/growtopia/game/player_handitem4.png
Binary file added public/assets/growtopia/game/player_handitem5.png
Binary file added public/assets/growtopia/game/player_handitem6.png
Binary file added public/assets/growtopia/game/player_handitem7.png
Binary file added public/assets/growtopia/game/player_hater.png
Binary file added public/assets/growtopia/game/player_head.png
Binary file added public/assets/growtopia/game/player_head_skin9.png
Binary file added public/assets/growtopia/game/player_head_snd.png
Binary file added public/assets/growtopia/game/player_head_sno.png
Binary file added public/assets/growtopia/game/player_horsepants.png
Binary file added public/assets/growtopia/game/player_iris1.png
Binary file added public/assets/growtopia/game/player_pants.png
Binary file added public/assets/growtopia/game/player_pants2.png
Binary file added public/assets/growtopia/game/player_pants3.png
Binary file added public/assets/growtopia/game/player_pet.png
Binary file added public/assets/growtopia/game/player_puncharm.png
Binary file added public/assets/growtopia/game/player_shirt.png
Binary file added public/assets/growtopia/game/player_shirt2.png
Binary file added public/assets/growtopia/game/player_shirt3.png
Binary file added public/assets/growtopia/game/player_shirt4.png
Binary file added public/assets/growtopia/game/player_sit.png
Binary file added public/assets/growtopia/game/player_sit2.png
Binary file added public/assets/growtopia/game/player_sit_custom1.png
Binary file added public/assets/growtopia/game/player_sit_skins.png
5 changes: 0 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<template>
<!-- <nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav> -->

<RouterView />
</template>

41 changes: 0 additions & 41 deletions src/components/HelloWorld.vue

This file was deleted.

66 changes: 66 additions & 0 deletions src/components/PlayerHeadCanvas.vue
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>
130 changes: 130 additions & 0 deletions src/components/SideBarMenu.vue
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>
90 changes: 0 additions & 90 deletions src/components/TheWelcome.vue

This file was deleted.

Loading

0 comments on commit 5b1872f

Please sign in to comment.