Log In
Flying Weather Castform Don't have an account yet? Register now!
.

Forum Thread

Royal Tunnel Type Gifs Alt

Forum-Index Suggestions Royal Tunnel Type Gifs Alt
SwampFall
OFFLINE
Trainerlevel: 59

Forum Posts: 604
Posted: Wed, 28/02/2018 04:07 (6 Years ago)
Show the type () as text before the image is loaded
Examples:
SVG: Which of these is a -Pokémon?
SVG advanced: Which of these is a -Pokémon? (yes this is pure text)
HTML: Which of these is a dragon-Pokémon

From here on this is directed to Riako
There are several ways to do this:
background text with svg, base64
Which of these is a <img src="img/type_icons/dragon.gif" style="min-width:32px; min-height:14px; background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIxNCI+PHRleHQgeD0iMCIgeT0iMTEiIGZvbnQtc2l6ZT0iMTQiIGZpbGw9ImJsYWNrIiB0ZXh0TGVuZ3RoPSIzMiI+ZHJhZ29uPC90ZXh0Pjwvc3ZnPg==');"><b>-Pokémon</b>?
Advantages:
Text will always be the same width as the image
Disadvantages:
Need a different "background-image" for every type
Note:
I will provide all base64 strings you need if prefering this option. The font can be changed obviously.

Using HTML + javascript
Which of these is a <img id="type1" alt="dragon"><b>-Pokémon</b>?
<script>
var img = document.getElementById("type1");
var typeImg = new Image();
typeImg.onload = function() {
&nbsp; &nbsp; img.src = this.src;
}
typeImg.src = "https://pokeheroes.com/img/type_icons/dragon.gif";
</script>
Advantages:
Pretty flexible (1 piece of code for all types)
Disadvantages:
There's the icon infront of the text
Text doesn't have a fixed length so there will be some text shifting going on when the images are loaded.
Fernsong
OFFLINE
Trainerlevel: 57

Forum Posts: 877
Posted: Wed, 28/02/2018 04:22 (6 Years ago)
Yes, full support.
So many times I've failed because the image doesnt load.