portfolio/assets/js/indicator.js

31 lines
945 B
JavaScript

class Indicator {
constructor() {
this.resumeIndicator = document.getElementById('resume-indicator')
this.portfolioIndicator = document.getElementById('portfolio-indicator')
this.computerIndicator = document.getElementById('computer-indicator')
this.tvIndicator = document.getElementById('tv-indicator')
this.guitarIndicator = document.getElementById('guitar-indicator')
this.resumeIndicatorShown = false
this.portfolioIndicatorShown = false
this.computerIndicatorShown = false
this.tvIndicatorShown = false
this.guitarIndicatorShown = false
this.indicatorMap = {
'resume': this.resumeIndicator,
'portfolio': this.portfolioIndicator,
'computer': this.computerIndicator,
'tv': this.tvIndicator,
'guitar': this.guitarIndicator
}
}
show(indicatorName) {
this.indicatorMap[indicatorName].style.display = 'block'
}
hide(indicatorName) {
this.indicatorMap[indicatorName].style.display = 'none'
}
}