Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added drag and drop feature #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions drag-drop/assets/drag.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
body {
background-image: url(https://source.unsplash.com/1600x1366/?landscape);
font-family: 'Montserrat', sans-serif;
line-height: 1.5;
}

#div1,
#div2 {
width: 10vw;
height: 10vw;
border: 1px solid red;
margin: 0 auto;
text-align: center;
border-radius: 15px;
}

.container {
display: flex;
margin-top: 10vh;
width: 70vw;
margin-left: auto;
margin-right: auto;
}

.dragDiv {
width: 10vw;
height: 10vw;
}

.dragImage {
height: 100%;
width: 100%;
border-radius: 10px;
object-fit: cover;
}
.verdict{
width: 70vw;
font-size: 1.5rem;
margin: 0 auto 0 auto;
}

.card{
background: rgba(0, 0, 0, 0.685);
color: white;
border-radius: 10px;
max-width: 300px;
margin-right: auto;
margin-left: auto;
margin-bottom: 10px;
}

@media only screen and (min-width: 768px){
body{
font-size: 120%;
}
.card{
border-radius: 15px;
max-width: 450px;

}
}
25 changes: 25 additions & 0 deletions drag-drop/assets/dragAndDrop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added drag-drop/assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drag-drop/assets/images/rainy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drag-drop/assets/images/smog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drag-drop/assets/images/sunny.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drag-drop/assets/images/winter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions drag-drop/assets/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// let weather = {
// "apiKey": "9969e5ceb5207490f3ec4ebb9eb3062f",
// fetchWeather: function (city) {
// fetch(
// "https://api.openweathermap.org/data/2.5/weather?q=" +
// city +
// "&units=metric&appid=" +
// this.apiKey
// ).then((response) => response.json())
// .then((data) => this.displayWeather(data))
// },
// displayWeather: function (data) {
// const {
// name
// } = (data);
// const {
// icon,
// description
// } = data.weather[0];
// const {
// temp,
// humidity
// } = data.main;
// const {
// speed
// } = data.wind;
// console.log(name, icon, description, temp, humidity, speed);
// document.querySelector(".city").innerHTML = "Weather in " + name;
// document.querySelector(".icon").src =
// "http://openweathermap.org/img/wn/" + icon + ".png";
// document.querySelector(".description").innerHTML = description;
// document.querySelector(".temp").innerHTML = parseInt(temp) + "°C";
// document.querySelector(".humidity").innerHTML = "Humidity: " + humidity + "%";
// document.querySelector(".wind").innerHTML = "Wind speed: " + speed + " km/h";
// document.querySelector(".weather").classList.remove("loading");

// },
// search: function() {
// this.fetchWeather(document.querySelector(".search-bar").value);
// }
// };

// document.querySelector(".search button").addEventListener("click", function() {
// weather.search();
// });

// document.querySelector(".search-bar").addEventListener("keyup", function(event) {
// if (event.key == "Enter") {
// weather.search();
// }
// });

// weather.fetchWeather("Indore");

Loading