saq1b commited on
Commit
5a2fa3d
·
1 Parent(s): 1629d3f

refactor(App.jsx): improve layout and styling for enhanced user interaction

Browse files
Files changed (1) hide show
  1. 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="black"
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.02}
502
- backgroundImage="radial-gradient(circle at 1px 1px, #666666 1px, transparent 0)"
503
  backgroundSize="40px 40px"
504
  pointerEvents="none"
505
  />
506
 
507
- {/* Single container with everything */}
508
- <Box
509
- maxW={{ base: "90%", md: "450px" }}
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 and Main Area */}
521
- <VStack spacing={0} w="full">
522
- <Box
523
- w="full"
524
- pt={8}
525
- pb={4}
526
- px={6}
527
- textAlign="center"
528
- >
529
- <Heading
530
- as="h1"
531
- size="lg"
532
- color="white"
533
- fontWeight="semibold"
534
- letterSpacing="tight"
535
- >
536
- Glif LoRA Autocaption
537
- </Heading>
538
- </Box>
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
- px={6}
550
- pb={6}
 
 
 
 
551
  >
552
- <Box
553
- w="full"
554
- h="160px"
555
- borderWidth="1px"
556
- borderRadius="xl"
557
- borderStyle="dashed"
558
- borderColor="rgba(255, 255, 255, 0.2)"
559
- display="flex"
560
- alignItems="center"
561
- justifyContent="center"
562
- bg="rgba(20, 20, 20, 0.3)"
563
- transition="all 0.3s"
564
- _hover={{
565
- bg: "rgba(30, 30, 30, 0.5)",
566
- borderColor: "rgba(255, 255, 255, 0.3)",
567
- transform: "translateY(-1px)"
568
- }}
569
- >
570
- <VStack spacing={3}>
571
- <Text color="#e0e0e0" fontSize="md">Drop images here or click to browse</Text>
572
- <Button
573
- size="sm"
574
- bg="rgba(255, 255, 255, 0.08)"
575
- color="white"
576
- fontWeight="medium"
577
- _hover={{ bg: "rgba(255, 255, 255, 0.15)" }}
578
- _active={{ bg: "rgba(255, 255, 255, 0.1)" }}
579
- disabled={processing}
580
- >
581
- Select Files
582
- </Button>
583
- </VStack>
584
- <input
585
- type="file"
586
- multiple
587
- accept="image/*"
588
- onChange={handleFileChange}
589
- style={{ display: 'none' }}
590
- ref={fileInputRef}
591
- />
592
- </Box>
593
  </Box>
594
-
595
- {/* Settings icon */}
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 style={{ width: '100%' }}>
611
  <Box
612
  p={5}
613
- bg="rgba(24, 24, 26, 0.8)"
614
- borderTopWidth="1px"
615
- borderTopColor="rgba(255, 255, 255, 0.05)"
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, 0.2)" }}
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(22, 22, 24, 0.8)"
707
- w="full"
708
- borderTopWidth="1px"
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 w="full" borderTopWidth={isImagesOpen ? "1px" : "0px"} borderTopColor="rgba(255, 255, 255, 0.05)">
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
- <Text fontSize="xs" color="gray.500" textAlign="center" py={2}>
925
- Glif LoRA Autocaption • {new Date().getFullYear()}
926
- </Text>
927
- </VStack>
928
- </Box>
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
  };