Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your goal for this assignment is to build a dynamic image gallery using the Unsplash Image Source service. You will be using a PHP data

Your goal for this assignment is to build a dynamic image gallery using the Unsplash Image Source service. You will be using a PHP data-structure to store the configuration parameters for your gallery. A working example of this assignment can be seen here: stungeye.com/school/unsplash File and Folder Structure Your project requires the following files and folders: index.php main.css (Feel free to use the one provided with the example version.) Folder named images Unsplash Unsplash describes itself as: Beautiful, free photos. Gifted by the worlds most generous community of photographers. Unsplash photos are searchable by keyword on their website. Heres the website search for pastoral goats: Unsplash also has an API for finding images by keyword using specially constructed URLs. Locally Saved Unsplash Images Check out the Unsplash website: Find and download at least four images that you like. Make note of the photographers name and the photographers Unsplash URL. Resize each of these images to be 1230 pixels wide (or a size that suits your CSS).(In MS Paint: Resize button =>pixel radio button => Horizontal: 1230) Save these images to your images folder. Image Gallery Configuration Your index.php file should be a simple valid HTML5 document with a PHP block at the top. Include the following $config array in this PHP block: $config =[ 'gallery_name' => 'Name of Your Gallery', 'unsplash_categories' =>['array','of','category','keywords'], 'local_images' =>['array','of','local','image','filenames']]; Update the $config data to customize: your gallery name the categories of images you wish to feature (minimum 4) the filenames of the images you saved earlier (minimum 4) The rest of your script will use these configuration values. Gallery Requirements Your gallery should include the following: The name of your gallery from the $config data should be displayed at the top of the page in an h1 element. One image for each of your categories should be displayed. (Details on loading images by category using the Unsplash API are below. ) Above each image, the name of the category within an h2 element. A h1 element that reads # Large Images where # is the size of the array of local images with the $config hash. (Use PHP code to find this value.) The local images you saved to your images folder. IMPORTANT: You should be using loops to display all your images instead of hardcoding your image tags. Adding new categories or images should not require any changes to your code beyond the $config variable. Random Unsplash Images by Category You can load up a random image from Unsplash from a specific category by using cleverly crafted URLs. Loading a random 300x200 pixel nature photo: Photographer Name Links After all of the above is working: For each of your local images display the name of the photographer. The name of display should also link to the photographers Unsplash home page. IMPORTANT: You need to figure out a way to store the photographers name and URL along with the image filenames in the $config variable. Use your knowledge of arrays and hashes to figure out how best to store this information. Open the example version of this assignment to see what this photographer attribution might look like. Remember, adding new images to your page should not require any changes to your code beyond the $config variable.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago

Question

Define and explain the goals of employee orientation/onboarding

Answered: 1 week ago