DISCLAIMER: UnSplash Pro is in no way legally related to UnSplash
Before we begin, I'd like to emphasis that the Pro
in UnSplash Pro
stands for Programmer
and not ...pro(whatever that stands for😝).
You see programmers have certain characteristics attributes:
- They are super lazy
- They love
ctrl+c
&ctrl+v
- They hate choosing colors and pictures
They hate needing to go out just to snap, edit and process pictures so they can use it in some website (like whoTF even does that anyways😂)
The point is they hate even doing these series of ultra simple steps:
- Choose pic from UnSplash
- Downloading pic from UnSplash
- Move downloaded pic to the project repo
- Type
<img src="./pathToPic"/>
(and not to mention the alt)
It'd be like heaven if they had a tool of sorts that they could just copy the whole <img/>
tag from.
and that's the problem UnSplash Pro solves.
Contrary to your belief, this is actually a really simple project Check It Out @ UnSplash Pro
- React: So I could reuse a few of my previously built stuff
- FlexBox: Come on that's my greatest flex💪, I can't do any CSS without it
Now I've used class components for the whole project. I know I'm prolly the only person alive who still uses class components.
I have my reasons so here me out on this: Hooks makes the whole thing easier, but you only understand components, when you know what's going on under the hood and hence the project was built with class components.
It's really just a template string copied to the clipboard. with the imageURL and description are from the unSplash API
Don't worry unSplash Pro has got you covered.
-
The Download This is kinda complex but still pretty easy. It uses filesaver.js that converts the image to a blob and then sent into your downloads folder. The first argument to
filesaver.saveAs()
is the path/URL of the image, while the second argument specifies the name of the to-be-downloaded file. -
Copy URL This one is almost exactly the same way we copy HTML code snippets
I think now's the best time to apologize...
I'm super sorry for including images of the code, as a programmer I know you'd be wanting to be able to ctrl+c
&ctrl+v
, but I'm a programmer too and I'm too lazy to
- Go Up
- Delete the Images
- Make
- Pasted the Code
If you had fun reading this... here's my @twitter and @insta Smash that 👍 button (even tho it doesn't exist on dev.to)