w4nn4b3M4ST3R commited on
Commit
5c37085
·
1 Parent(s): 60da674
Files changed (2) hide show
  1. app/static/script.js +15 -14
  2. app/static/styles.css +28 -42
app/static/script.js CHANGED
@@ -898,23 +898,26 @@ function loadCluster(name) {
898
 
899
  document.getElementById("delete-btn").onclick = async () => {
900
  const selectedCards = Array.from(document.querySelectorAll(".thumbnail-card.selected"));
901
-
902
  const paths = selectedCards.map((c) => c.dataset.path);
903
 
904
  if (!paths.length) return alert("Please select images to delete.");
905
- if (!confirm(`Are you sure you want to delete ${paths.length} images?`)) return;
 
906
 
907
  selectedCards.forEach(card => card.classList.add("being-deleted"));
908
 
909
  try {
910
- const res = await fetch(`${API_URL}/delete-images`, {
911
- method: "POST",
912
- headers: { "Content-Type": "application/json" },
913
- body: JSON.stringify({
914
- session_id: currentSessionId,
915
- image_paths: paths,
916
- }),
917
- });
 
 
 
918
 
919
  if (!res.ok) {
920
  const errData = await res.json();
@@ -923,8 +926,6 @@ document.getElementById("delete-btn").onclick = async () => {
923
 
924
  const data = await res.json();
925
 
926
- await new Promise(resolve => setTimeout(resolve, 800));
927
-
928
  selectedCards.forEach(card => card.remove());
929
 
930
  if (currentClusterName && currentGroups[currentClusterName]) {
@@ -932,11 +933,11 @@ document.getElementById("delete-btn").onclick = async () => {
932
  }
933
 
934
  syncUniverseMap(data.deleted);
935
- renderClusterList();
936
 
937
  } catch (e) {
 
938
  selectedCards.forEach(card => card.classList.remove("being-deleted"));
939
- alert("Error during deletion: " + e.message);
940
  }
941
  };
942
 
 
898
 
899
  document.getElementById("delete-btn").onclick = async () => {
900
  const selectedCards = Array.from(document.querySelectorAll(".thumbnail-card.selected"));
 
901
  const paths = selectedCards.map((c) => c.dataset.path);
902
 
903
  if (!paths.length) return alert("Please select images to delete.");
904
+
905
+ if (!confirm(`Initialize deletion sequence for ${paths.length} targets?`)) return;
906
 
907
  selectedCards.forEach(card => card.classList.add("being-deleted"));
908
 
909
  try {
910
+ const [res, _] = await Promise.all([
911
+ fetch(`${API_URL}/delete-images`, {
912
+ method: "POST",
913
+ headers: { "Content-Type": "application/json" },
914
+ body: JSON.stringify({
915
+ session_id: currentSessionId,
916
+ image_paths: paths,
917
+ }),
918
+ }),
919
+ new Promise(resolve => setTimeout(resolve, 800))
920
+ ]);
921
 
922
  if (!res.ok) {
923
  const errData = await res.json();
 
926
 
927
  const data = await res.json();
928
 
 
 
929
  selectedCards.forEach(card => card.remove());
930
 
931
  if (currentClusterName && currentGroups[currentClusterName]) {
 
933
  }
934
 
935
  syncUniverseMap(data.deleted);
 
936
 
937
  } catch (e) {
938
+ console.error(e);
939
  selectedCards.forEach(card => card.classList.remove("being-deleted"));
940
+ alert("Anomaly Detected: " + e.message);
941
  }
942
  };
943
 
app/static/styles.css CHANGED
@@ -161,7 +161,7 @@ body {
161
  .thumbnail-card.selected {
162
  border-color: #8b5cf6;
163
  background-color: rgba(139, 92, 246, 0.1);
164
- ring: 1px solid #8b5cf6;
165
  }
166
  .thumbnail-card.best-quality {
167
  border: 2px solid #10b981;
@@ -803,41 +803,41 @@ body {
803
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
804
  }
805
 
806
- @keyframes vortex-spin {
807
  0% {
808
  transform: scale(1) rotate(0deg);
809
- filter: brightness(1) hue-rotate(0deg) blur(0px);
810
- border-radius: 4px;
811
- box-shadow: 0 0 0 transparent;
812
- }
813
- 20% {
814
- transform: scale(1.05) rotate(-5deg);
815
- filter: brightness(1.2) contrast(1.2);
816
- box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
817
  }
818
  40% {
819
- transform: scale(0.8) rotate(45deg);
820
- border-radius: 50%;
821
- filter: brightness(1.5) hue-rotate(45deg) blur(2px);
822
- background-color: #000;
823
  }
824
  100% {
825
- transform: scale(0) rotate(1080deg);
826
  opacity: 0;
827
- border-radius: 50%;
828
- filter: brightness(3) hue-rotate(180deg) blur(4px);
829
- box-shadow: inset 0 0 20px #8b5cf6, 0 0 50px #8b5cf6;
830
  }
831
  }
832
 
833
  .thumbnail-card.being-deleted {
834
  position: relative;
835
- z-index: 50;
836
  pointer-events: none;
837
- animation: vortex-spin 0.8s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
838
 
839
- background: black !important;
840
  border: none !important;
 
 
 
 
 
 
 
 
 
 
 
841
  }
842
 
843
  .thumbnail-card.being-deleted::after {
@@ -845,32 +845,18 @@ body {
845
  position: absolute;
846
  top: 50%;
847
  left: 50%;
848
- width: 10%;
849
- height: 10%;
850
  background: black;
851
  border-radius: 50%;
852
  transform: translate(-50%, -50%);
853
- box-shadow: 0 0 10px 5px rgba(139, 92, 246, 0.8);
854
  z-index: 60;
855
- animation: singularity-grow 0.8s ease-in forwards;
856
  }
857
 
858
- @keyframes singularity-grow {
859
  0% { width: 0%; height: 0%; opacity: 0; }
860
- 50% { opacity: 1; }
861
- 100% { width: 120%; height: 120%; opacity: 0; }
862
- }
863
-
864
- .thumbnail-card.being-deleted input,
865
- .thumbnail-card.being-deleted .quality-badge,
866
- .thumbnail-card.being-deleted .best-badge,
867
- .thumbnail-card.being-deleted .text-\[10px\] {
868
- display: none;
869
- }
870
-
871
- .thumbnail-card.being-deleted img {
872
- object-fit: cover !important;
873
- width: 100%;
874
- height: 100%;
875
- border-radius: 50%;
876
  }
 
161
  .thumbnail-card.selected {
162
  border-color: #8b5cf6;
163
  background-color: rgba(139, 92, 246, 0.1);
164
+ box-shadow: 0 0 0 1px #8b5cf6;
165
  }
166
  .thumbnail-card.best-quality {
167
  border: 2px solid #10b981;
 
803
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
804
  }
805
 
806
+ @keyframes vortex-implode {
807
  0% {
808
  transform: scale(1) rotate(0deg);
809
+ filter: brightness(1) contrast(1);
810
+ opacity: 1;
 
 
 
 
 
 
811
  }
812
  40% {
813
+ transform: scale(0.9) rotate(-10deg);
814
+ filter: brightness(1.5) hue-rotate(90deg);
 
 
815
  }
816
  100% {
817
+ transform: scale(0) rotate(720deg);
818
  opacity: 0;
819
+ filter: brightness(0);
 
 
820
  }
821
  }
822
 
823
  .thumbnail-card.being-deleted {
824
  position: relative;
 
825
  pointer-events: none;
826
+ animation: vortex-implode 0.8s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
827
 
828
+ background: transparent !important;
829
  border: none !important;
830
+ box-shadow: none !important;
831
+ z-index: 50;
832
+ }
833
+
834
+ .thumbnail-card.being-deleted input,
835
+ .thumbnail-card.being-deleted .quality-badge,
836
+ .thumbnail-card.being-deleted .best-badge,
837
+ .thumbnail-card.being-deleted .text-\[10px\],
838
+ .thumbnail-card.being-deleted .impact-badge {
839
+ opacity: 0;
840
+ transition: opacity 0.2s;
841
  }
842
 
843
  .thumbnail-card.being-deleted::after {
 
845
  position: absolute;
846
  top: 50%;
847
  left: 50%;
848
+ width: 0%;
849
+ height: 0%;
850
  background: black;
851
  border-radius: 50%;
852
  transform: translate(-50%, -50%);
853
+ box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.9), inset 0 0 10px #fff;
854
  z-index: 60;
855
+ animation: singularity-expand 0.8s ease-out forwards;
856
  }
857
 
858
+ @keyframes singularity-expand {
859
  0% { width: 0%; height: 0%; opacity: 0; }
860
+ 50% { opacity: 1; width: 40%; height: 40%; }
861
+ 100% { width: 0%; height: 0%; opacity: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
862
  }