updating js, split class and object list into new file
This commit is contained in:
parent
400f5c6f0c
commit
c2b724a81b
3 changed files with 23 additions and 12 deletions
|
@ -1,13 +1,7 @@
|
|||
class slide{
|
||||
constructor(title, caption, image){
|
||||
this.title = title;
|
||||
this.caption = caption;
|
||||
this.image = image;
|
||||
}
|
||||
}
|
||||
import {slide} from "GalleryIndex.js";
|
||||
import {slides} from "GalleryIndex.js";
|
||||
|
||||
var currentSlide = 0;
|
||||
var slides = [1, 2, 3, 4, 5, 6, 7] //generic info, placeholder
|
||||
|
||||
|
||||
function nextSlide(){
|
||||
|
@ -27,5 +21,5 @@ function updateSlide(){
|
|||
currentSlide = slides.length;
|
||||
}
|
||||
|
||||
console.log(currentSlide);
|
||||
console.log(slides[currentSlide]);
|
||||
}
|
11
pages/GalleryIndex.js
Normal file
11
pages/GalleryIndex.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
export class slide{
|
||||
constructor(title, caption, image){
|
||||
this.title = title;
|
||||
this.caption = caption;
|
||||
this.image = image;
|
||||
}
|
||||
};
|
||||
export var slides = [slide(),
|
||||
slide(),
|
||||
slide()
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue