v1.3.1: 어나운스 바·가입 금지 닉네임·설정 UI 개선
공개 상단 어나운스 바와 관리자 맞춤 설정을 추가하고, 스팸 필터에서 가입 금지 닉네임을 관리·검증한다. POST 설정 읽기 모드 비활성 토글과 설정 내비 아이콘 틀을 반영한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
48
components/site/SiteTopChrome.vue
Normal file
48
components/site/SiteTopChrome.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<script setup>
|
||||
let resizeObserver = null
|
||||
|
||||
/**
|
||||
* 상단 크롬(어나운스 바·헤더) 높이를 CSS 변수로 반영한다.
|
||||
* @returns {void}
|
||||
*/
|
||||
const syncTopChromeHeight = () => {
|
||||
if (!import.meta.client) {
|
||||
return
|
||||
}
|
||||
|
||||
const chrome = document.querySelector('.site-top-chrome')
|
||||
const height = chrome instanceof HTMLElement ? chrome.offsetHeight : 57
|
||||
document.documentElement.style.setProperty('--site-top-chrome-height', `${height}px`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
syncTopChromeHeight()
|
||||
window.addEventListener('resize', syncTopChromeHeight)
|
||||
|
||||
const chrome = document.querySelector('.site-top-chrome')
|
||||
if (chrome instanceof HTMLElement && typeof ResizeObserver !== 'undefined') {
|
||||
resizeObserver = new ResizeObserver(() => {
|
||||
syncTopChromeHeight()
|
||||
})
|
||||
resizeObserver.observe(chrome)
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (!import.meta.client) {
|
||||
return
|
||||
}
|
||||
|
||||
window.removeEventListener('resize', syncTopChromeHeight)
|
||||
resizeObserver?.disconnect()
|
||||
resizeObserver = null
|
||||
document.documentElement.style.removeProperty('--site-top-chrome-height')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="site-top-chrome sticky top-0 z-20 shrink-0">
|
||||
<SiteAnnouncementBar />
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user