Wszystkie wpisy, których autorem jest admin

How are the `colspan` and `rowspan` attributes different?

Post pobrano z: How are the `colspan` and `rowspan` attributes different?

Yes, yes. Functionally, they are different. But heck if I didn’t know about the wacky thresholds until Jens Oliver Meiert tooted a pair of quick polls.

According to the HTML Standard:

  1. If the current cell has a colspan attribute, then parse that attribute’s value, and let colspan be the result.
    If parsing that value failed, or returned zero, or if the attribute is absent, then let colspan be 1, instead.
    If colspan is greater than 1000, let it be 1000 instead.
  2. If the current cell has a rowspan attribute, then parse that attribute’s value, and let rowspan be the result.
    If parsing that value failed or if the attribute is absent, then let rowspan be 1, instead.
    If rowspan is greater than 65534, let it be 65534 instead.

I saw the answers in advance and know I’d have flubbed rowspan. Apparently, 1000 table columns are plenty of columns to span at once, while 65534 is the magic number for clamping how many rows we can span at a time. Why is the sweet spot for rowspan 6,4543 spans greater than colspan? There are usually good reasons for these things.

What that reason is, darned if I know, but now I have a little nugget for cocktail chatter in my back pocket.


How are the `colspan` and `rowspan` attributes different? originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

On the Ground at Frostapalooza

Post pobrano z: On the Ground at Frostapalooza

I can’t say I would have ever expected to see Jeremy Keith performing the Yeah Yeah Yeahs song “Maps”, but then again, I don’t know what I expected to happen at Frostapalooza.

The Event

Brad Frost, web designer, author of Atomic Design, and an absolute maniac on the bass, celebrated his birthday by putting together a one-night-only benefit concert featuring musical performances by himself and his talented family and friends.

Frostapalooza, held at Mr. Smalls Theatre in Pittsburgh, PA, was an all-ages event where 100% of the proceeds are headed towards two great causes:

  • NextStep Pittsburgh: Helping provide accessible rehabilitation for folks with spinal cord injuries and paralysis in Pittsburgh.
  • Project Healthy Minds: Providing research and resources to help tackle mental health.

Performances

The variation of musical performances sprawled across the night, covering tracks by Fleetwood Mac, Radiohead, David Bowie and so much more, check out this setlist of all 31 tracks on Spotify.

I loved the performance of Pink Floyd’s classic song, “Money.” As a Floyd fan who will never get to see them live, this was easily the best rendition I could ask for, which included the full lineup of instrumental sections.

Brad was joined on stage by none other than CSS-Tricks founder, Chris Coyier. Chris picked banjo on a few songs, such as Johnny Cash’s “Folsom Prison Blues” and The Band’s “The Weight,” both fantastic.

The stage background prominently displayed visuals out of CodePen demos made by CodePen community members during the set. Check out the Frostapalooza tag on CodePen to see everything that was projected.

Another favorite moment was Brad’s version of “Wake Up” by Arcade Fire, which felt like a perfectly matched song for the evening.

Musicians

If you haven’t caught on yet, many of the folks lending their musical talents to Frostapalooza also happen to be web designers and developers Brad has met and worked with during his career. At times it felt like the Wu-Tang Clan of CSS on stage.

Brad’s family and musicians from his other bands pitched in, such as Elby Brass. Ridiculously impressive! I had never seen a tuba-playing lead vocalist until this night.

You can see the full lineup on the event’s website. But I’ll drop a screenshot in here just for posterity.

Full lineup of musicians who performed at Frostapalooza.

Photos! Videos!

Mike Aparicio captured a great video of a group jam on Queen’s “Bohemian Rhapsody” that you’ve got to watch on YouTube. Brian Kardell nabbed this gem of Chris pickin’ on “The Weight”:

Party boy Brad Frost shared a bunch of other photos from the event in a Google Photos album.

The end

Plain and simple, this was a super fun night celebrating music and friends. Happy birthday, Brad, and thanks for putting on an awesome show!


On the Ground at Frostapalooza originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

All About JavaScript Loops

Post pobrano z: All About JavaScript Loops

Every programming language has loops. Loops perform an operation (i.e., a chunk of work) a number of times, usually once for every item in an array or list, or to simply repeat an operation until a certain condition is met.

JavaScript in particular has quite a few different types of loops. I haven’t even used all of them, so for my own curiosity, I thought I’d do a high-level overview of them. And as it turns out, there are pretty good reasons I haven’t used at least a couple of the different types.

So, for now let’s spend a while exploring the different types of loops, what we can do with each of one, and why you might use one over another. (You’ll think that little play on words is absolutely hilarious by the end.)

The while and do...while loops

