I like writing javascript in a progressive enhancement manner – I assume there is some HTML (DOM) to work with and build my javascript magic around it. Autocomplete or validation for an input? Just grab that input and add event listeners to make users’ lives easier. Pagination without reloading the whole page? Intercept the click […]
Recent Posts
Pixel-perfecting old layouts
Post date February 27, 2021Once I got a task of upgrading an old website and making it responsive. Sounds common enough. Decision was made to migrate data to new CMS but keep the old layout, because the client liked it. And he liked it exactly the way it was – every single pixel of it. So the question is: […]
Responsive vuetify carousel with multiple items per slide
Post date January 15, 2021Today I’ll show you how I used vuetify‘s carousel element to get a result requested by a client. The requirements are defined as follows: images are grouped so that on desktop there are 4 visible at once, on tablet 3 visible at once and on mobile 2 visible at once when the user goes to […]
Writing interactive snowflake generator in plain javascript – Part 2
Post date December 31, 2020This is a continuation of an article about generating snowflakes with plain javascript. In the first part we went through the process of creating a desired snowflake with SVG and ended up with a static result representing an example snowflake. Today we’ll write some javascript to make creating snowflakes interactive. As a reminder, here are […]
calculating coordinates for position:absolute
Post date December 17, 2020You know what custom selects, dropdown menus and tooltips have in common? They all spawn elements, that may be overlapped by other elements if z-index management is done wrong. Why? Let’s have a look. z-index property There are CSS properties that are beginner friendly – like color or font-size. You can apply them to any […]
Different approaches to show/hide toggles
Post date November 10, 2020Showing and hiding parts of DOM is one of those things, that you do with javascript on everyday basis. It is so basic, that most javascript frameworks have it built in from the very beginning. Toggling visibility usually means setting display: none to hide the element and display: block to show it again. Sometimes it […]
WordPress-like action handling in javascript
Post date September 21, 2020I really like the concept of events in javascript. How they can be dispatched and handled, how they bubble and how custom events can have additional details. However, at some point I needed to control the order, in which the handlers got executed. And I could not get it done with events, so I decided to implements a mini wodrpress-like system to handle that case.