Skip to content

Commit c120c1c

Browse files
Popup image Update
1 parent 469b7ec commit c120c1c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ <h3 class="heading-tertiary u-margin-bottom-small story-title"></h3>
7777
</main>
7878
<div class="popup" id="popup">
7979
<div class="popup__content">
80-
<div class="popup__left">
81-
<img src="img/nat-8.jpg" alt="Tour photo" class="popup__img" />
82-
<img src="img/nat-9.jpg" alt="Tour photo" class="popup__img" />
83-
</div>
80+
<div class="popup__left"></div>
8481
<div class="popup__right">
8582
<a href="#section-tours" class="popup__close">&times;</a>
8683
<h2

script/script.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ app.getData = addressInput => {
166166
//Display Content of Story
167167

168168
//console log google api result
169-
console.log(result);
170-
//app.filter(result);
171-
169+
//console.log(result);
172170
//console log google api result ends
173171

174172
app.displayStoryContent(result);
@@ -179,6 +177,7 @@ app.getData = addressInput => {
179177
});
180178
};
181179

180+
// filtering the locality/political name to get the actual name of town
182181
app.filter = data => {
183182
const arr = data.results[0].address_components;
184183

@@ -226,6 +225,7 @@ app.empty = () => {
226225
$(".weather-details").empty();
227226
$(".dateTime-details").empty();
228227
$(".composition").empty();
228+
$(".popup__left").empty();
229229
};
230230

231231
// displaying the data to DOM
@@ -258,6 +258,10 @@ app.displayStoryContent = data => {
258258
/>`);
259259
});
260260
$(".composition").append(imgContent);
261+
$(".popup__left").append(`<img src="${
262+
result[0].images[0]
263+
}" alt="Tour photo" class="popup__img" />
264+
<img src="${result[0].images[1]}" alt="Tour photo" class="popup__img" />`);
261265
}
262266
//Default Data
263267
else {
@@ -280,6 +284,12 @@ app.displayStoryContent = data => {
280284
/>`);
281285
});
282286
$(".composition").append(imgContent);
287+
$(".popup__left").append(`<img src="${
288+
defaultData.images[0]
289+
}" alt="Tour photo" class="popup__img" />
290+
<img src="${
291+
defaultData.images[1]
292+
}" alt="Tour photo" class="popup__img" />`);
283293
}
284294
};
285295

@@ -355,10 +365,9 @@ app.localWeather = latLong => {
355365
weatherDetails.humidity = result.main.humidity;
356366
weatherDetails.tempMax = result.main.temp_max;
357367
weatherDetails.tempMin = result.main.temp_min;
358-
//console.log(result);
359368
//Weather Details
360-
361-
$(".story-title-popup").append(weatherDetails.cityName);
369+
//$(".story-title-popup").append(weatherDetails.cityName);
370+
$(".story-title-popup").append(cityName);
362371
$(".weather-details").append(`
363372
<li><strong>Temperature:</strong><br/>${
364373
weatherDetails.currentTemp

0 commit comments

Comments
 (0)