First up is the while loop. It’s the most basic type of loop and has the potential to be the easiest to read and the fastest in many cases. It’s usually used for doing something until a certain condition is met. It’s also the easiest way to make an infinite loop or a loop that never stops. There is also the do...while statement. Really, the only difference is that the condition is checked at the end versus the beginning of each iteration.

// remove the first item from an array and log it until the array is empty
let queue1 = ["a", "b", "c"];

while (queue1.length) {
  let item = queue1.shift();

  console.log(item);
}

// same as above but also log when the array is empty
let queue2 = [];

do {
  let item = queue2.shift() ?? "empty";

  console.log(item);
} while (queue2.length);

The for loop

Next is the for loop. It should be the go to way to do something a certain number of times. If you need to repeat an operation, say, 10 times, then use a for loop instead. This particular loop may be intimidating to those new to programming, but rewriting the same loop in the while-style loop can help illustrate the syntax make it easier to stick in your mind.

// log the numbers 1 to 5
for (let i = 1; i <= 5; i++) {
  console.log(i);
}

// same thing but as a while loop
let i = 1; // the first part of a for loop

// the second
while (i <= 5) {
  console.log(i);

  i++; // the third
}

("end");

The for...of and for await...of loops

A for...of loop is the easiest way to loop through an array.

let myList = ["a", "b", "c"];

for (let item of myList) {
  console.log(item);
}

They aren’t limited to arrays though. Technically they can iterate through anything that implements what is called an iterable protocol. There are a few built-in types that implement the protocol: arrays, maps, set, and string, to mention the most common ones, but you can implement the protocol in your own code. What you’d do is add a [Symbol.iterator] method to any object and that method should return an iterator. It’s a bit confusing, but the gist is that iterables are things with a special method that returns iterators; a factory method for iterators if you will. A special type of function called a generator is a function that returns both a iterable and iterator.

let myList = {
  *[Symbol.iterator]() {
    yield "a";
    yield "b";
    yield "c";
  },
};

for (let item of myList) {
  console.log(item);
}

There is the async version of all the things I just mentioned: async iterables, async iterators, and async generators. You’d use an async iterable with for await...of.

async function delay(ms) {
  return new Promise((resolve) => {
    setTimeout(resolve, ms);
  });
}

// this time we're not making an iterable, but a generator
async function* aNumberAMinute() {
  let i = 0;

  while (true) {
    // an infinite loop
    yield i++;

    // pause a minute
    await delay(60_000);
  }
}

// it's a generator, so we need to call it ourselves
for await (let i of aNumberAMinute()) {
  console.log(i);

  // stop after one hour
  if (i >= 59) {
    break;
  }
}

One unobvious thing about for await...of statement is that you can use it with non-async iterables and it will work just fine. The reverse, however, is not true; you can’t use async iterables with the for...of statement.

The forEach and map loops

While these are not technically loops per se, you can use them to iterate over a list.

Here is the thing about the forEach method. Historically it was much slower than using a for loop. I think in some cases that may not be true anymore, but if performance is a concern, then I would avoid using it. And now that we have for...of I’m not sure there is much reason to use it. I guess the only reason that it still may come up is if you have a function ready to use as the callback, but you could easily just call that same function from inside the body of for...of.

forEach also receives the index for each item though, so that may be a thing you need too. Ultimately, the decision to use it will probably come down to whether any other code you’re working with uses it, but I personally would avoid using it if I’m writing something new.

let myList = ["a", "b", "c"];

for (let item of myList) {
	console.log(item);
}

// but maybe if I need the index use forEach
["a", "b", "c"].forEach((item, index) => {
  console.log(`${index}: ${item}`);
});

Meanwhile, map essentially converts one array into another. It still has the same performance impact that forEach has, but it is a bit nicer to read than the alternative. It’s certainly subjective though, and just like with forEach you’ll want to do what the rest of your other code is doing. You see it a ton in React and React-inspired libraries as the primary way to loop through an array and output a list of items within JSX.

function MyList({items}) {
  return (
    <ul>
      {items.map((item) => {
        return <li>{item}</li>;
      })}
    </ul>
  );
}

The for...in loop

This list of loops in JavaScript wouldn’t be complete without mentioning the for...in statement because it can loop through the fields of an object. It visits fields that are inherited through the object’s prototype chain too, though, and I’ve honestly always avoided it for that reason.

That said, if you have an object literal, then for...in might be a viable way to iterate through the keys of that object. Also it’s worth noting that if you’ve been programming JavaScript for a long time, you may remember that the order of keys use to be inconsistent between browsers, but now the order is consistent. Any key that could be an array index (i.e., positive integers) will be first in ascending order, and then everything else in the order as authored.

let myObject = {
  a: 1,
  b: 2,
  c: 3,
};

