Full-stack developer & AI rockstar. LinkedIn: https://bit.ly/2T1LzgW. Official site: https://jacobbergdahl.com/.

650 Followers
·
Follow

A very simple and easy approach to optimizing images for certain resolutions with SvelteJS

There are many attractive features to Svelte’s reactivity. In this article, I’d like to show you a tiny, simple, neat trick to optimize your website’s images for the appropriate device resolution. One of the reasons why so many websites take painfully long to load is due to being packed with high-resolution uncompressed images. Now, I won’t cover image compression in this article (you can compress images using many applications, even online free cloud-based such), but I would like to cover the issue of picking a resolution for your images.

Yes, what resolution should you upload your images in? You want your website to look beautiful for phones with small screens, but you also want it to look good for desktop visitors with high-res computer screens. The issue of having high-resolution images is that load times can get really long. …


I’ve been hooked on SvelteJS recently. This one-man-army of a JavaScript framework is as attractive and active as it is reactive. In this article, I’d love to introduce you to a few basic features of the framework. In 26 lines of code, I will cover some interesting SvelteJS features: reactive declarations, asynchronous API fetches with promises, as well as a few neat Svelte shorthands.

The code that I am about to show you is one that allows users to fetch open-source photos from an external API by entering a search query into a regular old input field. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store