Select Page

Category: Article

New CSS Features Are Enhancing Everything You Know About Web Design

We just hit you with a slab of observations about CSS Grid in a new post by Manuel Matuzo. Grid has been blowing our minds since it was formally introduced and Jen Simmons is connecting it (among other new features) to what she sees as a larger phenomenon in the evolution of layouts in web design. From Jeremy Keith’s notes on Jen’s talk, “Everything You Know About Web Design Just Changed ” at An Event Apart Seattle 2018: This may be the sixth such point in the history of the web. One of those points where everything changes and...

Read More

List Rendering and Vue’s v-for Directive

List rendering is one of the most commonly used practices in front-end web development. Dynamic list rendering is often used to present a series of similarly grouped information in a concise and friendly format to the user. In almost every web application we use, we can see lists of content in numerous areas of the app. In this article we’ll gather an understanding of Vue’s v-for directive in generating dynamic lists, as well as go through some examples of why the key attribute should be used when doing so. Since we’ll be explaining things thoroughly as we start to...

Read More

Displaying the Weather With Serverless and Colors

I like to jog. Sometimes it’s cold out. Sometimes it’s cold out, but it looks like it isn’t. The sun is shining, the birds are chirping. Then you step outside in shorts and a t-shirt and realize you have roughly 2 minutes before exposure sets in. I decided to solve this first world problem using a lightbulb to display a certain color based on what the temperature outside is. It works better than I expected, and that’s saying something because usually nothing works out like I want it to. This was a fun project to build, and since it...

Read More

Simple Swipe With Vanilla JavaScript

I used to think implementing swipe gestures had to be very difficult, but I have recently found myself in a situation where I had to do it and discovered the reality is nowhere near as gloomy as I had imagined. This article is going to take you, step by step, through the implementation with the least amount of code I could come up with. So, let’s jump right into it! The HTML Structure We start off with a .container that has a bunch of images inside: ... Basic Styles We use display: flex to make sure images go alongside each other with no spaces in between. align-items: center middle aligns them vertically. We make both the images and the container take the width of the container’s parent (the body in our case). .container { display: flex; align-items: center; width: 100%; img { min-width: 100%; /* needed so Firefox doesn't make img shrink to fit */ width: 100%; /* can't take this out either as it breaks Chrome */ } } The fact that both the .container and its child images have the same width makes these images spill out on the right side (as highlighted by the red outline) creating a horizontal scrollbar, but this is precisely what we want: The initial layout (see live demo). Given that not all the images have the same dimensions and aspect ratio,...

Read More

Keep Pixelated Images Pixelated as They Scale

This is a little reminder that there is a CSS property for helping control what happens to images as they scale up: image-rendering. We’re quite used to the idea that scaling an image larger than its natural size (upscaling) causes it to be blurry. As awful as that is, it’s the browser doing the best it can to algorithmically smooth out an image over more pixels than it has data. But let’s say you’d really rather not it do that. Say the image is already pixel-y (pixel art), or you prefer the look of a pixelated upscaling. You can do it! img { image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; } It’s a bit awkward in that the spec offers three values: auto, pixelated, and crisp-edges. Both pixelated and crisp-edges, for pixel art, appear to do the same thing to me, although the spec talks about them slightly differently (pixelated recommends the “nearest neighbor” or similar algorithm while crisp-edges isn’t as specific). Adding to the awkwardness, Chrome only supports pixelated and Firefox only supports crisp-edges, and for the deepest browser support, you gotta prefix it to -moz-crisp-edges. Fortunately, you can smash them all together and it seems fine. Here’s an example with and without, using an image from James T. I found on Tumblr: See the Pen pixelated images by Chris Coyier (@chriscoyier) on CodePen. The post Keep Pixelated Images...

Read More
000webhost logo