fixed image src

This commit is contained in:
ak 2023-10-29 22:10:58 -07:00
parent 1c7f97ccb3
commit 867c2ea6d7
3 changed files with 34 additions and 26 deletions

2
dist/main.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,27 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="stylesheet" href="../src/style.css">
<title>Weather App</title>
</head>
<body class="d-flex h-100 text-center bg-dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.0/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
/>
<link rel="stylesheet" href="../src/style.css" />
<title>Weather App</title>
</head>
<body class="d-flex h-100 text-center bg-dark">
<div class="cover-container d-flex w-100 h-100 px-3 flex-column">
<header class="d-flex flex-wrap justify-content-center py-3 align-items-center">
<button class="btn btn-primary btn-lg" type="button" id="newButton">
Enter Location
</button>
</header>
<center>
<main class="col-sm-4 py-3"></main>
</center>
<header
class="d-flex flex-wrap justify-content-center py-3 align-items-center"
>
<button class="btn btn-primary btn-lg" type="button" id="newButton">
Enter Location
</button>
</header>
<center>
<main class="col-sm-4 py-3"></main>
</center>
</div>
<script type="module" src="/dist/main.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.9.2/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.0/js/bootstrap.min.js"></script>
</body>
</html>
<script type="module" src="dist/main.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.9.2/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.1.0/js/bootstrap.min.js"></script>
</body>
</html>

View file

@ -85,12 +85,12 @@ const populateOutputWindow = (weatherData) => {
new RegExp("(?<=/)[0-9]+(?=x)", "gi"),
"128"
);
console.log(currentIconURL);
currentIconURL = currentIconURL.replace(
new RegExp("(?<=x)[0-9]+(?=/)", "gi"),
"128"
);
console.log(currentIconURL);
// add http to currentIconURL
currentIconURL = "http:" + currentIconURL;
// display icon
weatherIcon.src = currentIconURL;
outputContainer.appendChild(weatherIcon);