Skip to content

Commit

Permalink
fix: hack in a close button into the crowdin modal... (closes #1366)
Browse files Browse the repository at this point in the history
why this isn't a standard feature is beyond me
  • Loading branch information
MiniDigger committed Jul 7, 2024
1 parent 79db463 commit 89e3310
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/composables/useSeo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export function useSeo(
},
{
type: "text/javascript",
defer: true,
src: "https://cdn.crowdin.com/jipt/jipt.js",
}
);
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<script setup lang="ts">
const route = useRoute();
const i18n = useI18n();
function fixCrowdin() {
document.documentElement.classList.remove("jipt-no-scroll");
document.body.classList.remove("jipt-highlight");
document.getElementById("crowdin-jipt-mask")?.remove();
document.getElementById("jipt-modal-mask")?.remove();
// eslint-disable-next-line unicorn/no-array-for-each
document.querySelectorAll(".crowdin-jipt")?.forEach((e) => e.remove());
}
</script>

<template>
Expand All @@ -12,5 +22,21 @@ const route = useRoute();
</Container>
<Notifications />
<Footer />
<button v-if="i18n.locale.value === 'dum'" class="crowdin-fix" aria-hidden="true" @click="fixCrowdin">✖</button>
</main>
</template>

<style lang="scss" scoped>
.crowdin-fix {
display: none;
}
.jipt-no-scroll .crowdin-fix {
position: absolute;
display: block;
top: 10px;
right: 10px;
z-index: 1000000000000000000;
color: black;
font-size: 26px;
}
</style>

0 comments on commit 89e3310

Please sign in to comment.