umar8902 commited on
Commit
0c67ab9
·
verified ·
1 Parent(s): f58ed8e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +241 -19
index.html CHANGED
@@ -861,6 +861,115 @@
861
  height: 100vh;
862
  }
863
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
864
  .chat-history {
865
  flex: 1;
866
  overflow-y: auto;
@@ -4520,9 +4629,11 @@
4520
  <!-- Main Area -->
4521
  <main class="main-area hero-mode">
4522
  <div class="main-background-lighting">
4523
- <div class="ambient-glow glow-1"></div>
4524
- <div class="ambient-glow glow-2"></div>
4525
- </div>
 
 
4526
 
4527
  <div id="memoryIndicator" class="memory-indicator">
4528
  <i data-lucide="brain"></i>
@@ -7511,25 +7622,49 @@
7511
 
7512
  function handleRouting() {
7513
  const path = window.location.pathname;
 
7514
 
7515
- // Protected routes
7516
- if (path === '/chat' && !currentUser) {
7517
- window.history.pushState({}, '', '/login');
7518
- renderLogin();
7519
- return;
7520
- }
7521
-
7522
- if ((path === '/login' || path === '/signup') && currentUser) {
7523
- window.history.pushState({}, '', '/chat');
7524
- renderChat();
7525
- return;
7526
  }
7527
 
7528
- const renderFunc = routes[path] || renderLanding;
7529
- renderFunc();
7530
-
7531
- if (window.innerWidth <= 768) {
7532
- sidebar?.classList.remove('open');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7533
  }
7534
  }
7535
 
@@ -8517,6 +8652,91 @@
8517
  setTimeout(triggerLightning, Math.random() * 8000 + 4000);
8518
  }
8519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8520
  // Initialize
