mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-05-13 13:17:45 +00:00
Compare commits
No commits in common. "48df28b285a86d1577ac33ba300b22239ffb7abe" and "27b0cc18a0f31ac995e6061e8aef11f122305b12" have entirely different histories.
48df28b285
...
27b0cc18a0
4 changed files with 3 additions and 14 deletions
|
|
@ -51,7 +51,7 @@ export default function AdminBanner() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{shouldShow && message && (
|
{shouldShow && message && (
|
||||||
<div className="relative w-full min-h-10 bg-orange-300 border-y-2 border-y-orange-400 mt-1 pl-2 shadow-md flex justify-center items-center text-orange-900 text-nowrap overflow-x-auto font-semibold max-sm:justify-between">
|
<div className="relative w-full min-h-10 bg-orange-300 border-y-2 border-y-orange-400 mt-1 pl-2 shadow-md flex justify-center text-orange-900 text-nowrap overflow-x-auto font-semibold max-sm:justify-between">
|
||||||
<div className="flex gap-2 h-full items-center w-fit">
|
<div className="flex gap-2 h-full items-center w-fit">
|
||||||
<Icon icon="humbleicons:exclamation" className="text-2xl min-w-6" />
|
<Icon icon="humbleicons:exclamation" className="text-2xl min-w-6" />
|
||||||
<span>{message}</span>
|
<span>{message}</span>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ export default function FilterMenu() {
|
||||||
const rawTags = searchParams.get("tags") || "";
|
const rawTags = searchParams.get("tags") || "";
|
||||||
const rawExclude = searchParams.get("exclude") || "";
|
const rawExclude = searchParams.get("exclude") || "";
|
||||||
const allowCopying = (searchParams.get("allowCopying") as unknown as boolean) || false;
|
const allowCopying = (searchParams.get("allowCopying") as unknown as boolean) || false;
|
||||||
const isFromSaveFile = (searchParams.get("isFromSaveFile") as unknown as boolean) || false;
|
|
||||||
|
|
||||||
const tags = useMemo(
|
const tags = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|
@ -67,10 +66,9 @@ export default function FilterMenu() {
|
||||||
if (gender) count++;
|
if (gender) count++;
|
||||||
if (allowCopying) count++;
|
if (allowCopying) count++;
|
||||||
if (makeup) count++;
|
if (makeup) count++;
|
||||||
if (isFromSaveFile) count++;
|
|
||||||
|
|
||||||
setFilterCount(count);
|
setFilterCount(count);
|
||||||
}, [tags, exclude, platform, gender, allowCopying, makeup, isFromSaveFile]);
|
}, [tags, exclude, platform, gender, allowCopying, makeup]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default function ProfileLayout() {
|
||||||
|
|
||||||
const isAdmin = userId === Number(import.meta.env.VITE_ADMIN_USER_ID);
|
const isAdmin = userId === Number(import.meta.env.VITE_ADMIN_USER_ID);
|
||||||
const isContributor = import.meta.env.VITE_CONTRIBUTORS_USER_IDS?.split(",").includes(String(user?.id));
|
const isContributor = import.meta.env.VITE_CONTRIBUTORS_USER_IDS?.split(",").includes(String(user?.id));
|
||||||
const isOwnProfile = $session?.user?.id && userId === Number($session.user.id);
|
const isOwnProfile = userId === user?.id;
|
||||||
|
|
||||||
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
const joinDate = new Date(user.createdAt).toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
||||||
const metaTitle = `${user.name} - TomodachiShare`;
|
const metaTitle = `${user.name} - TomodachiShare`;
|
||||||
|
|
|
||||||
|
|
@ -91,15 +91,6 @@ export class SwitchTomodachiLifeMii {
|
||||||
const decompressed = Buffer.from(fzstd.decompress(canvasData));
|
const decompressed = Buffer.from(fzstd.decompress(canvasData));
|
||||||
const deswizzled = new BytesDeswizzle(decompressed, [256, 256], [1, 1], 4, 4).deswizzle();
|
const deswizzled = new BytesDeswizzle(decompressed, [256, 256], [1, 1], 4, 4).deswizzle();
|
||||||
|
|
||||||
// Issue (#47)
|
|
||||||
const gamma = 0.4545;
|
|
||||||
|
|
||||||
for (let i = 0; i < deswizzled.length; i += 4) {
|
|
||||||
deswizzled[i] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i] / 255, gamma)));
|
|
||||||
deswizzled[i + 1] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i + 1] / 255, gamma)));
|
|
||||||
deswizzled[i + 2] = Math.min(255, Math.round(255 * Math.pow(deswizzled[i + 2] / 255, gamma)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return await sharp(deswizzled, {
|
return await sharp(deswizzled, {
|
||||||
raw: { width: 256, height: 256, channels: 4 },
|
raw: { width: 256, height: 256, channels: 4 },
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue