Files
repomix-mirror/website/client/components/NavBarGitHubStar.vue
Kazuki YamadaandClaude Opus 4.6 0e0011535d fix(website): Add allow-popups-to-escape-sandbox to star button iframe
Without this flag, windows opened by the star button inherit sandbox
restrictions, preventing login and starring on the GitHub page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:45:19 +09:00

50 lines
1.3 KiB
Vue

<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue';
const isDesktop = ref(false);
let mediaQuery: MediaQueryList | null = null;
const updateMatch = (e: MediaQueryListEvent | MediaQueryList) => {
isDesktop.value = e.matches;
};
onMounted(() => {
mediaQuery = window.matchMedia('(min-width: 960px)');
updateMatch(mediaQuery);
mediaQuery.addEventListener('change', updateMatch);
});
onUnmounted(() => {
mediaQuery?.removeEventListener('change', updateMatch);
});
</script>
<template>
<div v-if="isDesktop" class="nav-github-star">
<iframe
title="Star yamadashy/repomix on GitHub"
src="https://unpkg.com/github-buttons@2.29.1/dist/buttons.html#href=https%3A%2F%2Fgithub.com%2Fyamadashy%2Frepomix&data-text=Star&data-size=large&data-show-count=true&data-color-scheme=no-preference%3A+light%3B+light%3A+light%3B+dark%3A+dark%3B"
sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"
scrolling="no"
class="github-star-button"
/>
</div>
</template>
<style scoped>
.nav-github-star {
display: flex;
align-items: center;
justify-content: center;
height: var(--vp-nav-height);
padding: 0 12px;
}
.github-star-button {
width: 130px;
height: 28px;
border: none;
color-scheme: light dark;
}
</style>