Skip to content

Commit

Permalink
All room #s (+ resize), excavated
Browse files Browse the repository at this point in the history
  • Loading branch information
Acumane committed Sep 28, 2023
1 parent bacce51 commit d420e10
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
20 changes: 14 additions & 6 deletions src/components/home/Floor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ export default {
const paths = svgComponent.$el.querySelectorAll("path")
paths.forEach((path) => {
let roomName = path.getAttribute("id").substr(1);
let roomID = path.getAttribute("id");
let roomName = roomID.substr(1);
let roomInfo = this.getBldg()[roomName];
if (roomInfo) {
path.addEventListener("mouseover", () => { this.$emit('room-hover', roomName) })
path.addEventListener("mouseleave", () => { this.$emit('room-hover', '') } )
if (roomID != 'floor' && !roomID.includes('excavated')) {
if (roomInfo)
path.addEventListener("mouseover", () => { this.$emit('room-hover', [roomName, true]) })
else path.addEventListener("mouseover", () => { this.$emit('room-hover', [roomName, false]) })
path.addEventListener("mouseleave", () => { this.$emit('room-hover', ['', false]) } )
}
if (roomInfo) {
if (roomInfo.meta.cur) {
path.setAttribute("fill", "#fc4e58");
let border = tinycolor("#fc4e58").darken(20).toString()
Expand All @@ -126,9 +132,11 @@ export default {
path.setAttribute("cursor", "pointer")
}
}
else if (roomName != 'loor') {
path.setAttribute("fill", "var(--unusedfill)")
else { // !roomInfo
path.setAttribute("cursor","not-allowed")
if (roomID.includes('excavated')) path.setAttribute("fill", "var(--hardborder)")
if (roomID != 'floor') // rooms w/o classes:
path.setAttribute("fill", "var(--unusedfill)")
}
path.setAttribute("pointer-events", "all");
path.addEventListener("click", () => { this.roomSelect(path); })
Expand Down
10 changes: 5 additions & 5 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ export default {
},
onRoomHover(roomHover) {
let nametag = document.getElementById('nametag');
if (roomHover) {
if (roomHover[0]) {
this.ntVisible = 1
this.label = roomHover
nametag.style.fontSize = '24px'
this.label = roomHover[0]
if (roomHover[1]) nametag.style.fontSize = '24px'
else nametag.style.fontSize = '16px'
}
else if (roomHover == '') {
else if (roomHover[0] == '') {
this.ntVisible = 0
nametag.style.fontSize = '14px'
}
Expand Down Expand Up @@ -137,7 +138,6 @@ export default {
border: 2px solid var(--softborder);
border-radius: 5px;
box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
/*opacity: 0;*/
transition-duration: .1s;
pointer-events: none;
}
Expand Down

0 comments on commit d420e10

Please sign in to comment.