浏览代码

abide by pdb's attribution request

Kirk Trombley 2 年之前
父节点
当前提交
0715284e3f
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 1 1
      index.html
  2. 4 1
      web/main.js

+ 1 - 1
index.html

@@ -88,7 +88,7 @@
         <div class="ellipsis emphasis" bind-to="name"></div>
         <div class="pkmn-info | highlight-border flex even">
           <div class="flex col small-gap">
-            <img bind-to="image" />
+            <a bind-to="link" href=""><img bind-to="image" /></a>
             <div class="center" bind-to="score"></div>
             <button bind-to="totalBtn" class="pkmn-total | color-select"></button>
             <div class="total-info | grid small-gap" bind-to="totalData"></div>

+ 4 - 1
web/main.js

@@ -315,6 +315,9 @@ const createPokemonTile = makeTemplate(
       target.removeEventListener("error", imageErrorHandler);
       target.src = `https://img.pokemondb.net/sprites/scarlet-violet/icon/${spriteName}.png`;
     };
+    const link = {
+      href: `https://pokemondb.net/pokedex/${spriteName}`,
+    };
     const image = {
       alt: formattedName,
       src: `https://img.pokemondb.net/sprites/sword-shield/icon/${spriteName}.png`,
@@ -356,7 +359,7 @@ const createPokemonTile = makeTemplate(
       .reduce((a, b) => ({ ...a, ...b }), {});
     buttonBinds.totalBtn.dataset.included = enableTotalFlags;
 
-    return { name, image, score, ...buttonBinds };
+    return { name, image, link, score, ...buttonBinds };
   }
 );