File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change
1
+ [
2
+ " announcements/next.png"
3
+ ]
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" class =" container-fluid" style =" height : 98vh ; padding-top : 2vh ; padding-left : 2vw ;" >
3
3
<div class =" row" style =" height : 85% ;" >
4
- <div class =" col-md-7" style =" height : 100% ;" >
5
- <h1 >Announcements <span class =" material-icons" >announcement</span ></h1 >
4
+ <div class =" col-md-7" style =" height : 100% ; display : flex ; flex-direction : column ;" >
5
+ <h1 style =" flex : 0 1 auto ;" >Announcements <span class =" material-icons" >announcement</span ></h1 >
6
+ <div style =" background-repeat : no-repeat ; background-size : contain ; flex : 1 ;" :style =" {'background-image': 'url(' + currentImage + ')'}" >
7
+ </div >
6
8
</div >
7
9
<div class =" col-md-5" >
8
10
<div >
@@ -42,6 +44,7 @@ import './app.css'
42
44
components: {}
43
45
})
44
46
export default class App extends Vue {
47
+ private currentImage: string = ' '
45
48
private error: boolean = false
46
49
private info: Map <string , { prediction: string , title: string }> = new Map ()
47
50
private time: string = ' '
@@ -83,6 +86,17 @@ export default class App extends Vue {
83
86
this .error = true
84
87
console .log (error )
85
88
})
89
+
90
+ fetch (' config.json' ).then ((data ) => {
91
+ return data .json ()
92
+ }).then ((data ) => {
93
+ this .currentImage = data [0 ]
94
+ setInterval (() => {
95
+ this .currentImage = data [Math .floor (Math .random () * data .length )]
96
+ }, 5000 )
97
+ }).catch ((error ) => {
98
+ console .log (error )
99
+ })
86
100
}
87
101
}
88
102
</script >
You can’t perform that action at this time.
0 commit comments