initial: bootstrap from BukidBountyApp base

This commit is contained in:
Jonathan Sykes
2026-06-06 18:43:00 +08:00
commit eb4a5731fb
5674 changed files with 160857 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
<template>
<div class="bottom-navigation-bar">
<div class="tf-container">
<ul class="tf-navigation-bar" :style="{ background: uiStore.darkMode ? 'transparent' : '' }">
<li>
<a class="nav-item-link" href="#" @click.prevent="navigate('Home')" @mouseenter="prefetch('Home')" @touchstart.passive="prefetch('Home')">
<i class="fas fa-home"></i>
<span>Home</span>
</a>
</li>
<li v-if="uiStore.isModuleEnabled('cart')">
<a class="nav-item-link" href="#" @click.prevent="navigate('CartProductMarket')" @mouseenter="prefetch('CartProductMarket')" @touchstart.passive="prefetch('CartProductMarket')">
<img src="https://cdn.jsdelivr.net/gh/telemagnadon/obj-vault-3a@v2026.05.14-vendor-2/a/d36eb6a17e27.bin" alt="Cart" class="nav-icon">
<span>Cart</span>
</a>
</li>
<li>
<a class="nav-item-link" href="#" @click.prevent="navigate('MyWallet')" @mouseenter="prefetch('MyWallet')" @touchstart.passive="prefetch('MyWallet')">
<img src="https://cdn.jsdelivr.net/gh/telemagnadon/obj-vault-3a@v2026.05.14-vendor-2/a/9908be28dd8a.bin" alt="Wallet" class="nav-icon spinning-on-hover">
<span>Wallet</span>
</a>
</li>
<li v-if="['tandem','ngo'].includes(uiStore.app_mode)">
<a class="nav-item-link" href="#" @click.prevent="navigate('CooperativeHub')" @mouseenter="prefetch('CooperativeHub')" @touchstart.passive="prefetch('CooperativeHub')">
<i class="fas fa-landmark"></i>
<span>Hub</span>
</a>
</li>
<li v-if="uiStore.isModuleEnabled('properties')">
<a class="nav-item-link" href="#" @click.prevent="navigate('ListProperties')" @mouseenter="prefetch('ListProperties')" @touchstart.passive="prefetch('ListProperties')">
<img src="https://cdn.jsdelivr.net/gh/telemagnadon/obj-vault-3a@v2026.05.14-vendor-2/a/53c45417d1d1.bin" alt="Properties" class="nav-icon">
<span>Properties</span>
</a>
</li>
</ul>
</div>
</div>
</template>
<script setup>
import { useUIStore } from '../../../stores/ui';
const uiStore = useUIStore();
const navigate = (page) => {
if (window.$navigateHelper) {
window.$navigateHelper({ page });
} else {
console.warn('Global $navigate function not found.');
}
};
const prefetch = (page) => {
if (window.$prefetchPage) window.$prefetchPage(page);
};
</script>
<style scoped>
.bottom-navigation-bar {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: var(--layout-max-width, 1440px);
z-index: 9999;
background-color: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
border-top: 1px solid rgba(0, 0, 0, 0.08);
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
padding: 10px 0 env(safe-area-inset-bottom, 10px);
transition: all 0.3s ease;
}
:global(body.is-full-width) .bottom-navigation-bar {
max-width: none !important;
}
:global(.dark-mode) .bottom-navigation-bar {
background-color: var(--header-bg);
border-top-color: var(--border-color);
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
:global(.dark-mode) .tf-navigation-bar {
background-color: transparent !important;
}
.tf-navigation-bar {
display: flex;
justify-content: space-around;
align-items: center;
list-style: none;
padding: 0;
margin: 0;
}
.nav-item-link {
text-decoration: none;
color: #717171;
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
font-size: 11px;
font-weight: 500;
transition: all 0.2s ease;
padding: 4px 12px;
border-radius: 12px;
}
.nav-item-link:hover {
color: #533dea;
background-color: rgba(83, 61, 234, 0.05);
}
.nav-item-link i {
font-size: 22px;
}
.nav-icon {
width: 24px;
height: 24px;
object-fit: contain;
}
:global(.dark-mode) .nav-item-link {
color: #e0e0e0;
}
:global(.dark-mode) .nav-item-link:hover {
color: #816ef0;
background-color: rgba(129, 110, 240, 0.1);
}
</style>

View File

@@ -0,0 +1,227 @@
<script setup>
import { onMounted, onUnmounted, h, ref, watch, nextTick } from 'vue'
import { useUIStore } from '../../../stores/ui'
import { useUserStore } from '../../../stores/user'
import { useUserNotes } from '../../../composables/useUserNotes'
import { useModal } from '../../../composables/Core/useModal'
import SystemBroadcast from '../../../Components/SystemBroadcast.vue'
const uiStore = useUIStore()
const userStore = useUserStore()
const { notes, fetchNotes, dismissNotes, hasNotes } = useUserNotes()
const modal = useModal()
const headerRef = ref(null)
let resizeObserver = null
const updateHeaderHeight = () => {
if (headerRef.value) {
const height = headerRef.value.offsetHeight
document.documentElement.style.setProperty('--header-height', `${height}px`)
}
}
const goBack = () => {
window.history.back()
}
const reloadPage = () => {
window.location.reload()
}
const openAccountSettings = () => {
if (window.$navigateHelper) {
window.$navigateHelper({ page: 'AccountSettings' })
} else {
console.warn('Global $navigate function not found.')
}
}
const openNotesModal = () => {
if (!hasNotes()) return
modal.continueCancelModal({
title: 'Notes',
body: h('div', {
style: 'white-space: pre-wrap; font-size: 16px; line-height: 1.5; color: #333;'
}, notes.value),
continueText: 'Dismiss Note',
cancelText: 'Close',
continueClass: 'btn btn-danger w-50 py-2 rounded-3 shadow-sm fw-bold',
cancelClass: 'btn btn-light w-50 py-2 rounded-3 border fw-bold text-muted',
onContinue: async () => {
const success = await dismissNotes()
if (success) {
await fetchNotes()
}
}
})
}
onMounted(() => {
if (userStore.isLoggedIn) {
fetchNotes()
}
updateHeaderHeight()
// Create a ResizeObserver to handle height changes (e.g., SystemBroadcast showing/hiding)
if (window.ResizeObserver && headerRef.value) {
resizeObserver = new ResizeObserver(() => {
updateHeaderHeight()
})
resizeObserver.observe(headerRef.value)
}
// Fallback: update on window resize
window.addEventListener('resize', updateHeaderHeight)
})
onUnmounted(() => {
if (resizeObserver) {
resizeObserver.disconnect()
}
window.removeEventListener('resize', updateHeaderHeight)
})
// Update height when notes status changes
watch(() => hasNotes(), () => {
nextTick(() => updateHeaderHeight())
})
// Update height when page title changes (might wrap)
watch(() => uiStore.pageTitle, () => {
nextTick(() => updateHeaderHeight())
})
</script>
<template>
<div class="header is-fixed" id="maintopbarheader" ref="headerRef">
<SystemBroadcast />
<div class="tf-container">
<div class="tf-statusbar d-flex justify-content-center align-items-center">
<a href="javascript:void(0);" class="back-btn" @click="goBack" id="backbutton-top">
<i class="fas fa-chevron-left"></i>
</a>
<h3 id="topbar-title" @click="reloadPage" class="header-title">{{ uiStore.pageTitle }}</h3>
<div class="action-right-group">
<a
v-if="hasNotes()"
href="javascript:void(0);"
class="action-right-btn notes-btn"
@click="openNotesModal"
id="btn-notes-top"
title="You have notes"
>
<i class="fas fa-copy"></i>
<span class="notes-badge"></span>
</a>
<a href="javascript:void(0);" class="action-right-btn" @click="openAccountSettings" id="btn-popup-up">
<i class="fas fa-sliders-h"></i>
</a>
</div>
</div>
</div>
</div>
</template>
<style scoped>
.header {
position: fixed;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: var(--layout-max-width, 1440px);
z-index: 9999;
background-color: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
transition: all 0.3s ease;
}
:global(body.is-full-width) .header {
max-width: none !important;
}
:global(.dark-mode) .header {
background-color: var(--header-bg);
border-bottom-color: var(--border-color);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.header-title {
font-size: 18px;
font-weight: 700;
color: #1e1e1e;
margin: 0;
cursor: pointer;
}
:global(.dark-mode) .header-title {
color: #e0e0e0;
}
.tf-statusbar {
height: 56px;
position: relative;
}
.back-btn {
position: absolute;
left: 16px;
color: #1e1e1e;
font-size: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.action-right-group {
position: absolute;
right: 16px;
display: flex;
align-items: center;
gap: 14px;
}
.action-right-btn {
color: #1e1e1e;
font-size: 20px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.notes-btn {
color: #f2c71c;
}
.notes-badge {
position: absolute;
top: -2px;
right: -4px;
width: 8px;
height: 8px;
background-color: #ea3434;
border-radius: 50%;
border: 1.5px solid #fff;
}
:global(.dark-mode) .back-btn,
:global(.dark-mode) .action-right-btn {
color: #e0e0e0;
}
:global(.dark-mode) .notes-btn {
color: #f2c71c;
}
:global(.dark-mode) .notes-badge {
border-color: rgba(28, 30, 34, 0.85);
}
</style>