Spaces:
Running
Running
refactor(App.jsx): improve layout and styling for enhanced user interaction
Browse files- src/App.jsx +97 -97
src/App.jsx
CHANGED
@@ -485,9 +485,10 @@ const App = () => {
|
|
485 |
minH="100vh"
|
486 |
w="100%"
|
487 |
display="flex"
|
|
|
488 |
alignItems="center"
|
489 |
justifyContent="center"
|
490 |
-
bg="
|
491 |
overflow="hidden"
|
492 |
position="relative"
|
493 |
>
|
@@ -498,104 +499,102 @@ const App = () => {
|
|
498 |
left={0}
|
499 |
right={0}
|
500 |
bottom={0}
|
501 |
-
opacity={0.
|
502 |
-
backgroundImage="radial-gradient(circle at 1px 1px, #
|
503 |
backgroundSize="40px 40px"
|
504 |
pointerEvents="none"
|
505 |
/>
|
506 |
|
507 |
-
|
508 |
-
|
509 |
-
maxW={{ base: "
|
510 |
w="full"
|
511 |
-
backdropFilter="blur(25px)"
|
512 |
-
bg="rgba(28, 28, 30, 0.75)"
|
513 |
-
borderRadius="2xl"
|
514 |
-
borderWidth="1px"
|
515 |
-
borderColor="rgba(255, 255, 255, 0.08)"
|
516 |
-
boxShadow="0 20px 40px rgba(0, 0, 0, 0.4)"
|
517 |
-
overflow="hidden"
|
518 |
-
position="relative"
|
519 |
>
|
520 |
-
{/* Title
|
521 |
-
<
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
|
|
|
|
|
|
|
|
|
|
540 |
{/* Main Drop Area */}
|
541 |
<Box
|
542 |
w="full"
|
|
|
543 |
display="flex"
|
544 |
alignItems="center"
|
545 |
justifyContent="center"
|
546 |
cursor="pointer"
|
547 |
transition="all 0.3s"
|
548 |
onClick={() => fileInputRef.current?.click()}
|
549 |
-
|
550 |
-
|
|
|
|
|
|
|
|
|
551 |
>
|
552 |
-
<
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
ref={fileInputRef}
|
591 |
-
/>
|
592 |
-
</Box>
|
593 |
</Box>
|
594 |
-
|
595 |
-
{/*
|
596 |
<Box position="absolute" right={4} bottom={4}>
|
597 |
<IconButton
|
598 |
-
aria-label="Settings"
|
599 |
size="sm"
|
600 |
variant="ghost"
|
601 |
color="rgba(255, 255, 255, 0.5)"
|
@@ -605,14 +604,14 @@ const App = () => {
|
|
605 |
borderRadius="full"
|
606 |
/>
|
607 |
</Box>
|
608 |
-
|
609 |
{/* Advanced settings panel - collapsible */}
|
610 |
-
<Collapse in={isApiKeyOpen} animateOpacity
|
611 |
<Box
|
612 |
p={5}
|
613 |
-
bg="rgba(
|
614 |
-
|
615 |
-
|
616 |
>
|
617 |
<VStack spacing={4} align="stretch">
|
618 |
<FormControl>
|
@@ -652,7 +651,7 @@ const App = () => {
|
|
652 |
onChange={handleCustomGlifInputChange}
|
653 |
bg="rgba(30, 30, 30, 0.7)"
|
654 |
borderColor="rgba(255, 255, 255, 0.1)"
|
655 |
-
_hover={{ borderColor: "rgba(255, 255, 255,
|
656 |
_focus={{ borderColor: "rgba(255, 255, 255, 0.3)", boxShadow: "none" }}
|
657 |
/>
|
658 |
<InputRightElement width="4.5rem">
|
@@ -703,10 +702,9 @@ const App = () => {
|
|
703 |
<Box
|
704 |
px={5}
|
705 |
py={4}
|
706 |
-
bg="rgba(
|
707 |
-
|
708 |
-
|
709 |
-
borderTopColor="rgba(255, 255, 255, 0.05)"
|
710 |
>
|
711 |
<Flex justify="center" gap={4} wrap="wrap">
|
712 |
<Button
|
@@ -763,7 +761,7 @@ const App = () => {
|
|
763 |
|
764 |
{/* Images Section */}
|
765 |
{uploadedImages.length > 0 && (
|
766 |
-
<Box
|
767 |
<Flex
|
768 |
justify="space-between"
|
769 |
align="center"
|
@@ -771,6 +769,8 @@ const App = () => {
|
|
771 |
cursor="pointer"
|
772 |
py={3}
|
773 |
px={5}
|
|
|
|
|
774 |
_hover={{ bg: "rgba(255, 255, 255, 0.03)" }}
|
775 |
>
|
776 |
<Text fontWeight="medium" color="#e0e0e0">Uploaded Images ({uploadedImages.length})</Text>
|
@@ -920,12 +920,12 @@ const App = () => {
|
|
920 |
</Collapse>
|
921 |
</Box>
|
922 |
)}
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
</
|
928 |
-
</
|
929 |
</Box>
|
930 |
);
|
931 |
};
|
|
|
485 |
minH="100vh"
|
486 |
w="100%"
|
487 |
display="flex"
|
488 |
+
flexDirection="column"
|
489 |
alignItems="center"
|
490 |
justifyContent="center"
|
491 |
+
bg="#000000"
|
492 |
overflow="hidden"
|
493 |
position="relative"
|
494 |
>
|
|
|
499 |
left={0}
|
500 |
right={0}
|
501 |
bottom={0}
|
502 |
+
opacity={0.03}
|
503 |
+
backgroundImage="radial-gradient(circle at 1px 1px, #aaaaaa 1px, transparent 0)"
|
504 |
backgroundSize="40px 40px"
|
505 |
pointerEvents="none"
|
506 |
/>
|
507 |
|
508 |
+
<VStack
|
509 |
+
spacing={4}
|
510 |
+
maxW={{ base: "95%", md: "500px" }}
|
511 |
w="full"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
>
|
513 |
+
{/* Title */}
|
514 |
+
<Heading
|
515 |
+
as="h1"
|
516 |
+
size="2xl"
|
517 |
+
color="#ffffff"
|
518 |
+
textAlign="center"
|
519 |
+
fontWeight="semibold"
|
520 |
+
letterSpacing="-1px"
|
521 |
+
mb={2}
|
522 |
+
>
|
523 |
+
Glif LoRA Autocaption
|
524 |
+
</Heading>
|
525 |
+
|
526 |
+
{/* Main minimalistic drop box container */}
|
527 |
+
<Box
|
528 |
+
w="full"
|
529 |
+
backdropFilter="blur(20px)"
|
530 |
+
bg="rgba(30, 30, 30, 0.65)"
|
531 |
+
borderRadius="2xl"
|
532 |
+
borderWidth="1px"
|
533 |
+
borderColor="rgba(255, 255, 255, 0.1)"
|
534 |
+
boxShadow="0 10px 30px 0 rgba(0, 0, 0, 0.4)"
|
535 |
+
overflow="hidden"
|
536 |
+
position="relative"
|
537 |
+
>
|
538 |
{/* Main Drop Area */}
|
539 |
<Box
|
540 |
w="full"
|
541 |
+
h="200px"
|
542 |
display="flex"
|
543 |
alignItems="center"
|
544 |
justifyContent="center"
|
545 |
cursor="pointer"
|
546 |
transition="all 0.3s"
|
547 |
onClick={() => fileInputRef.current?.click()}
|
548 |
+
p={6}
|
549 |
+
borderBottomWidth={isApiKeyOpen || uploadedImages.length > 0 ? "1px" : "0px"}
|
550 |
+
borderBottomColor="rgba(255, 255, 255, 0.05)"
|
551 |
+
_hover={{
|
552 |
+
bg: "rgba(40, 40, 40, 0.4)",
|
553 |
+
}}
|
554 |
>
|
555 |
+
<VStack spacing={4}>
|
556 |
+
<Box
|
557 |
+
borderWidth="1px"
|
558 |
+
borderRadius="lg"
|
559 |
+
borderStyle="dashed"
|
560 |
+
borderColor="rgba(255, 255, 255, 0.2)"
|
561 |
+
p={6}
|
562 |
+
bg="rgba(20, 20, 20, 0.4)"
|
563 |
+
transition="all 0.3s"
|
564 |
+
_hover={{
|
565 |
+
borderColor: "rgba(255, 255, 255, 0.3)",
|
566 |
+
transform: "scale(1.02)"
|
567 |
+
}}
|
568 |
+
>
|
569 |
+
<VStack spacing={3}>
|
570 |
+
<Text color="#e0e0e0" fontSize="md">Drop images here or click to browse</Text>
|
571 |
+
<Button
|
572 |
+
size="sm"
|
573 |
+
bg="rgba(255, 255, 255, 0.08)"
|
574 |
+
color="white"
|
575 |
+
fontWeight="medium"
|
576 |
+
_hover={{ bg: "rgba(255, 255, 255, 0.15)" }}
|
577 |
+
_active={{ bg: "rgba(255, 255, 255, 0.1)" }}
|
578 |
+
disabled={processing}
|
579 |
+
>
|
580 |
+
Select Files
|
581 |
+
</Button>
|
582 |
+
</VStack>
|
583 |
+
</Box>
|
584 |
+
</VStack>
|
585 |
+
<input
|
586 |
+
type="file"
|
587 |
+
multiple
|
588 |
+
accept="image/*"
|
589 |
+
onChange={handleFileChange}
|
590 |
+
style={{ display: 'none' }}
|
591 |
+
ref={fileInputRef}
|
592 |
+
/>
|
|
|
|
|
|
|
593 |
</Box>
|
594 |
+
|
595 |
+
{/* Toggle button for advanced settings */}
|
596 |
<Box position="absolute" right={4} bottom={4}>
|
597 |
<IconButton
|
|
|
598 |
size="sm"
|
599 |
variant="ghost"
|
600 |
color="rgba(255, 255, 255, 0.5)"
|
|
|
604 |
borderRadius="full"
|
605 |
/>
|
606 |
</Box>
|
607 |
+
|
608 |
{/* Advanced settings panel - collapsible */}
|
609 |
+
<Collapse in={isApiKeyOpen} animateOpacity>
|
610 |
<Box
|
611 |
p={5}
|
612 |
+
bg="rgba(20, 20, 20, 0.5)"
|
613 |
+
borderBottomWidth="1px"
|
614 |
+
borderBottomColor="rgba(255, 255, 255, 0.05)"
|
615 |
>
|
616 |
<VStack spacing={4} align="stretch">
|
617 |
<FormControl>
|
|
|
651 |
onChange={handleCustomGlifInputChange}
|
652 |
bg="rgba(30, 30, 30, 0.7)"
|
653 |
borderColor="rgba(255, 255, 255, 0.1)"
|
654 |
+
_hover={{ borderColor: "rgba(255, 255, 255, 2.2)" }}
|
655 |
_focus={{ borderColor: "rgba(255, 255, 255, 0.3)", boxShadow: "none" }}
|
656 |
/>
|
657 |
<InputRightElement width="4.5rem">
|
|
|
702 |
<Box
|
703 |
px={5}
|
704 |
py={4}
|
705 |
+
bg="rgba(20, 20, 20, 0.5)"
|
706 |
+
borderBottomWidth="1px"
|
707 |
+
borderBottomColor="rgba(255, 255, 255, 0.05)"
|
|
|
708 |
>
|
709 |
<Flex justify="center" gap={4} wrap="wrap">
|
710 |
<Button
|
|
|
761 |
|
762 |
{/* Images Section */}
|
763 |
{uploadedImages.length > 0 && (
|
764 |
+
<Box>
|
765 |
<Flex
|
766 |
justify="space-between"
|
767 |
align="center"
|
|
|
769 |
cursor="pointer"
|
770 |
py={3}
|
771 |
px={5}
|
772 |
+
borderBottomWidth={isImagesOpen ? "1px" : "0px"}
|
773 |
+
borderBottomColor="rgba(255, 255, 255, 0.05)"
|
774 |
_hover={{ bg: "rgba(255, 255, 255, 0.03)" }}
|
775 |
>
|
776 |
<Text fontWeight="medium" color="#e0e0e0">Uploaded Images ({uploadedImages.length})</Text>
|
|
|
920 |
</Collapse>
|
921 |
</Box>
|
922 |
)}
|
923 |
+
</Box>
|
924 |
+
|
925 |
+
<Text fontSize="xs" color="gray.500" textAlign="center">
|
926 |
+
Glif LoRA Autocaption • {new Date().getFullYear()}
|
927 |
+
</Text>
|
928 |
+
</VStack>
|
929 |
</Box>
|
930 |
);
|
931 |
};
|