Skip to content

Commit

Permalink
chore: update preview
Browse files Browse the repository at this point in the history
  • Loading branch information
2jun0 committed Jul 12, 2024
1 parent 61bd4fe commit d1b789c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion static/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
const username = formData.get("username");
const width = formData.get("width");
const height = formData.get("height");
const background = formData.get("background");

if (username !== "") {
preview.classList.remove("hidden");

const svgUrl = `https://gitpokecol.org/pokemons/${username}?face=${moving}&width=${width}&height=${height}`;
const svgUrl = `https://gitpokecol.org/pokemons/${username}?face=${moving}&width=${width}&height=${height}&background=${background}`;
previewImg.src = svgUrl;
previewUrl.textContent = `<a href="https://github.com/2jun0/github-pokemon-collection">
<img src="${svgUrl}" alt="${username}'s GitHub Pokemon Collection"/>
Expand Down Expand Up @@ -87,6 +88,19 @@ <h2>Github Pokemon Collection Preivew</h2>
Username:
<input type="text" name="username" placeholder="github username" />
</div>
<div>
Background:
<select name="background">
<option value="none">None</option>
<option value="abyss">Abyss</option>
<option value="badlands">Badlands</option>
<option value="beach">Beach</option>
<option value="cave">Cave</option>
<option value="desert">Desert</option>
<option value="normal">Normal</option>
<option value="plain">Plain</option>
</select>
</div>
<button type="submit">Preview</button>
</form>
<div id="preview" class="hidden">
Expand Down

0 comments on commit d1b789c

Please sign in to comment.