feat: small, random changes

This commit is contained in:
trafficlunar 2025-10-08 17:31:31 +01:00
parent 9b0cdfdc9b
commit a27f529276
10 changed files with 24 additions and 20 deletions

View file

@ -15,7 +15,7 @@ interface Props {
isSelectionLayer?: boolean; isSelectionLayer?: boolean;
} }
// Lifts 16,000 tiles limit // Removes 16,000 tiles limit
settings.use32bitIndex = true; settings.use32bitIndex = true;
function Blocks({ blocks, missingTexture, textures, coords, scale, version, isSelectionLayer }: Props) { function Blocks({ blocks, missingTexture, textures, coords, scale, version, isSelectionLayer }: Props) {

View file

@ -527,6 +527,9 @@ function Canvas() {
</Application> </Application>
</div> </div>
{/* Overlay for the inset shadow */}
<div className="absolute inset-0 pointer-events-none shadow-[inset_0_0_20px_rgba(0,0,0,0.6)] shadow-black/15 dark:shadow-black/45" />
<CursorInformation mouseCoords={mouseCoords} /> <CursorInformation mouseCoords={mouseCoords} />
<CanvasInformation /> <CanvasInformation />

View file

@ -29,7 +29,7 @@ function CanvasInformation() {
</div> </div>
</div> </div>
<div className="info-child"> <div className="info-child py-2!">
<Slider <Slider
defaultValue={[1]} defaultValue={[1]}
min={-1} // 10^(-1) = 0.1 min={-1} // 10^(-1) = 0.1

View file

@ -28,7 +28,7 @@ function ClearBlocks({ close }: DialogProps) {
<DialogContent> <DialogContent>
<DialogHeader> <DialogHeader>
<DialogTitle>Are you sure?</DialogTitle> <DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>This action will delete every block on the canvas. It cannot be undone once completed.</DialogDescription> <DialogDescription>This action will delete every block on the canvas!</DialogDescription>
</DialogHeader> </DialogHeader>
<DialogFooter> <DialogFooter>

View file

@ -78,7 +78,7 @@ function Replace() {
<Label htmlFor="radius">Block 1</Label> <Label htmlFor="radius">Block 1</Label>
<button <button
onClick={() => onClickBlockButton(1)} onClick={() => onClickBlockButton(1)}
className="h-10 rounded-md border border-zinc-200 dark:border-zinc-800 dark:bg-zinc-950 flex justify-center items-center" className="h-10 rounded-md cursor-pointer border border-zinc-200 dark:border-zinc-800 dark:bg-zinc-950 flex justify-center items-center"
> >
<Application width={32} height={32} backgroundAlpha={0}> <Application width={32} height={32} backgroundAlpha={0}>
<pixiContainer> <pixiContainer>
@ -90,7 +90,7 @@ function Replace() {
<Label htmlFor="radius">Block 2</Label> <Label htmlFor="radius">Block 2</Label>
<button <button
onClick={() => onClickBlockButton(2)} onClick={() => onClickBlockButton(2)}
className="h-10 rounded-md border border-zinc-200 dark:border-zinc-800 dark:bg-zinc-950 flex justify-center items-center" className="h-10 rounded-md cursor-pointer border border-zinc-200 dark:border-zinc-800 dark:bg-zinc-950 flex justify-center items-center"
> >
<Application width={32} height={32} backgroundAlpha={0}> <Application width={32} height={32} backgroundAlpha={0}>
<pixiContainer> <pixiContainer>

View file

@ -30,10 +30,10 @@ function SelectedBlock() {
<TooltipProvider> <TooltipProvider>
<Tooltip delayDuration={0}> <Tooltip delayDuration={0}>
<TooltipTrigger asChild> <TooltipTrigger asChild>
<div className="absolute bottom-1 w-8 h-8 outline-solid outline-1 outline-zinc-800 dark:outline-zinc-200 rounded p-0!"> <div className="absolute bottom-1 w-7 h-7 outline-solid outline-1 outline-zinc-800 dark:outline-zinc-200 rounded p-0!">
<Application width={32} height={32}> <Application width={28} height={28}>
<pixiContainer> <pixiContainer>
<pixiSprite texture={textures[selectedBlock] ?? missingTexture} scale={2} /> <pixiSprite texture={textures[selectedBlock] ?? missingTexture} scale={1.75} />
</pixiContainer> </pixiContainer>
</Application> </Application>
</div> </div>

View file

@ -41,7 +41,7 @@ function Toolbar() {
type="single" type="single"
value={tool} value={tool}
onValueChange={onToolChange} onValueChange={onToolChange}
className="w-full flex flex-col items-center border-r border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 *:py-0.5" className="rounded-none w-full flex flex-col items-center border-r border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 *:py-0.5"
> >
{/* Hand */} {/* Hand */}
<Tooltip delayDuration={0}> <Tooltip delayDuration={0}>

View file

@ -27,16 +27,17 @@ export const HistoryProvider = ({ children }: Props) => {
const MAX_HISTORY = 20; const MAX_HISTORY = 20;
const addHistory = (name: string, apply: () => void, revert: () => void) => { const addHistory = (name: string, apply: () => void, revert: () => void) => {
const newHistory = history.slice(0, currentIndex + 1); setHistory((prev) => {
newHistory.push({ name, apply, revert }); const newHistory = prev.slice(0, currentIndex + 1);
newHistory.push({ name, apply, revert });
if (newHistory.length > MAX_HISTORY) {
newHistory.shift();
}
if (newHistory.length > MAX_HISTORY) {
newHistory.shift();
} else {
setCurrentIndex(newHistory.length - 1); setCurrentIndex(newHistory.length - 1);
} return newHistory;
});
setHistory(newHistory);
}; };
const undo = () => { const undo = () => {

View file

@ -67,7 +67,7 @@ body {
} }
.info-child { .info-child {
@apply bg-zinc-50 dark:bg-zinc-900 px-2 py-1 rounded shadow-xl w-fit border border-zinc-200 dark:border-zinc-800; @apply bg-zinc-50 dark:bg-zinc-900 px-2 py-1 rounded shadow-md shadow-black/25 w-fit border border-zinc-200 dark:border-zinc-800;
} }
/* /*

View file

@ -31,8 +31,8 @@ function AppPage() {
<main <main
className={`overflow-y-hidden h-svh grid ${ className={`overflow-y-hidden h-svh grid ${
isMobileView isMobileView
? "grid-rows-[2.3rem_minmax(0,1fr)_auto] grid-cols-[2.3rem_minmax(0,1fr)]" ? "grid-rows-[2.25rem_minmax(0,1fr)_auto] grid-cols-[2.25rem_minmax(0,1fr)]"
: "grid-rows-[2.3rem_minmax(0,1fr)] grid-cols-[2.3rem_minmax(0,1fr)_auto]" : "grid-rows-[2.25rem_minmax(0,1fr)] grid-cols-[2.25rem_minmax(0,1fr)_auto]"
}`} }`}
> >
<Menubar /> <Menubar />