├── layout.pdf ├── images ├── image1.jpg ├── image2.jpg ├── image3.jpg ├── image4.jpg ├── image5.jpg ├── image6.jpg ├── image7.jpg └── image8.jpg ├── README.md ├── assignment-2.md ├── assignment-3.md ├── assignment-4.md ├── PhotoGalleryLib.md ├── assignment-1.md └── PhotoGalleryLib.js /layout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/layout.pdf -------------------------------------------------------------------------------- /images/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image1.jpg -------------------------------------------------------------------------------- /images/image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image2.jpg -------------------------------------------------------------------------------- /images/image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image3.jpg -------------------------------------------------------------------------------- /images/image4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image4.jpg -------------------------------------------------------------------------------- /images/image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image5.jpg -------------------------------------------------------------------------------- /images/image6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image6.jpg -------------------------------------------------------------------------------- /images/image7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image7.jpg -------------------------------------------------------------------------------- /images/image8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliengs/vsp2018webapp-assignments/HEAD/images/image8.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VSP Web Apps 2 | 3 | ## Assignments 4 | 5 | - [Assignment 1](assignment-1.md) 6 | - [Assignment 2](assignment-2.md) 7 | - [Assignment 3](assignment-3.md) 8 | - [Assignment 4](assignment-4.md) 9 | 10 | ## Resources 11 | 12 | - All 8 images which you will use in the assignments can be found [here](images). 13 | - A basic UI wireframe is [here](layout.pdf) 14 | - The PhotoGalleryLib library is [here](PhotoGalleryLib.js) 15 | - The documentation for that library can be found [here](PhotoGalleryLib.md) 16 | 17 | ## Server 18 | 19 | The HTTP server you will use in the later assignments is hosted here: 20 | (TBD) 21 | http://165.227.3.253:3000/images 22 | -------------------------------------------------------------------------------- /assignment-2.md: -------------------------------------------------------------------------------- 1 | # Assignment 2 2 | 3 | ## Introduction 4 | 5 | This assignment is a continuation of Assignment 1. If you have successfully completed the previous assignment, you may use your own code, or you can use the sample solution for Assignment 1, posted [here](http://ece.ubc.ca/~kumseok/src/vsp2018/solutions/assignment-1.zip), to complete this assignment. 6 | 7 | In this assignment, you will make the web app responsive. That is, the app will be optimized for viewing across multiple devices and screen sizes. For this assignment, and some future ones, you will use the [PhotoGalleryLib](PhotoGalleryLib.js) library provided by us, which includes a lot of helpful functions. The documentation and some examples of how to use this library can be found [here](PhotoGalleryLib.md). 8 | 9 | ## Tasks 10 | 11 | 1. All you need to do for this task is print *to the javascript browser console* the size of the screen ("small", "medium", or "large") whenever it changes. (Hint: Look at PhotoGalleryLib.onSizeClassChange) 12 | 2. Remove the hardcoded table of images in your HTML file. We will dynamically generate it using JavaScript in this task, and add it to the DOM. Whenever the screen size changes (ex, from large to medium), the following should happen: 13 | - Delete the table of images from the DOM 14 | - Generate a new table of images for the current screen size (Hint: Look at PhotoGalleryLib.generateGrid) 15 | - Insert this new table into the DOM 16 | 17 | ## Submission Instructions 18 | 19 | - Update either your own code from Assignment 1, or the sample solution code to accommodate the required changes for this assignment. 20 | - Create a branch, and name it appropriately (eg. assignment-2) 21 | - Make sure to push your changes to that branch before midnight (11:59 PM) on the date of the assignment deadline. 22 | -------------------------------------------------------------------------------- /assignment-3.md: -------------------------------------------------------------------------------- 1 | # Assignment 3 2 | 3 | ## Introduction 4 | 5 | This assignment is a continuation of Assignment 2. If you have successfully completed the previous assignment, you may use your own code, or you can use the sample solution for Assignment 2, posted [here](http://ece.ubc.ca/~kumseok/src/vsp2018/solutions/assignment-2.zip), to complete this assignment. 6 | 7 | In this assignment, you'll implement a presentation mode. The presentation mode should be opened when you click on an image, effectively making images enlargeable. You will implement the next and previous buttons in the presentation mode to switch through various images. Finally, you'll implement an automatic slideshow, which will switch through images in the presentation mode after a set period of time. 8 | 9 | The presentation mode will be implemented using a modal window. You will use [PhotoGalleryLib](PhotoGalleryLib.js) again for this assignment. The documentation and some examples of how to use this library can be found [here](PhotoGalleryLib.md). 10 | 11 | ## Tasks 12 | 13 | 1. The presentation modal should open up when an image is clicked. The clicked image should be shown in the presentation modal. You don't need to implement the 3 buttons in the modal for this task: close, previous next. (Hint: Look at PhotoGalleryLib.createModal, PhotoGalleryLib.addImageClickHandlers, PhotoGalleryLib.openPresentationModal, and PhotoGalleryLib.setModalImgSrc functions) 14 | 2. Add click handlers for the 3 buttons in the modal, and make them functional. (Hint: Look at PhotoGalleryLib.initModal) 15 | 3. You will implement a slideshow in this task, which will start the presentation mode, and automatically switch through the images in 1 second intervals. 16 | - Add a "Start Slideshow" button in the HTML which will be the entry point for your slideshow code. 17 | - Implement a click handler for this button, which opens up the presentation mode, and uses JavaScript timers to periodically switch through the images. 18 | 19 | ## Submission Instructions 20 | 21 | - Update either your own code from Assignment 2, or the sample solution code to accommodate the required changes for this assignment. 22 | - Create a branch, and name it appropriately (eg. assignment-3) 23 | - Make sure to push your changes to that branch before midnight (11:59 PM) on the date of the assignment deadline. 24 | -------------------------------------------------------------------------------- /assignment-4.md: -------------------------------------------------------------------------------- 1 | # Assignment 4 2 | 3 | ## Introduction 4 | 5 | This assignment is a continuation of Assignment 3. If you have successfully completed the previous assignment, you may use your own code, or you can use the sample solution for Assignment 3, posted [here](http://ece.ubc.ca/~kumseok/src/vsp2018/solutions/assignment-3.zip), to complete this assignment. 6 | 7 | In this assignment, you will remove the hardcoded list of images from your code, and will also stop using the local image files stored on your computer. You will be using asynchronous requests (AJAX) to receive image URLs from a server, and use them to display the images in the grid. 8 | 9 | You will need to first get the server code from [HERE](https://github.com/jungkumseok/ubc-vsp18-server/). Follow the instructions and then confirm that you can see your client application (assignment-3) at `http://localhost:3000/`. 10 | 11 | Just to clarify, your `assignment-4` branch should look like the following: 12 | 13 | ``` 14 | /public/ 15 | /css/ 16 | /js/ 17 | /libs/ 18 | /index.html 19 | /.gitignore 20 | /index.js 21 | /package.json 22 | ``` 23 | 24 | * `index.js` and `package.json` files are from the server code we provided. 25 | 26 | * Make sure that `/public/` directory contains **your client-side code** and not the default `index.html` included in the server side code. 27 | 28 | * Make sure you have a `.gitignore` file. The file should include `**/node_modules/**` so that you do not commit the npm modules to your repository. 29 | 30 | * If you have `git clone`d the server repository, make sure you remove the `.git/` directory. 31 | 32 | 33 | ## Tasks 34 | 35 | 1. For this task, you do not need to change the code which displays images in the grid. Add code to send a GET HTTP request to `http://localhost:3000/images` endpoint which returns a list of image URLs. **Print this list of URLs to the console.** 36 | 2. For this task, you will **use the list of image URLs downloaded (via AJAX) in the previous task** to display them in the grid. 37 | 38 | ## Submission Instructions 39 | 40 | - Update either your own code from Assignment 3, or the sample solution code to accommodate the required changes for this assignment. 41 | - Create a branch, and name it appropriately (eg. assignment-4) 42 | - Make sure to push your changes to that branch before midnight (11:59 PM) on the date of the assignment deadline. 43 | -------------------------------------------------------------------------------- /PhotoGalleryLib.md: -------------------------------------------------------------------------------- 1 | # PhotoGalleryLib Documentation 2 | 3 | ## Introduction 4 | 5 | This library contains some functions which will be helpful for completing the assignments for this course. It has functions for detecting screen size changes, creating image tables of various sizes, creating modals, etc. 6 | 7 | The JavaScript file can be found [here](PhotoGalleryLib.js). 8 | 9 | Simply add a `` 12 | 13 | ## Functions 14 | 15 | - `PhotoGalleryLib.onSizeClassChange (callback)` 16 | 17 | This function is used for detecting screen size changes. This function takes a callback as an argument, which is called whenever the screen size is changed. One of the strings "small", "medium", or "large" will be passed as an argument to the callback function when the screen size is changed. Note that the callback function will only be called when the screen size changes from one size class to another (ex, small to medium). It will not be called repeatedly while the screen size is being changed within a particular size class like large. 18 | 19 | - `PhotoGalleryLib.generateGrid (imageUrls, size)` 20 | 21 | This function is used for generating a table DOM element which can be used to display a grid of images. The `imageUrls` argument is an array of image URLs which are supposed to be displayed in the table. These can be relative URLs like './images/foo.jpg' or even http URLs. The `size` argument can be one of "small", "medium", or "large". a 1x8 grid is made for small screen sizes, a 2x4 grid is made for medium screen sizes, and a 4x2 grid is made for large screen sizes. 22 | 23 | - `PhotoGalleryLib.createModal ()` 24 | 25 | This function creates a modal which can be used for presentation mode. There will be no visible effect when this function is called since the modal is closed by default. You can however inspect the DOM tree in your browser to see that a new `