From c2b724a81ba99e5e31eed06260fc1916f403475e Mon Sep 17 00:00:00 2001 From: Nye Evans Date: Fri, 1 Jan 2021 17:48:27 +0000 Subject: [PATCH] updating js, split class and object list into new file --- Pages/index.html | 12 +++++++++--- pages/Gallery.js | 12 +++--------- pages/GalleryIndex.js | 11 +++++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 pages/GalleryIndex.js diff --git a/Pages/index.html b/Pages/index.html index a729d78..f2dfa7c 100644 --- a/Pages/index.html +++ b/Pages/index.html @@ -1,9 +1,12 @@ +
- + + Nye Evans Portfolio
+
@@ -36,8 +39,8 @@

Image Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

- - + +
@@ -52,6 +55,9 @@ Twitter   Email +   + Github
+ \ No newline at end of file diff --git a/pages/Gallery.js b/pages/Gallery.js index ee53c19..ab40d1e 100644 --- a/pages/Gallery.js +++ b/pages/Gallery.js @@ -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]); } \ No newline at end of file diff --git a/pages/GalleryIndex.js b/pages/GalleryIndex.js new file mode 100644 index 0000000..27a8204 --- /dev/null +++ b/pages/GalleryIndex.js @@ -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() +] \ No newline at end of file