Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #74

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b005a41
Added pin placeholder
paulbruzzi Nov 11, 2023
23bfe72
Merge remote-tracking branch 'origin' into pin_in_building
paulbruzzi Nov 14, 2023
1152870
Made Pin show
paulbruzzi Nov 14, 2023
ae58bf4
Added boolean check for pin
paulbruzzi Nov 14, 2023
584ad48
Created base for pin item
paulbruzzi Nov 14, 2023
902d127
continued to setup pin
paulbruzzi Nov 18, 2023
070bb22
Pin placeholder ordered correctly
paulbruzzi Dec 1, 2023
31d7381
Added separate pin vue
paulbruzzi Jan 30, 2024
94da64b
added Dark mode button placeholder
paulbruzzi Feb 6, 2024
26cc53e
Simplified the method for changing to darkmode
paulbruzzi Feb 16, 2024
7de8079
added a global variable for dark mode
paulbruzzi Feb 16, 2024
2219b66
added a watcher for global darkmode variable
paulbruzzi Feb 16, 2024
d6c8957
Merge branch 'dev' into dark_mode
paulbruzzi Feb 16, 2024
f253969
added placehoder color switches
paulbruzzi Feb 27, 2024
cc35e47
Added placeholder logic for darkmode
paulbruzzi Feb 27, 2024
283d2e6
Added SVGs for Ricketts (3-5)
AbishekSh Mar 15, 2024
8c35776
Merge branch 'dev' into dark_mode
AbishekSh Mar 15, 2024
61e7ef5
tried to get the background to change color
AbishekSh Mar 26, 2024
881d70a
added a function for dark mode on main.js (it doesnt change preferred…
AbishekSh Apr 12, 2024
079316f
DARK MODE WORKS!!! it may flashbang you
AbishekSh Apr 16, 2024
6435d50
removed some console logs
AbishekSh Apr 16, 2024
8e3a926
the logo now changes when u enable dark mode
AbishekSh Apr 18, 2024
b419776
Merge branch 'dev' into dark_mode
paulbruzzi Apr 18, 2024
6d9219d
fixed bug where some parts of the popup wouldnt convert to dark mode
AbishekSh Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import router from "@/router";
<!-- HTML For Header -->
<header id="header">
<div id="left-nav">
<RouterLink to="/"> <Logo class="logo" height="75" width="75"/>
<RouterLink to="/"> <Logo class="logo" height="75" width="75" :style="{ fill: global.darkMode ? '#40c269' : '' }"/>
</RouterLink>
</div>

<div id="right-nav">
<!--<a><Button class="nav-btn" @click="()=>{this.global.darkMode = !this.global.darkMode; }">DARK MODE</Button></a>-->
<a><Button class="nav-btn" @click="checkDark2()">DARK MODE</Button></a>
<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>
Expand Down Expand Up @@ -76,6 +78,17 @@ export default {
this.global.invalidLoadMessage = ""
}
}
},
'global.error': {
handler() {
if (this.global.error) this.$showToast({title: 'Failed to load data', body: this.global.error})
}
},
'global.darkMode': {
handler() {
if (this.global.darkMode) {console.log("Dark mode activated")}
if (!this.global.darkMode) {console.log("Dark mode de-activated")}
}
}
},
mounted() {
Expand Down Expand Up @@ -133,8 +146,57 @@ export default {
this.global.floor = parseInt(room[0])
this.global.room = room, this.global.bldg = bldg, this.selection = ""
console.log(`Room w/ CRN #${CRN} selected`)
},

checkDark2() {
const paths = document.querySelectorAll('.logo path');
this.global.darkMode = !this.global.darkMode;
if (this.global.darkMode) {
document.documentElement.style.setProperty('--background', '#171918');
document.documentElement.style.setProperty('--carroad', '#232624');
document.documentElement.style.setProperty('--walkpath', '#2e322f');
document.documentElement.style.setProperty('--softborder', '#2e322f');
document.documentElement.style.setProperty('--hardborder', '#3d423e');
document.documentElement.style.setProperty('--buildfill', '#2d322e');
document.documentElement.style.setProperty('--buildbord', '#505a52');
document.documentElement.style.setProperty('--roomfill', '#5d685f');
document.documentElement.style.setProperty('--unusedfill', '#3fa053');
// document.documentElement.style.setProperty('--softborder', '#3fa053');
document.documentElement.style.setProperty('--color-background-mute', '#3fa053');
const paths = document.querySelectorAll('.logo path');
paths.forEach(path => {
path.style.fill = '#40c269';
});


}
else if (!this.global.darkMode) {
document.documentElement.style.setProperty('--background', '#ffffff');
document.documentElement.style.setProperty('--carroad', '#d4e5e2');
document.documentElement.style.setProperty('--walkpath', '#a2c3c3');
document.documentElement.style.setProperty('--softborder', '#d3d5dc');
document.documentElement.style.setProperty('--hardborder', '#869395');
document.documentElement.style.setProperty('--buildfill', '#d4e5e2');
document.documentElement.style.setProperty('--buildbord', '#7cacab');
document.documentElement.style.setProperty('--roomfill', '#d5ebe7');
document.documentElement.style.setProperty('--unusedfill', '#bbd3cf');
const originalFillColors = {
'path1': '#205c5b',
'path2': '#205c5b',
'path3': '#205c5b',
'path4': '#489991'
};
const paths = document.querySelectorAll('.logo path');
paths.forEach((path, index) => {
path.style.fill = originalFillColors['path' + (index + 1)];
});
}

return
}
}


}
</script>
<style scoped>
Expand Down
47 changes: 22 additions & 25 deletions src/assets/floors/Ricketts3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/assets/floors/Ricketts4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/floors/Ricketts5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/components/home/Floor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,33 @@ export default {
},
immediate: true,
},
'global.darkMode': {
handler() {
if (this.global.darkMode) {
this.colors = [
"#00e099",
"#00ea77",
"#00ed80",
"#00e68e",
"#00c675",
"#009a57",
"#004e58",
];
this.applyRoomColors();
} else {
this.colors = [
"#66e099",
"#aeea77",
"#d8ed80",
"#fce68e",
"#fdc675",
"#f99a57",
"#fc4e58",
];
this.applyRoomColors();
}
}
}
},
updated() {
this.$nextTick(() => {
Expand All @@ -68,6 +95,7 @@ export default {
getBldg() { return this.global.data[this.global.bldg] },
// get room color corresponding to room availability
getRoomColor(minutes) {
console.log(this.colors);
if (minutes >= 240) return this.colors[0]
if (minutes >= 120) return this.colors[1]
if (minutes >= 60) return this.colors[2]
Expand Down
10 changes: 10 additions & 0 deletions src/components/home/FloorItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ export default {
// Lowest floor: limit
if (this.global.floor == 1) this.btnDown = false
else if (this.global.floor) this.btnDown = true
},
'global.darkMode': {
handler() {
console.log(this.global.darkMode);
if (this.global.darkMode) {
console.log("buttonbox.floor-button.color");
} else {
console.log("buttonbox.floor-button.color");
}
}
}
},
// When button up changes
Expand Down
Loading