diff --git a/website/client/components/Home/TryItResultContent.vue b/website/client/components/Home/TryItResultContent.vue index 9c3d051..891821f 100644 --- a/website/client/components/Home/TryItResultContent.vue +++ b/website/client/components/Home/TryItResultContent.vue @@ -31,6 +31,9 @@ const shared = ref(false); const canShare = ref(canShareFiles()); const { isDark } = useData(); const editorInstance = ref(null); +const isMobile = ref(false); +const tooltipContainer = ref(null); +const tooltipContent = ref(null); const editorOptions = computed(() => ({ ...getEditorOptions(), @@ -85,6 +88,17 @@ const handleEditorMount = (editor: Ace.Editor) => { editorInstance.value = editor; }; +const updateTooltipPosition = () => { + if (!tooltipContainer.value || !tooltipContent.value || isMobile.value) return; + + const containerRect = tooltipContainer.value.getBoundingClientRect(); + const tooltipEl = tooltipContent.value; + + // Position above the button with proper spacing for the arrow (like existing tooltips) + tooltipEl.style.top = `${containerRect.top - 46}px`; + tooltipEl.style.left = `${containerRect.left + containerRect.width / 2}px`; +}; + const messages = [ { type: 'sponsor', @@ -110,6 +124,20 @@ const supportMessage = computed(() => ({ text: messages[currentMessageIndex.value].text, color: messages[currentMessageIndex.value].color, })); + +onMounted(() => { + isMobile.value = window.innerWidth <= 768; + + const handleResize = () => { + isMobile.value = window.innerWidth <= 768; + }; + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + }; +});