Skip to content

Commit

Permalink
Update: Refactored Source Code (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Jul 17, 2024
1 parent 7d9cd84 commit 6abc782
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ <h2>Explore More of My Projects:</h2>
<a href="https://hoangsonww.github.io/The-Event-Horizon-App/" class="btn">Visit EventHorizon</a>
</div>
<div class="app">
<p>Take a look at my other projects on <strong>GitHub</strong>. A showcase of my coding journey!</p>
<p>Take a look at my other projects on <strong>GitHub</strong> - a showcase of my coding journey!</p>
<a href="https://github.com/hoangsonww" class="btn">Visit My GitHub!</a>
</div>
</div>
<h2>Our Commitment:</h2>
<p>The WeatherMate App is a labor of love, crafted with the intent to bring you the most up-to-date weather information in the most convenient way possible. Developed by Son Nguyen Hoang in 2023, our app is constantly evolving with new features to enhance your weather experience.</p>
<p>Thank you for choosing The WeatherMate App. We are committed to providing you with a reliable and enjoyable weather service.</p>
<a href="../../index.html">← Back to Home</a>
Expand Down
2 changes: 2 additions & 0 deletions src/js/chatbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ async function getBotResponse(message) {

try {
showLoadingMessage();
scrollToBottom();

const genAI = new GoogleGenerativeAI(getAIResponse());
const model = genAI.getGenerativeModel({
Expand Down Expand Up @@ -139,6 +140,7 @@ chatInput.addEventListener("keydown", (e) => {

e.target.value = '';
}
scrollToBottom();
});

const toggleButton = document.createElement("button");
Expand Down
9 changes: 3 additions & 6 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function getWeatherByLocation(city) {
lastCity = city;

document.getElementById("forecast-display").classList.remove('hide');
document.getElementById( "forecast-display" ).classList.add( 'show' );
document.getElementById( "forecast-display").classList.add('show');

document.getElementById("forecast-btn").textContent = `View Forecast For ${city}`;
document.getElementById("aqi-btn").textContent = `View Air Quality Index For ${city}`;
Expand Down Expand Up @@ -427,11 +427,8 @@ function toggleTemperatureUnit() {
function updateTemperatures() {
if (lastCity) {
getWeatherByLocation(lastCity);
const forecastBtn = document.getElementById("forecast-btn");
if (forecastBtn.textContent.includes("Close Forecast")) {
const lat = forecastBtn.getAttribute("data-lat");
const lon = forecastBtn.getAttribute("data-lon");
getForecastByLocation(lat, lon);
if (popupStatus.forecast === true) {
toggleForecast();
}
}
}
Expand Down

0 comments on commit 6abc782

Please sign in to comment.