In: Computer Science
Use the complete HTML to do all of the things:
3-3) Install and work with Redis.
3-4) Write a JQuery Ajax program that can communicate
with a flicker to get the last pictures taken from any place or
related to any concept(s) the user has written in a textbox, say
Sydney, train. Some information associated with the image like its
topic, time taken, and its link needs to be appeared with it.
3-5) Develop a server which can serve the file you
developed in 3-4.
3-6) Add a plugin to the real jQuery library so that when you pass an array of elements to it, the function can move the elements forward and backward repeatedly. Then test your plugin by sending an array of images to it.
Hopefully, someone can help me with the complete HTML. I don't want to see the JavaScript code. If someone can really help me, I will appreciate you. (HTML file not the JavaScript code). If you can, please answer me as soon as possible
Here is your html file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Images</title>
<style>
*{
margin: 0;
padding: 0;
}
.page{
width: 100%;
height: auto;
}
.container{
width: 80%;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.header-text{
font-size: 35px;
letter-spacing: 6px;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
text-transform: uppercase;
text-align: center;
margin: 35px;
}
form{
width: 800px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.form-control{
margin: 10px;
display: flex;
flex-direction: column;
}
.m-10{
margin: 10px;
}
input{
padding: 8px 12px;
width: 500px;
}
label{
text-transform: uppercase;
font-size: 20px;
}
.btn{
padding: 12px;
text-transform: uppercase;
font-size: 20px;
border: none;
border-radius: 15px;
background-color: rgb(64, 103, 175);
color: white;
}
.btn:hover{
background-color: blue;
}
#image-gallery{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: wrap;
background-color: rgb(245, 245, 245);
border-radius: 35px;
}
img{
width: 400px;
height: 400px;
margin: 15px;
}
#move{
position: relative;
width: auto;
height: 450px;
display: flex;
animation-name: move;
animation-timing-function: linear;
animation-duration: 10s;
animation-iteration-count: infinite;
}
@keyframes move{
0%{
transform: translateX(0);
}
60%{
transform: translateX(-2400px);
}
100%{
transform: translateX(0px);
}
}
</style>
</head>
<body>
<div class="page">
<div class="container">
<h1 class="header-text">Search Images</h1>
<form id="search-form">
<div class="form-control">
<label>Enter Photo name</label>
<input type="text" id="search-field" name="search" placeholder="example :- car">
</div>
<div class="m-10">
<button type="submit" name="btn-submit" class="btn">Submit</button>
</div>
</form>
</div>
<div id="move"></div>
<div class="container">
<div id="image-gallery"></div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.20.0/axios.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$(document).ready(function(){
const searchForm=document.querySelector("#search-form");
const imageGallery=document.querySelector("#image-gallery");
const move=document.querySelector("#move");
searchForm.addEventListener("submit",async e=>{
e.preventDefault();
imageGallery.innerHTML='';
move.innerHTML='';
const value =document.querySelector("#search-field").value;
const res=await axios.get(`https://api.pexels.com/v1/search?query=${value}&per_page=10`,{
headers:{
Authorization:"563492ad6f917000010000017a4a7fd3a75d4f15808ac3b25156552b"
}
})
const photos=res.data.photos;
photos.map(photo=>{
imageGallery.innerHTML+=`<img class="image" src=${photo.src.original} alt=${value}>`;
move.innerHTML+=`<img class="image" src=${photo.src.original} alt=${value}>`;
})
})
})
</script>
</body>
</html>