Answered step by step
Verified Expert Solution
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 datastructure to store the configuration parameters for your gallery. A working example of this assignment can be seen here: stungeye.comschoolunsplash 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 pixels wide or a size that suits your CSSIn MS Paint: Resize button pixel radio button Horizontal: Save these images to your images folder. Image Gallery Configuration Your index.php file should be a simple valid HTML document with a PHP block at the top. Include the following $config array in this PHP block: $config 'galleryname' 'Name of Your Gallery', 'unsplashcategories' arrayof'category','keywords' 'localimages' arrayof'local','image','filenames'; Update the $config data to customize: your gallery name the categories of images you wish to feature minimum the filenames of the images you saved earlier minimum 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 h 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 h element. A h 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 x 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started