-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Main page works - main page will go to carousel after inactivity, touching the screen will bring it back to the main page - Google Drive API works for a public folder * Added media check If the media fetch fails or there isn't any media in the folder, the main page won't set any timers/click listeners * Added main pages to rotation and an indicator that kiosk is touchscreen * Fix variable typo * Switch from Google Drive to AWS * remove unneeded hiring page * lower refresh interval
- Loading branch information
Showing
11 changed files
with
227 additions
and
161 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<template> | ||
<el-row class="img-container" type="flex" justify="center" align="middle"> | ||
<img :src="currentImage" /> | ||
<div v-if="touchScreenIndicator"> | ||
<h1 class="text-content"> | ||
Tap to learn more about the Sustainability Office | ||
</h1> | ||
</div> | ||
</el-row> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
images: { | ||
type: Array, | ||
required: true | ||
}, | ||
returnRoute: { | ||
type: String, | ||
default: null | ||
}, | ||
touchScreenIndicator: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
data () { | ||
return { | ||
imgIndex: 0, | ||
rotationInterval: 10000, // time in ms (10 seconds) | ||
} | ||
}, | ||
computed: { | ||
currentImage () { | ||
return this.images[this.imgIndex] | ||
} | ||
}, | ||
methods: { | ||
rotateImage () { | ||
this.imgIndex = (this.imgIndex + 1) % this.images.length | ||
// if a return route was given and all images have been shown, | ||
// return to the previous route | ||
if (this.returnRoute && this.imgIndex === 0) { | ||
this.$router.push(this.returnRoute) | ||
} | ||
} | ||
}, | ||
// rotate the image based on the given interval (in ms) | ||
// ref: https://developer.mozilla.org/en-US/docs/Web/API/setInterval | ||
mounted () { | ||
this.timer = setInterval(this.rotateImage, this.rotationInterval) | ||
// if there are no images, redirect to the home page | ||
if (!this.images || this.images.length === 0) { | ||
this.$router.push('/') | ||
} | ||
}, | ||
beforeDestroy () { | ||
clearInterval(this.timer) | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.img-container { | ||
position: fixed; | ||
left: 0; | ||
bottom: 0; | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
margin: 0px; | ||
padding: 0px; | ||
z-index: 0; | ||
background-color: black; | ||
} | ||
// grow image to fill screen but maintain aspect-ratio and full view | ||
img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: contain; | ||
} | ||
.text-content { | ||
position: absolute; | ||
bottom: 10px; | ||
left: 10px; | ||
color: white; | ||
padding: 5px; | ||
border-radius: 5px; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
</style> |
Oops, something went wrong.