From 39e6100d2f3cd8970115dd3fc71207369d617cf3 Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Sun, 8 Jun 2025 12:09:40 +0900 Subject: [PATCH 1/8] feat(website): Show "Open with your app" button on desktop with tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Display the share button on both desktop and mobile devices - Add tooltip on desktop showing "Only available on mobile devices" - Disable button on desktop (non-mobile) devices - Use position: fixed to avoid parent overflow: hidden issues - Match existing tooltip design (TryItPackOptions) for consistency - Support both light and dark modes with #333 background 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../components/Home/TryItResultContent.vue | 126 ++++++++++++++++-- 1 file changed, 116 insertions(+), 10 deletions(-) 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); + }; +});