8521
  window.addEventListener('DOMContentLoaded', async () => {
8522
  try {
@@ -8538,6 +8758,8 @@
8538
  // 3. Start animations
8539
  setTimeout(typeEffect, 1000);
8540
  setTimeout(triggerLightning, 3000);
 
 
8541
 
8542
  refreshIcons();
8543
 
 
861
  height: 100vh;
862
  }
863
 
864
+ /* --- 3D World & Advanced Animations --- */
865
+ :root {
866
+ --3d-perspective: 1200px;
867
+ --3d-tilt-intensity: 15deg;
868
+ --transition-smooth: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
869
+ }
870
+
871
+ body {
872
+ perspective: var(--3d-perspective);
873
+ transform-style: preserve-3d;
874
+ }
875
+
876
+ .main-area {
877
+ transform-style: preserve-3d;
878
+ transition: var(--transition-smooth);
879
+ }
880
+
881
+ /* 3D Glassmorphism Cards */
882
+ .suggestion-card, .feature-item, .image-card, .tool-output-card {
883
+ position: relative;
884
+ transform-style: preserve-3d;
885
+ transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
886
+ will-change: transform;
887
+ }
888
+
889
+ .suggestion-card:hover, .feature-item:hover {
890
+ transform: translateZ(20px) rotateX(2deg) rotateY(-2deg);
891
+ box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--glass-border);
892
+ }
893
+
894
+ /* 3D Floating Particles Background */
895
+ #canvas3d {
896
+ position: fixed;
897
+ top: 0;
898
+ left: 0;
899
+ width: 100%;
900
+ height: 100%;
901
+ z-index: -1;
902
+ pointer-events: none;
903
+ opacity: 0.6;
904
+ }
905
+
906
+ /* Page Transition Animations */
907
+ .page-fade-enter {
908
+ opacity: 0;
909
+ transform: scale(0.98) translateZ(-50px);
910
+ }
911
+
912
+ .page-fade-exit {
913
+ opacity: 0;
914
+ transform: scale(1.02) translateZ(50px);
915
+ }
916
+
917
+ .transitioning {
918
+ pointer-events: none;
919
+ filter: blur(4px);
920
+ transition: var(--transition-smooth);
921
+ }
922
+
923
+ /* Smooth 3D Button Micro-interactions */
924
+ .send-button, .action-btn, .new-chat-btn {
925
+ transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
926
+ }
927
+
928
+ .send-button:hover, .action-btn:hover {
929
+ transform: translateY(-2px) scale(1.05);
930
+ box-shadow: 0 5px 15px rgba(16, 163, 127, 0.3);
931
+ }
932
+
933
+ .send-button:active {
934
+ transform: translateY(0) scale(0.95);
935
+ }
936
+
937
+ /* High-Performance 3D Grid Overlay */
938
+ .grid-overlay {
939
+ position: fixed;
940
+ top: 0;
941
+ left: 0;
942
+ width: 100%;
943
+ height: 100%;
944
+ background-image: linear-gradient(var(--glass-border) 1px, transparent 1px),
945
+ linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
946
+ background-size: 50px 50px;
947
+ perspective: 500px;
948
+ transform: rotateX(60deg) translateY(-50%) translateZ(-200px);
949
+ opacity: 0.05;
950
+ z-index: -1;
951
+ mask-image: radial-gradient(circle at center, black, transparent 80%);
952
+ pointer-events: none;
953
+ }
954
+
955
+ /* Smooth Chat Entrance */
956
+ .message {
957
+ transform-origin: left center;
958
+ animation: messageAppear3d 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
959
+ opacity: 0;
960
+ }
961
+
962
+ @keyframes messageAppear3d {
963
+ 0% {
964
+ opacity: 0;
965
+ transform: translateX(-20px) rotateY(-15deg) scale(0.95);
966
+ }
967
+ 100% {
968
+ opacity: 1;
969
+ transform: translateX(0) rotateY(0) scale(1);
970
+ }
971
+ }
972
+
973
  .chat-history {
974
  flex: 1;
975
  overflow-y: auto;
 
4629
  <!-- Main Area -->
4630
  <main class="main-area hero-mode">
4631
  <div class="main-background-lighting">
4632
+ <div class="ambient-glow glow-1"></div>
4633
+ <div class="ambient-glow glow-2"></div>
4634
+ <div class="grid-overlay"></div>
4635
+ <canvas id="canvas3d"></canvas>
4636
+ </div>
4637
 
4638
  <div id="memoryIndicator" class="memory-indicator">
4639
  <i data-lucide="brain"></i>
 
7622
 
7623
  function handleRouting() {
7624
  const path = window.location.pathname;
7625
+ const mainArea = document.querySelector('.main-area');
7626
 
7627
+ // Add transition effect
7628
+ if (mainArea) {
7629
+ mainArea.classList.add('transitioning');
7630
+ mainArea.style.opacity = '0';
7631
+ mainArea.style.transform = 'scale(0.98) translateZ(-50px)';
 
 
 
 
 
 
7632
  }
7633
 
7634
+ setTimeout(() => {
7635
+ // Protected routes
7636
+ if (path === '/chat' && !currentUser) {
7637
+ window.history.pushState({}, '', '/login');
7638
+ renderLogin();
7639
+ finishTransition();
7640
+ return;
7641
+ }
7642
+
7643
+ if ((path === '/login' || path === '/signup') && currentUser) {
7644
+ window.history.pushState({}, '', '/chat');
7645
+ renderChat();
7646
+ finishTransition();
7647
+ return;
7648
+ }
7649
+
7650
+ const renderFunc = routes[path] || renderLanding;
7651
+ renderFunc();
7652
+
7653
+ if (window.innerWidth <= 768) {
7654
+ sidebar?.classList.remove('open');
7655
+ }
7656
+ finishTransition();
7657
+ }, 300);
7658
+ }
7659
+
7660
+ function finishTransition() {
7661
+ const mainArea = document.querySelector('.main-area');
7662
+ if (mainArea) {
7663
+ setTimeout(() => {
7664
+ mainArea.classList.remove('transitioning');
7665
+ mainArea.style.opacity = '1';
7666
+ mainArea.style.transform = 'scale(1) translateZ(0)';
7667
+ }, 50);
7668
  }
7669
  }
7670
 
 
8652
  setTimeout(triggerLightning, Math.random() * 8000 + 4000);
8653
  }
