You know those times when you work on a web dev project, and need an image in 300x250px real quick?
Or maybe you need a placeholder for your avatar photos, while the project is still in development.
This weekend I put together something to make everyone's web dev process a bit more breathtaking. Some might've seen it featured on ProductHunt yesterday, but since everyone seemed to love it so much there, I wanted to share it with you guys as well. ❤️
PlaceKeanu.com is a placeholder image service based on—you guessed it—Keanu Reeves!
I mean just look at him. How could this not be a thing already?
Simply paste a link in this format, wherever you need to Keanu it up:
If you don't pass in a height, the size will be a square based on the
- Young Keanus only:
- Grayscale Keanus:
- Young Keanu: https://placekeanu.com/500/300/y
- Square + Grayscale: https://placekeanu.com/250/g
- Young + Grayscale: https://placekeanu.com/300/550/yg
So if you want to use a Keanu on your website, you could for instance include him with an
<img>, like this:
<img src="https://placekeanu.com/350/500" alt="">
Not bad, huh?
While most placeholder image services dynamically create images for every request, I found a way to achieve the same result using SVGs.
Basically, when you visit a page, say
/200/300, an SVG with
height="300" is returned, together with a random image of Keanu. All images are coded in Base64 to get it working properly.
There are some other magic involved as well, like automatic centering and choice of a vertical or horizontal Keanu, based on your request, so that he won't get cut off as often.
The source code for the project is of course available on GitHub, so please check it out here! 🙂
I would love to hear your thoughts about this, and any feature requests you might have. Post a comment below, or send me a tweet on Twitter (@alexandberg)!
And let me know if you would like a more in-depth explanation of how I built this—using Express together with Netlify Functions—and I'll write something up!
But for now, please enjoy the lovely and wholesome Keanu! ❤️
Oh, and btw, I just created a listing with a very interesting (and for me, lifechanging) opportunity. It would mean the world to me if you shared my tweet about it. ☺️
Alexander Sandberg@alexandbergI just posted a listing on @DEVListings! 👀
"Looking for company to work with on Master's thesis project in Front-end, UX, and/or Accessibility"
This will be a huuuge next step in my career and life. I would be forever grateful if anyone shared this. ❤️22:17 PM - 11 Jul 2019