Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Acumane committed Dec 15, 2023
2 parents e69edeb + 114d3c4 commit 7094db7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
35 changes: 26 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ import Toast from 'primevue/toast'
<div id="left-nav">
<RouterLink to="/"> <Logo class="logo" height="75" width="75"/>
</RouterLink>
<div class="search">
<AutoComplete :style="{'width':'100%'}" :input-style="{'width': '100%'}" v-model="selection" :placeholder="ex" :suggestions="suggest" @complete="filterRes" @item-select="goTo"></AutoComplete>
</div>
</div>

<div id="right-nav">
<div id="right-nav">
<a href="https://forms.gle/Tu5xSSjK1MkZDXK69" target="_blank" rel="noopener noreferrer"><Button class="nav-btn" aria-label="Feedback" >
<PollIcon height="25" width="25"/>
</Button></a>
<a href="https://github.com/Vacansee/app" target="_blank" rel="noopener noreferrer"><Button class="nav-btn" aria-label="GitHub" >
<GHIcon height="25" width="25"/>
</Button></a>
</div>
</header>

</header>
<div id="mobile-nav">
<Teleport to="#left-nav" :disabled="global.aspectRatio > 1.5">
<AutoComplete class="search" :style="{'width':'100%'}" :input-style="{'width': '100%'}" v-model="selection" :placeholder="ex" :suggestions="suggest" @complete="filterRes" @item-select="goTo" @focus.native="searchFocus(true)" @blur.native="searchFocus(false)"></AutoComplete>
</Teleport>
</div>

<RouterView />
</template>
Expand Down Expand Up @@ -72,6 +73,10 @@ export default {
const ex = this.exs.shift()
this.ex = `Try ${ex}`; this.exs.push(ex)
},
searchFocus(is) {
this.global.sFocus = is
// console.log("sFocus:", is)
},
filterRes(event) {
// Case & whitespace insensitive, ignore some characters:
const query = event.query.toLowerCase().replace(/\s{2,}/g, ' ').replace(/["#]/g, '')
Expand Down Expand Up @@ -131,6 +136,7 @@ header {
.logo {
margin-right: 1rem;
pointer-events: all;
filter: drop-shadow(0px 5px 20px white);
}
.nav-btn {
Expand All @@ -141,7 +147,7 @@ header {
justify-content: center;
background-color: var(--unusedfill);
border: 2px solid var(--buildbord);
box-shadow: 0px 5px 25px rgba(0, 10, 20, 0.05);
box-shadow: 0px 5px 25px rgba(0, 10, 20, 0.08);
pointer-events: all;
}
Expand All @@ -156,9 +162,9 @@ header {
}
.search {
width: 250px;
width: 250px !important;
border: 2px solid var(--walkpath);
box-shadow: 0px 5px 25px rgba(0, 10, 20, 0.05);
box-shadow: 0px 5px 25px rgba(0, 10, 20, 0.08);
border-radius: 10px;
align-self: center;
pointer-events: all;
Expand All @@ -170,4 +176,15 @@ header {
top: 0;
right: 0;
}
#mobile-nav {
width: 100%;
display: flex;
justify-content: center;
pointer-events: none;
position: absolute;
bottom: 2vh;
z-index: 6;
}
</style>
3 changes: 1 addition & 2 deletions src/components/home/MapItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ export default {
// Check for resizing of window
window.addEventListener("resize", this.windowResizeTimeout)
// Allow for the scroll wheel to zoom the map
let portraitMode = false;
window.addEventListener("wheel", this.onMouseScroll);
// Handles changes to the window
this.windowEventHandler()
Expand All @@ -300,7 +299,7 @@ export default {
},
methods: {
onMouseScroll({deltaX,deltaY}) {
if (!this.global.bldg){
if (!this.global.sFocus && !this.global.bldg){
let dirwheel = 0;
if (deltaY>0) {
dirwheel = -1;
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/PopUpItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import InfoIcon from '@/assets/icons/info.svg?component'
<img :src="imgPath" id="photo">
<span>{{ getBldg().meta.name }}</span>
</div>
<p id="heat" v-if="interpretHeat()"><b style="color:var(--heatColor);">{{ interpretHeat() }}</b> (~{{ getBldg().meta.heat*100 }}%)</p>
<p id="heat" v-if="interpretHeat()"><b style="color:var(--heatColor);">{{ interpretHeat() }}</b> (~{{ getBldg().meta.heat.toFixed(2)*100 }}%)</p>
<p id="heat" v-else><b>N/A</b></p>
<p id="flow" v-if="interpretFlow()">+ {{ interpretFlow() }} (~{{ getBldg().meta.flow.toFixed(2)*100 }}%)&emsp;</p>
<p id="time" ref="mySpan">{{ getRealTime(global.time) }}</p>
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import App from './App.vue'
import Router from './router'
// Imports ability to check time
import Moment from 'moment-timezone'
// useFetch is used to fetch data (fitting name)
// Basic CSS
import './assets/main.css'

Expand All @@ -21,7 +20,7 @@ import ToastService from 'primevue/toastservice';
import './assets/themes/theme.css';

const global = reactive({ // The global reactive object!
// Any changes to its members will trigger reactivity in components that reference it:
// Any changes to its members will trigger reactivity in components that
data: null,
searchData: null,
bldg: '',
Expand All @@ -32,6 +31,7 @@ const global = reactive({ // The global reactive object!
time: Moment.tz('America/New_York').format('e:HHmm'),
// time: Moment.tz('2023-11-29 11:55', 'America/New_York').format('e:HHmm'), // Test time
firstCalc: false,
sFocus: false
})

// On page load, fetch building/room and search data from Vacansee/data:
Expand Down Expand Up @@ -150,8 +150,8 @@ setInterval(() => { // Update current time every second
// let seconds = Number(Moment.tz('2023-11-28 11:55', 'America/New_York').format('ss')) // Test time
// Every 5 minutes, check data for buildings (update heat and room availability)
if (!(global.time.split(':')[1] % 5) && !seconds) { // update states every 5m (on the dot)
// checkActive()
// console.log(`Updating states @ ${global.time}:${seconds}`)
checkActive()
console.log(`Updating states @ ${global.time}:${seconds}`)
}
// else console.log(`${global.time}:${seconds}`)
}, 1000)
Expand Down
1 change: 0 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import svgLoader from 'vite-svg-loader'
// https://vitejs.dev/config/
export default defineConfig({
base: '/app/',
assetsInclude: ['**/*.jpg'],
plugins: [
vue(),
svgLoader({
Expand Down

0 comments on commit 7094db7

Please sign in to comment.