mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-07 15:31:00 +08:00
fix(frontend): hide downloads and views for now while they are broken, rewrite the whole system later
This commit is contained in:
parent
c89f388339
commit
00d48c562f
51
frontend/src/lib/components/design/ComingSoon.vue
Normal file
51
frontend/src/lib/components/design/ComingSoon.vue
Normal file
@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<span class="coming-soon" title="Coming soon">
|
||||
<render />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { VNode, computed, useSlots } from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
short?: boolean;
|
||||
}>();
|
||||
|
||||
const slot = useSlots();
|
||||
|
||||
const content = computed(() => {
|
||||
const slotContent = slot?.default?.();
|
||||
if (!slotContent) return;
|
||||
for (const vnode of slotContent) {
|
||||
replace(vnode);
|
||||
}
|
||||
return slotContent;
|
||||
});
|
||||
|
||||
function replace(vnode: VNode) {
|
||||
if (vnode.type.toString() === "Symbol(Text)") {
|
||||
vnode.children = props.short ? "[R]" : "[REDACTED]";
|
||||
}
|
||||
}
|
||||
|
||||
const render = () => {
|
||||
return content.value;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.coming-soon {
|
||||
--blur-color: #6695f2;
|
||||
color: transparent;
|
||||
display: inherit;
|
||||
text-shadow: 0 0 12px var(--blur-color);
|
||||
|
||||
svg {
|
||||
color: var(--blur-color);
|
||||
filter: blur(4px);
|
||||
}
|
||||
}
|
||||
.text-right .coming-soon {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user