for (let k in myObject) {
  console.log(myObject[k]);
}

Wrapping up

Loops are something that many programmers use every day, though we may take them for granted and not think about them too much.

But when you step back and look at all of the ways we have to loop through things in JavaScript, it turns out there are several ways to do it. Not only that, but there are significant — if not nuanced — differences between them that can and will influence your approach to scripts.


All About JavaScript Loops originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Award-Winning Design Meets Fashion at the Museum at FIT by Lily Liu

Post pobrano z: Award-Winning Design Meets Fashion at the Museum at FIT by Lily Liu

Award-winning graphic and UX/UI designer Lily (Ziqi) Liu has taken her unique blend of traditional and digital design techniques into the fashion world with her award-winning rebranding of the Museum at FIT (Fashion Institute of Technology). As an innovative graphic and UI/UX designer, Liu brought a new twist to the museum’s brand using her digital design skills and an eye for fashion. The impact of her rebrand design and the methods she used to capture the essence of our digital world today while honoring the history of fashion will have a ripple effect.

Liu was interested in fashion, so she selected MFIT and jumped at the chance to help inject youthful and vibrant energy into the MFIT brand. Her design was inspired by classic button patterns. Taking these simple buttons, Liu reimagined them into a fluid geometric framework. They became a metaphor for connection and unity, bring together people and ideas. Liu saw the button as a symbol of embracing diversity, inclusivity, and the spirit of inventive thought, all while keeping within the museum’s ethos.

Liu took her design skills and brought them together with her coding knowledge. She used Processing for a code-driven design, also called generative design. This approach allowed her to write code that can automatically generate patterns, shapes, and visual elements. Liu created unique designs by programming specific algorithms with set parameters. Using code, Liu can easily experiment with new design parameters, such as colors, shape, and movement. Signs, banners, postcards, posters, tickets, and more could be designed quickly and with a far more distinct visual style, like the MFIT rebranding. The code also allows Liu to add movement to her designs instead of merely static images, making them more engaging – using both her designer and UI/UX design sides.

The specific coding Liu used to create the designs was used for the billboards which would change designs throughout the day. 

For her rebrand, Lily (Ziqi) Liu won several awards. In January of 2024, Liu won a Gold at the International Design Awards 2023 for her Museum at FIT rebranding, as well as the MUSE Creative Awards in October 2023. More detailed information on Liu’s MFIT project can be found on her website here.

Her use of generative design indicates our technology-driven world. Instead of fighting against technology as some wanted to do, Liu took hold of that technology and made it her own. As Liu showed in her designs, the generative design is perfect for experimentation and customization. Digital billboards were programmed to change throughout the day, showing different patterns while keeping in line with the new branding. More graphic and UI/UX designers are likely to follow her lead going forward.

Liu is now looking to her future, growing her skills, and seeking challenges for her creativity and puzzle-solving. She works as a designer and continues to seek opportunities for learning, whether through formal education, workshops, or collaborations. Last year, Liu was selected to participate in a Google-sponsored workshop, DesignStorm, to work on future mobile software and user experience.

Lily (Ziqi) Liu is an award-winning graphic and UI/UX designer studying in California. She has received multiple awards for her designs: International Design Awards 2023; Gold for “When Innocence Hurts” Zine Design in January 2024. MUSE Creative Awards: Silver for “When Innocence Hurts” Zine Design in October 2023. She has been recognized on the Provost’s list at the University and was featured in the ArtCenter Student Gallery for her MFIT Branding Design as well as for “In Between” Book Design.

The post Award-Winning Design Meets Fashion at the Museum at FIT by Lily Liu appeared first on Designer Daily: graphic and web design blog.

Essential Tools for Graphic Designers Working Remotely

Post pobrano z: Essential Tools for Graphic Designers Working Remotely

Remote work has become increasingly popular, allowing professionals, including graphic designers, to work from the comfort of their homes or while traveling.

To maintain productivity and deliver high-quality work, graphic designers need the right tools. Here are some essential tools for graphic designers working remotely.

Reliable Hardware

Having reliable hardware is fundamental for any graphic designer. A high-performance computer with a strong processor, ample RAM, and a high-resolution monitor is essential for handling graphic design software.

Additionally, a portable power station is crucial for remote work, especially in areas with unreliable power supplies. These devices ensure that your equipment stays charged and you can continue working without interruptions.

Graphic Design Software

The core of any graphic designer’s toolkit is powerful design software. Adobe Creative Cloud, which includes Photoshop, Illustrator, and InDesign, remains the industry standard.

These applications provide a comprehensive set of tools for creating everything from simple graphics to complex illustrations and layouts.

Digital Drawing Tablets

