@@ -515,7 +515,7 @@ <h3 class="text-lg font-semibold text-white mb-2">Analysis Failed</h3>
515515 < span > by</ span >
516516 < a href ="https://amanulla.in/ " target ="_blank " rel ="noopener noreferrer " class ="text-[#60a5fa] hover:text-white transition-colors font-medium "> Aman Ulla</ a >
517517 < span > ,</ span >
518- < a href ="# " target ="_blank " rel ="noopener noreferrer " class ="text-[#60a5fa] hover:text-white transition-colors font-medium "> Srinivas Alva</ a >
518+ < a href ="https://www.linkedin.com/in/srinivasalva/ " target ="_blank " rel ="noopener noreferrer " class ="text-[#60a5fa] hover:text-white transition-colors font-medium "> Srinivas Alva</ a >
519519 < span class ="text-white/40 "> |</ span >
520520 < a href ="https://vision.hack2skill.com/event/genaiexchangehackathon/?utm_source=hack2skill&utm_medium=homepage#overview " target ="_blank " rel ="noopener noreferrer " class ="text-[#60a5fa] hover:text-white transition-colors "> Hack2Skill‑Google Hackathon</ a >
521521 </ div >
@@ -554,6 +554,38 @@ <h3 class="text-lg font-semibold text-white">Navigation</h3>
554554 </ div >
555555 </ div >
556556
557+ <!-- Footer Hover with Delay Script -->
558+ < script >
559+ // Footer hover functionality with delay
560+ ( function ( ) {
561+ const footer = document . querySelector ( 'footer' ) ;
562+ const footerCircle = document . querySelector ( '.footer-circle' ) ;
563+ const footerExpanded = document . querySelector ( '.footer-expanded' ) ;
564+ let hideTimeout = null ;
565+
566+ function showFooter ( ) {
567+ if ( hideTimeout ) {
568+ clearTimeout ( hideTimeout ) ;
569+ hideTimeout = null ;
570+ }
571+ if ( footerExpanded ) footerExpanded . classList . add ( 'show' ) ;
572+ if ( footerCircle ) footerCircle . classList . add ( 'hover' ) ;
573+ }
574+
575+ function hideFooter ( ) {
576+ hideTimeout = setTimeout ( ( ) => {
577+ if ( footerExpanded ) footerExpanded . classList . remove ( 'show' ) ;
578+ if ( footerCircle ) footerCircle . classList . remove ( 'hover' ) ;
579+ } , 600 ) ; // 600ms delay before hiding
580+ }
581+
582+ if ( footer ) {
583+ footer . addEventListener ( 'mouseenter' , showFooter ) ;
584+ footer . addEventListener ( 'mouseleave' , hideFooter ) ;
585+ }
586+ } ) ( ) ;
587+ </ script >
588+
557589 <!-- Mobile Menu JavaScript -->
558590 < script >
559591 // Mobile menu functionality
@@ -642,6 +674,18 @@ <h3 class="text-lg font-semibold text-white">Navigation</h3>
642674 } ) ;
643675 }
644676
677+ // Function to toggle AI recommendation button visibility
678+ function toggleAiRecommendationButton ( hasInvestments ) {
679+ const aiBtn = document . getElementById ( 'aiRecommendationBtn' ) ;
680+ if ( aiBtn ) {
681+ if ( hasInvestments ) {
682+ aiBtn . classList . remove ( 'hidden' ) ;
683+ } else {
684+ aiBtn . classList . add ( 'hidden' ) ;
685+ }
686+ }
687+ }
688+
645689 // Generate AI recommendations
646690 async function generateAiRecommendations ( ) {
647691 try {
@@ -792,6 +836,26 @@ <h5 class="text-white font-medium mb-2">${suggestion.title || `Suggestion ${inde
792836 return 'bg-gray-500/20 text-gray-400 border border-gray-500/30' ;
793837 }
794838 }
839+
840+ // Initialize AI button visibility on page load
841+ window . addEventListener ( 'DOMContentLoaded' , async ( ) => {
842+ const investments = await getAllInvestments ( ) ;
843+ toggleAiRecommendationButton ( investments . length > 0 ) ;
844+ } ) ;
845+
846+ // Observer to watch for investment changes
847+ const investmentsGrid = document . getElementById ( 'investmentsGrid' ) ;
848+ const emptyState = document . getElementById ( 'emptyState' ) ;
849+
850+ if ( investmentsGrid && emptyState ) {
851+ const observer = new MutationObserver ( async ( ) => {
852+ const investments = await getAllInvestments ( ) ;
853+ toggleAiRecommendationButton ( investments . length > 0 ) ;
854+ } ) ;
855+
856+ observer . observe ( investmentsGrid , { childList : true , subtree : true } ) ;
857+ observer . observe ( emptyState , { attributes : true , attributeFilter : [ 'class' ] } ) ;
858+ }
795859 </ script >
796860 </ body >
797861</ html >
0 commit comments