8654
 
8655
+ // --- 3D Background System ---
8656
+ function init3DBackground() {
8657
+ const canvas = document.getElementById('canvas3d');
8658
+ if (!canvas) return;
8659
+ const ctx = canvas.getContext('2d');
8660
+ let w, h;
8661
+ const particles = [];
8662
+ const particleCount = 60;
8663
+
8664
+ function resize() {
8665
+ w = canvas.width = window.innerWidth;
8666
+ h = canvas.height = window.innerHeight;
8667
+ }
8668
+
8669
+ class Particle {
8670
+ constructor() {
8671
+ this.reset();
8672
+ }
8673
+ reset() {
8674
+ this.x = Math.random() * w;
8675
+ this.y = Math.random() * h;
8676
+ this.z = Math.random() * 1000;
8677
+ this.size = 1 + Math.random() * 2;
8678
+ this.speed = 0.5 + Math.random() * 1.5;
8679
+ this.vx = (Math.random() - 0.5) * 0.5;
8680
+ this.vy = (Math.random() - 0.5) * 0.5;
8681
+ }
8682
+ update() {
8683
+ this.z -= this.speed;
8684
+ this.x += this.vx;
8685
+ this.y += this.vy;
8686
+ if (this.z <= 0) this.reset();
8687
+ }
8688
+ draw() {
8689
+ const scale = 500 / (500 + this.z);
8690
+ const x2d = (this.x - w / 2) * scale + w / 2;
8691
+ const y2d = (this.y - h / 2) * scale + h / 2;
8692
+ const opacity = Math.min(1, (1000 - this.z) / 800) * 0.3;
8693
+
8694
+ ctx.fillStyle = `rgba(16, 163, 127, ${opacity})`;
8695
+ ctx.beginPath();
8696
+ ctx.arc(x2d, y2d, this.size * scale, 0, Math.PI * 2);
8697
+ ctx.fill();
8698
+ }
8699
+ }
8700
+
8701
+ for (let i = 0; i < particleCount; i++) particles.push(new Particle());
8702
+
8703
+ function animate() {
8704
+ ctx.clearRect(0, 0, w, h);
8705
+ particles.forEach(p => {
8706
+ p.update();
8707
+ p.draw();
8708
+ });
8709
+ requestAnimationFrame(animate);
8710
+ }
8711
+
8712
+ window.addEventListener('resize', resize);
8713
+ resize();
8714
+ animate();
8715
+ }
8716
+
8717
+ // --- 3D Card Tilt Effect ---
8718
+ function init3DTilt() {
8719
+ document.addEventListener('mousemove', e => {
8720
+ const cards = document.querySelectorAll('.suggestion-card, .feature-item');
8721
+ cards.forEach(card => {
8722
+ const rect = card.getBoundingClientRect();
8723
+ const x = e.clientX - rect.left;
8724
+ const y = e.clientY - rect.top;
8725
+
8726
+ if (x > 0 && x < rect.width && y > 0 && y < rect.height) {
8727
+ const centerX = rect.width / 2;
8728
+ const centerY = rect.height / 2;
8729
+ const rotateX = (y - centerY) / 10;
8730
+ const rotateY = (centerX - x) / 10;
8731
+
8732
+ card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) translateZ(10px)`;
8733
+ } else {
8734
+ card.style.transform = '';
8735
+ }
8736
+ });
8737
+ });
8738
+ }
8739
+
8740
  // Initialize
8741
  window.addEventListener('DOMContentLoaded', async () => {
8742
  try {
 
8758
  // 3. Start animations
8759
  setTimeout(typeEffect, 1000);
8760
  setTimeout(triggerLightning, 3000);
8761
+ init3DBackground();
8762
+ init3DTilt();
8763
 
8764
  refreshIcons();
8765