For graphic designers who create illustrations or digital paintings, a digital drawing tablet is indispensable. Wacom tablets are widely regarded for their precision and pressure sensitivity, making them ideal for detailed artwork.

Cloud Storage Solutions

Cloud storage solutions are vital for remote work, enabling designers to access and share their work from anywhere. Services like Google Drive and OneDrive offer secure storage and easy collaboration with clients and team members.

Cloud storage not only ensures your files are backed up but also facilitates seamless collaboration on projects, no matter where you are.

Communication Tools

Effective communication is essential for remote graphic designers to stay connected with clients and colleagues. Tools like Microsoft Teams and Zoom enable instant messaging, video calls, and file sharing, making it easier to collaborate and receive feedback.

Color Calibration Tools

Accurate color representation is crucial for graphic design. Color calibration tools ensure that the colors you see on your screen match the final printed output.

Devices like the X-Rite i1Display Pro can calibrate your monitor, providing consistent and accurate colors across different devices. This precision is essential for maintaining the quality and consistency of your designs.

Stock Image and Asset Libraries

Access to high-quality stock images, vectors, and other assets can save time and enhance your designs. Websites like Shutterstock and Adobe Stock offer extensive libraries of royalty-free images and graphics.

These resources provide a wide range of options to choose from, allowing you to find the perfect elements for your projects.

Typography Tools

Typography is a critical aspect of graphic design, and having access to a variety of fonts is essential. Tools like Google Fonts and Adobe Fonts offer extensive libraries of free and premium fonts.

These platforms allow you to explore and experiment with different typefaces, ensuring that your designs have the perfect typography to convey your message.

Preparing for the Future of Remote Design Work

Equipping yourself with the right tools is essential for thriving as a remote graphic designer. By investing in reliable hardware, powerful software, and effective communication and collaboration tools, you can maintain productivity and deliver high-quality work from anywhere.

The post Essential Tools for Graphic Designers Working Remotely appeared first on Designer Daily: graphic and web design blog.

5 Modern Devices with Innovative Design Features

Post pobrano z: 5 Modern Devices with Innovative Design Features

Everybody loves a gadget, especially those innovative design features that leave you scratching your head, wondering how nobody thought of that before.

Photo by Daniel Putzer on Pexels

From everyday gadgets to specialized tools, innovative design features are transforming the way we interact with modern devices. Let’s take a look at 5 of the best.

Vape Pen

Vape pens have become huge in recent years thanks to their convenience, portability, and sleek design. One standout feature of modern vape pens is the dual mesh that now comes as standard in all WAKA Vapes. Dual mesh improves the vaping experience by providing more surface area for e-liquid to contact, leading to more even heating. This means better vapour and temperature control, a better taste, and improved coil longevity. It’s vaping, but taken up another gear.

Smart Watches

Smartwatches are another gadget that seems to have gone from 0 to 100mph in the blink of an eye. Beyond just telling time, smartwatches have evolved to become comprehensive health and fitness monitors. One of the most impressive design features is the integration of advanced sensors that track heart rate, blood oxygen levels, and even ECG readings. Add in voice assistants, such as Siri or Google Assistant, and suddenly you can perform tasks hands-free while running down the road. Staying productive has never been so easy.

Wireless Earbuds

Wireless earbuds are everywhere—wires were so in the early 2000s. Look around any modern park, and you’ll be sure to see countless people with little white buds nestled in their ears. These small devices have revolutionized the way we listen to music and take calls on the go. With touch control, where the user simply has to tap the earbud, you can manage their audio experience and answer calls without needing to access their phone.

Foldable Smartphones

Who remembers the old Nokia or Samsung flip phones? Well, who would have thought they would come roaring back in the age of smartphones?

Foldable smartphones represent a significant leap forward (or maybe backwards) in mobile device design. They feature flexible screens that can be folded in half, offering both the portability of a smartphone and the expansive display of a tablet. The hinge mechanism is a critical design component, engineered to withstand thousands of folds without degrading.

Electric Scooters

Love them or hate them, electric scooters are here to stay. Believe it or not, car manufacturer Peugeot designed and released the first electric scooter in 1996, but they have come a long way in such a short span of time.

Modern electric scooters are designed with lightweight, foldable frames that make them easy to carry and store. One of the standout features is the regenerative braking system, which recharges the battery while slowing down, enhancing efficiency.

Final Thoughts

Innovation is booming, and it can sometimes feel difficult to keep up. Who knows what 20 years in the future will look like, but we can be sure it’ll be littered with many more incredible design features in our tech that will make our lives easier, faster, better, or more enjoyable. Whatever’s next—flying cars?

The post 5 Modern Devices with Innovative Design Features appeared first on Designer Daily: graphic and web design blog.