replace png with webp
29
projects/challange 8/pokedex/v2/convert-images.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const mysql = require("mysql");
|
||||
|
||||
const connection = mysql.createConnection({
|
||||
host: "localhost", // Ensure this points to your local database
|
||||
user: "root",
|
||||
password: "",
|
||||
database: "pokedex1",
|
||||
port: 3306,
|
||||
});
|
||||
|
||||
connection.connect((err) => {
|
||||
if (err) {
|
||||
console.error("Error connecting to the database:", err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log("Connected to the local database.");
|
||||
|
||||
const query = "UPDATE pokemon SET image_url = REPLACE(image_url, '.png', '.webp')";
|
||||
console.log("Executing query:", query);
|
||||
|
||||
connection.query(query, (error, results) => {
|
||||
if (error) {
|
||||
console.error("Error updating image URLs:", error.message);
|
||||
} else {
|
||||
console.log("Image URLs updated successfully. Rows affected:", results.affectedRows);
|
||||
}
|
||||
connection.end();
|
||||
});
|
||||
});
|
||||
@@ -7,6 +7,13 @@
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="./pokemon-detail.js" defer></script>
|
||||
<link rel="icon" href="./assets/pokeball.png" type="image/x-icon">
|
||||
<link rel="preconnect" href="https://example.com" />
|
||||
<link rel="preconnect" href="https://cdn.example.com" />
|
||||
<link rel="preload" as="image" href="./assets/back-to-home.svg" />
|
||||
<link rel="preload" as="image" href="./assets/chevron_left.svg" />
|
||||
<link rel="preload" as="image" href="./assets/chevron_right.svg" />
|
||||
<link rel="preload" as="image" href="./assets/weight.svg" />
|
||||
<link rel="preload" as="image" href="./assets/height.svg" />
|
||||
</head>
|
||||
<body>
|
||||
<main class="detail-main main">
|
||||
|
||||
|
Before Width: | Height: | Size: 199 KiB |
BIN
projects/challange 8/pokedex/v2/images/1.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 170 KiB |
BIN
projects/challange 8/pokedex/v2/images/10.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 178 KiB |
BIN
projects/challange 8/pokedex/v2/images/100.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 97 KiB |
BIN
projects/challange 8/pokedex/v2/images/1000.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 160 KiB |
BIN
projects/challange 8/pokedex/v2/images/1001.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 133 KiB |
BIN
projects/challange 8/pokedex/v2/images/1002.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 126 KiB |
BIN
projects/challange 8/pokedex/v2/images/1003.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 100 KiB |
BIN
projects/challange 8/pokedex/v2/images/1004.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 143 KiB |
BIN
projects/challange 8/pokedex/v2/images/1005.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 130 KiB |
BIN
projects/challange 8/pokedex/v2/images/1006.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 154 KiB |
BIN
projects/challange 8/pokedex/v2/images/1007.webp
Normal file
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 111 KiB |
BIN
projects/challange 8/pokedex/v2/images/1008.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 111 KiB |
BIN
projects/challange 8/pokedex/v2/images/1009.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 186 KiB |
BIN
projects/challange 8/pokedex/v2/images/101.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 98 KiB |
BIN
projects/challange 8/pokedex/v2/images/1010.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 152 KiB |
BIN
projects/challange 8/pokedex/v2/images/102.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 166 KiB |
BIN
projects/challange 8/pokedex/v2/images/103.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 153 KiB |
BIN
projects/challange 8/pokedex/v2/images/104.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 131 KiB |
BIN
projects/challange 8/pokedex/v2/images/105.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 94 KiB |
BIN
projects/challange 8/pokedex/v2/images/106.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 107 KiB |
BIN
projects/challange 8/pokedex/v2/images/107.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 183 KiB |
BIN
projects/challange 8/pokedex/v2/images/108.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 150 KiB |
BIN
projects/challange 8/pokedex/v2/images/109.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 116 KiB |
BIN
projects/challange 8/pokedex/v2/images/11.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 145 KiB |
BIN
projects/challange 8/pokedex/v2/images/110.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 180 KiB |
BIN
projects/challange 8/pokedex/v2/images/111.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 134 KiB |
BIN
projects/challange 8/pokedex/v2/images/112.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 150 KiB |
BIN
projects/challange 8/pokedex/v2/images/113.webp
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 217 KiB |
BIN
projects/challange 8/pokedex/v2/images/114.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 179 KiB |
BIN
projects/challange 8/pokedex/v2/images/115.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 138 KiB |
BIN
projects/challange 8/pokedex/v2/images/116.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 125 KiB |
BIN
projects/challange 8/pokedex/v2/images/117.webp
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 102 KiB |
BIN
projects/challange 8/pokedex/v2/images/118.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 170 KiB |
BIN
projects/challange 8/pokedex/v2/images/119.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 179 KiB |
BIN
projects/challange 8/pokedex/v2/images/12.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 154 KiB |
BIN
projects/challange 8/pokedex/v2/images/120.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 194 KiB |
BIN
projects/challange 8/pokedex/v2/images/121.webp
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 157 KiB |
BIN
projects/challange 8/pokedex/v2/images/122.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 128 KiB |
BIN
projects/challange 8/pokedex/v2/images/123.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 152 KiB |
BIN
projects/challange 8/pokedex/v2/images/124.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 131 KiB |
BIN
projects/challange 8/pokedex/v2/images/125.webp
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 155 KiB |
BIN
projects/challange 8/pokedex/v2/images/126.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 139 KiB |
BIN
projects/challange 8/pokedex/v2/images/127.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 126 KiB |
BIN
projects/challange 8/pokedex/v2/images/128.webp
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 134 KiB |
BIN
projects/challange 8/pokedex/v2/images/129.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 106 KiB |
BIN
projects/challange 8/pokedex/v2/images/13.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 143 KiB |
BIN
projects/challange 8/pokedex/v2/images/130.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 133 KiB |
BIN
projects/challange 8/pokedex/v2/images/131.webp
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 126 KiB |
BIN
projects/challange 8/pokedex/v2/images/132.webp
Normal file
|
After Width: | Height: | Size: 8.3 KiB |