mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-14 06:50:38 -05:00
* side layout initial * add elements to side nav * side buttons links * remove clog * calendar page initial * position sticky working * x trends page initial * new table * same mode selector * mobile friendly table * no underline for nav links * xsearch * x trends page outlined * sr initial * relocate calendar components * calendar fix flex * topnav fancier look * layout looking good edition * relocate xtrends * xtrends remove linecharts * x trends new * calender page new * delete headbanner, new login * remove calendar stuff from api * rename stuff in utils * fix user item margin * new home page initial * remove page concept * no pointer xtrends * remove xrank from app * xtrends service * move fa from app * move plus * maps tweaks * new table for plus history * navigational sidebar flex tweaks * builds page * analyzer * user page * free agents * plans * remove mx * tweaks * change layout to grid * home page finalized * mobile nav * restrict main content width * tweaks style * language switcher * container in css * sticky nav * use duplicate icons for now * change mapsketch width to old * chara tour vid * borzoic icons
124 lines
3.5 KiB
TypeScript
124 lines
3.5 KiB
TypeScript
import { Box, Flex } from "@chakra-ui/react";
|
|
import { Trans } from "@lingui/macro";
|
|
import WeaponImage from "components/common/WeaponImage";
|
|
import { useMyTheme } from "hooks/common";
|
|
import Image from "next/image";
|
|
import { useState } from "react";
|
|
import Draggable from "react-draggable";
|
|
import { weapons } from "utils/lists/weapons";
|
|
|
|
interface DraggableImageAdderProps {
|
|
addImageToSketch: (imgSrc: string) => void;
|
|
}
|
|
|
|
const DraggableImageAdder: React.FC<DraggableImageAdderProps> = ({
|
|
addImageToSketch,
|
|
}) => {
|
|
const { bgColor } = useMyTheme();
|
|
const [activeDrags, setActiveDrags] = useState(0);
|
|
|
|
const onStart = () => {
|
|
setActiveDrags(activeDrags + 1);
|
|
};
|
|
|
|
const onStop = () => {
|
|
setActiveDrags(activeDrags - 1);
|
|
};
|
|
|
|
return (
|
|
<Draggable handle="strong" onStart={onStart} onStop={onStop}>
|
|
<Box
|
|
position="fixed"
|
|
zIndex={999}
|
|
borderRadius="7px"
|
|
boxShadow="7px 14px 13px 2px rgba(0,0,0,0.24)"
|
|
bg={bgColor}
|
|
textAlign="center"
|
|
width="119px"
|
|
ml="850px"
|
|
>
|
|
<strong style={{ cursor: "move" }}>
|
|
<div
|
|
style={{
|
|
fontSize: "17px",
|
|
borderRadius: "7px 7px 0 0",
|
|
padding: "0.3em",
|
|
}}
|
|
>
|
|
<Trans>Add image</Trans>
|
|
</div>
|
|
</strong>
|
|
<Box overflowY="scroll" height="50vh">
|
|
<Flex flexWrap="wrap">
|
|
{weapons.map((wpn) => (
|
|
<Box
|
|
key={wpn}
|
|
onClick={() =>
|
|
addImageToSketch(`/weapons/${wpn.replace(".", "")}.png`)
|
|
}
|
|
m="3px"
|
|
>
|
|
<WeaponImage name={wpn} size={32} />
|
|
</Box>
|
|
))}
|
|
{["Blaster", "Brella", "Charger", "Slosher"].map(
|
|
(grizzcoWeaponClass) => {
|
|
const imgSrc = `/weapons/Grizzco ${grizzcoWeaponClass}.png`;
|
|
return (
|
|
<Box key={grizzcoWeaponClass} m="3px">
|
|
<Image
|
|
onClick={() => addImageToSketch(imgSrc)}
|
|
src={imgSrc}
|
|
width={32}
|
|
height={32}
|
|
/>
|
|
</Box>
|
|
);
|
|
}
|
|
)}
|
|
{["TC", "RM", "CB"].map((mode) => {
|
|
const imgSrc = `/modes/${mode}.png`;
|
|
return (
|
|
<Box key={mode} m="3px">
|
|
<Image
|
|
onClick={() => addImageToSketch(imgSrc)}
|
|
src={imgSrc}
|
|
width={32}
|
|
height={32}
|
|
/>
|
|
</Box>
|
|
);
|
|
})}
|
|
{[
|
|
"Drizzler",
|
|
"Flyfish",
|
|
"Goldie",
|
|
"Griller",
|
|
"Maws",
|
|
"Scrapper",
|
|
"Steel Eal",
|
|
"Steelhead",
|
|
"Stinger",
|
|
"Golden Egg",
|
|
].map((boss) => {
|
|
const imgSrc = `/images/salmonRunIcons/${boss}.png`;
|
|
return (
|
|
<Box key={boss} m="3px">
|
|
<Image
|
|
onClick={() => addImageToSketch(imgSrc)}
|
|
src={imgSrc}
|
|
width={32}
|
|
height={32}
|
|
/>
|
|
</Box>
|
|
);
|
|
})}
|
|
</Flex>
|
|
</Box>
|
|
</Box>
|
|
</Draggable>
|
|
);
|
|
};
|
|
|
|
export default DraggableImageAdder;
|