10 Creative Code Examples of Media Player Design

With the power of HTML5 and the ease adding multimedia through technologies such as WordPress oEmbed, anyone can add compelling video or audio content to their website. And, while it’s great that default media players are included from a purely functional standpoint, so much more can be done to improve the user experience.

The default player may provide basic functionality, but it doesn’t necessarily match your branding or offer some more advanced features. So designers have taken it upon themselves to add creative flair, along with high-end functionality to create some incredibly unique media players. Take a look at some of our favorites below and feel free to experiment with the source code.

The Web Designer Toolbox
Unlimited Downloads: 500,000+ Web Templates, Themes, Plugins & Design Assets

DOWNLOAD NOW

Audio Players

Round and Beautiful

This circular audio player from Sebastian Beltz puts the straight edges of a standard media player to shame. It’s quite beautiful to look at, intuitive and the inclusion of sharing/favorite buttons makes it a more complete UI.

Draggable Playlist

The fact that you can drag this audio player around your screen is cool. But even better is the simple and smart UI that Antoinette Janus has created. Scrolling through the playlist and playing the selected track is quick and painless.

Accessibility Built In

It’s a simple player, indeed. But Joe Watkins has added in a terrific alternative UI for accessibility. The text-based buttons for play and pause ensure that anyone can consume the media. The ability to view a transcript is just brilliant.

Material Design Comes to Audio

Michael Zhigulin’s use of Material Design on this player is outstanding. From the popular “card” layout to the smooth animations, it fits in nicely with Google’s standard.

Spinning Some Vinyl

The concept here is just too cool. Matt Stvartak’s player is basic in functionality, but the rotating vinyl that pops out of the sleeve is a standout design.

Video Players

Smooth and Responsive

Part of the idea behind HTML5 media was to ensure that mobile devices were able …

Inclusively Hidden

Scott O’Hara recently published “Inclusively Hidden,” a nice walkthrough of the different ways to hide things on the web. Nothing is ever cut and dry when it comes to the web! What complicates this is that hidden begs the question: hidden for whom? Different answers to that have different solutions:

  • Hidden for everyone? display: none; or visibility: hidden; or the hidden attribute. (But watch out for that hidden attribute, says Monica Dinculescu.)
  • Hidden visually, but present for assistive tech? A .screen-reader-only class with a smattering of properties to do the job correctly.
  • Hidden for assistive tech, but not visually? The aria-hidden="true" attribute/value.

It’s worth grokking all this because it’s is a perfect example of why HTML and CSS is not some easy bolt-on skill for front-end web development. This is critical stuff that isn’t done as correctly as it should be.

If you like video, I did one called “Hiding Things with CSS” that goes over a lot of this.


As I write this, I’m freshly back from Smashing Conf in San Francisco. Sara Soueidan had a wonderful talk that covered some “hiding things” situations that are even less intuitive than what we might be accustomed to seeing.

One thing she covered was the inert attribute and how it can be used to skip interactive elements from keyboard tabbing. It can even be used on a parent element, nullifying everything inside it. I understood that part, but not entirely why it’s useful since it seems like you might as well use display: none; if an element is hidden and the elements inside aren’t meant to be in focus. But I’m sure it’s my lack of understanding, so I’m looking forward to Sara’s video to come out so I can re-watch it. It had to do with maintaining a non-awkward tabbing order.

Another thing Sara covered is that some folks who use assistive technology also tend to explore touch screens with haptics, moving about the page with their fingers looking for interactive elements. If you, say, replace a native …

Tabs: It’s Complicated™

I’ve said before one quick and powerful thing you can learn as a front-end developer just getting starting with JavaScript is changing classes.

const button = document.querySelector(".my-button");
const element = document.querySelector(".content");

button.addEventListener("click", function() {
  element.classList.toggle("sparkles");
});

We could use that skill to build some tabs, right? Right.

We got this.

Say we have this changing classes ability in our skillset now and we need to build a tabbed interface. If we just add a little more code that deals with click handlers, we could probably wire up some simple tabs, like this:

See the Pen
XQpqZV
by Chris Coyier (@chriscoyier)
on CodePen.

Totally functional tabs. I might pat myself on the back a little here. See how I used those anchor links to create jump links between the link and the tabbed section? That’s mighty semantic, don’t you think? The tabs are accessible with a keyboard, have focus styles, and can be activated with the Return key.

Did we win? Case closed? Perfect tabs?

Nothing is ever so easy, is it?

One issue here is that we didn’t do anything special with keyboard handling, which tabbed interfaces may require. Heydon Pickering wrote about this:

Unlike a same-page link, a tab does not move the user to the associated section/panel of content. It just reveals the content visually. This is advantageous to sighted users (including sighted screen reader users) who wish to flit between different sections without having to wade back up the page each time they want to choose a new one.

This comes with an unfortunate side effect: If the user wishes to move to a section by keyboard and interact with its internal content, they have to step through any tabs to the right of the current tab, which are in focus order.

Turns out there is a whole checklist of other behavioral things tabs interfaces can and should be doing. In Heydon’s explanation, the Tab key actually acts as a way to jump from the tab itself to the content related to …

How to Get a Progressive Web App into the Google Play Store

PWA (Progressive Web Apps) have been with us for some time now. Yet, each time I try explaining it to clients, the same question pops up: “Will my users be able to install the app using app stores?” The answer has traditionally been no, but this changed with Chrome 72 which shipped a new feature called TWA (Trusted Web Activities).

Trusted Web Activities are a new way to integrate your web-app content such as your PWA with yourAndroid app using a protocol based on Custom Tabs.

In this article, I will use Netguru’s existing PWA (Wordguru) and explain step-by-step what needs to be done to make the application available and ready to be installed straight from the Google Play app store.

Some of the things we cover here may sound silly to any Android Developers out there, but this article is written from the perspective of a front-end developer, particularly one who has never used Android Studio or created an Android Application. Also, please do note that a lot of what we’re covering here is still extremely experimental since it’s limited to Chrome 72.

Step 1: Set up a Trusted Web Activity

Setting up a TWA doesn’t require you to write any Java code, but you will need to have Android Studio. If you’ve developed iOS or Mac software before, this is a lot like Xcode in that it provides a nice development environment designed to streamline Android development. So, grab that and meet me back here.

Create a new TWA project in Android Studio

Did you get Android Studio? Well, I can’t actually hear or see you, so I’ll assume you did. Go ahead and crack it open, then click on “Start a new Android Studio project.” From there, let’s choose the “Add No Activity” option, which allows us to configure the project.

The configuration is fairly straightforward, but it’s always good to know what is what:

  • Name The name of the application (but I bet you knew that).
  • Package name: An identifier for Android

Weekly News for Designers № 484

Forge Your Own (Animation) Path with These Snippets – Creative examples of path-based web animations.
Forge Your Own (Animation) Path with These Snippets

Animation Performance 101: Browser Under the Hood – Techniques for attaining 60fps animations without taxing web browsers.
Animation Performance 101: Browser Under the Hood

Top Font Combinations – A look at some perfect font pairings for your projects.
Top Font Combinations

CSS masonry with flexbox, :nth-child(), and order – A smart approach to masonry layouts that doesn’t require JavaScript.
CSS masonry with flexbox, :nth-child(), and order

Front-end Developer Handbook 2019 – A massive resource you can use to further your front-end skills.
Front-end Developer Handbook 2019

The Four Ways That Freelancers Are Often Mistreated – Ways to fight back when clients try to take advantage of you.
The Four Ways That Freelancers Are Often Mistreated

Generative Art with CSS – A variety of techniques for creating art with pure CSS.
Generative Art with CSS

The process: Building a better checkout – How Paystack reimagined its checkout experience to better serve Africa-based users.
The process: Building a better checkout

Art Direction For The Web Using CSS Shapes – Build unique layouts with the help of CSS shapes.
Art Direction For The Web Using CSS Shapes

The Battle of Stability vs. Growth – Every designer wants a steady workflow (and income). But how does that affect future growth?
The Battle of Stability vs. Growth

Long-form websites and typography – A mix of philosophies on making long-form content easy to read and withstand the test of time.
Long-form websites and typography

The junior developer’s guide to writing super clean and readable code – Learn the secrets behind writing code that is focused and easy to read.
The junior developer’s guide to writing super clean and readable code

Why you should use CSS env() – With env(), you’ll be able to share variables between CSS and JS.
Why you should use CSS env()

Simple Ways to Customize WordPress Plugins – You don’t have to be an expert to add custom functionality to an existing plugin.
Simple Ways to Customize WordPress Plugins

Diagonal Containers in CSS – Create those trendy full-width diagonal containers with clip-path.
Diagonal Containers in CSS

Public Sans – A free neutral typeface for all of your UI needs.
Public Sans

Developer Survey Results 2019 – Stack Overflow’s yearly look at what developers are learning and doing.
Developer Survey Results 2019

Illustrated.dev – Web development concepts explained through friendly illustrations.
Illustrated.dev

Exploring the Simple Beauty of Business Cards with Geometric Designs – A look at how some simple shapes can deliver stunning results.
Exploring the Simple Beauty of Business Cards with Geometric Designs

Follow Speckyboy on …

6 Tips for Posting Content Anonymously

For one reason or another, you may find yourself wanting to publish things online anonymously. Now to some, the “A-word” conjures up images of hackers, Guy Fawkes masks, and people generally saying terrible things to each other on Twitter. There’s long been an ongoing debate about whether anonymity is something that should even be allowed on the Internet.

Yes. Yes it should. There’s no doubt that there are terrible people in the world; but anonymity is a powerful tool for good as well. Here are some of the more obvious examples:

  • Fighting the power: It sure would be nice if we lived in a world where everyone in every government had the people’s best interests at heart. We don’t, and they don’t. Ask Nelson Mandela, or any number of other great men and women throughout history who have fought for progress and human rights.
  • Exposing criminal activity: Whether you’re a crime blogger writing about the criminal underworld, or a whistleblower from some large corporation, exposing criminal activity is dangerous. People have died.
  • Adult content, and other “culturally offensive” themes: Something as simple as writing your own (very personal) memoirs can draw a lot of unwanted attention from those around you. Even if what you’re doing isn’t morally or ethically wrong by any reasonable standard, people aren’t always terribly understanding. And then, perhaps the people in your life would rather that their personal activities didn’t become public knowledge. Staying anonymous is a good way to avoid unnecessary drama, in cases like these.
  • Maybe it’s just work: One of my favorite blogs back in the day was Waiter Rant where a then-anonymous waiter told all of his juiciest stories. He stayed anonymous for the simple reason that his bosses didn’t want any extra drama at their restaurant. Besides, rude customers who might’ve just been having a really bad day don’t deserve the kind of hate the Internet can put out.
  • Not holding back: Webdesigner Depot runs a series of posts written anonymously called The Secret Designer. They’re anonymous, because

22+ Best Fonts for Signs

Whether you’re working on a sign design for a coffee shop or a luxury boutique, choosing the right font for your sign will go a long way to make your signage look more professional and unique.

When designing different types of signs, you are often forced to work with specific standards and font layouts. But, that doesn’t mean you can’t get creative and use unique fonts in your designs.

Finding a great font usually means spending hours scouring the web and getting disappointing results. To help you save time and find a creative and stylish font more quickly, we handpicked the best fonts for signs (for all kinds of businesses and shops).

NORMAL – Minimal Sans Serif Typeface

NORMAL - Minimal Sans Serif Typeface

If you’re working on a signage design for a modern business or a luxury brand, this font will help you make a minimal and attractive sign with a clean design. It comes in 5 different font weights ranging from extra light to extra bold. The font comes with a web font version as well.

GATSBY – Unique Display Font

GATSBY - Unique Display Font

Featuring a mix of modern and vintage looks, Gatsby is a stylishly minimalist font you can use to design unique signage for luxury and apparel brands. The font comes in 4 different styles, including normal, outline, retro, and distorted.

Boomerang Script – Signage Font

Boomerang Script - Signage Font

Boomerang is a fun and creative font with an attractive design. It includes both uppercase and lowercase letters featuring handbrush style character design. The font also comes with ligatures, alternates, and multilingual support as well.

San Marino – Urban Font Family

San Marino - Urban Font Family

Designing trendy signage for urban shops and stores will get so much easier when you have this font in your arsenal. It features 4 different font styles, including regular, outline, italic, and sans serif. It’s also an all-caps font.

Lineat – Creative Font For Signs

Lineat - Creative Font For Signs

This is a creative and stylish font you can use to design signs for modern businesses and unique stores, especially including sports and fashion related brands. The font comes with lots of OpenType …

Faking env() to Use it Now

There is already an env() function in CSS, but it kinda came out of nowhere as an Apple thing for dealing with “The Notch” but it has made it’s way to be a draft spec. The point will be for UAs or authors to declare variables that cannot be changed. Global const for CSS, sorta.

That spec doesn’t seem to suggest how we’ll actually set those env() values just yet. If you want them now, the easiest way to fake them would be using regular ol’ CSS custom properties and simply not change them.

But if you want that env() syntax though, there is a PostCSS plugin for emulating it. The way the plugin handles them is through a JavaScript file that declares them.

postcssCustomProperties({
  importFrom: 'path/to/file.js' /* module.exports = {
    environmentVariables: {
      '--branding-padding': '20px',
      '--branding-small': '600px'
    }
  } */
});

Having them start life as JavaScript is interesting, as it means we could perhaps have a single place to set variables that are accessible both to JavaScript and CSS.

That’s what Harry Nicholls covers more in his article, “Why you should use CSS env()” like some gotchas when dealing with units and such. But if you really needed a single source for unchangeable variables in both CSS and JavaScript, then I’d say this is a good way to go — and could potentially be ripped out once support for env() formally arrives.

The post Faking env() to Use it Now appeared first on CSS-Tricks.

from CSS-Tricks https://css-tricks.com/faking-env-to-use-it-now/…

Creating Reusable Base Classes in TypeScript with a Real-Life Example

Hey CSS-Tricksters! Bryan Hughes was kind enough to take a concept from an existing post he published on converting to TypeScript and take it a few couple steps further in this post to elaborate on creating reusable base classes. While this post doesn’t require reading the other one, it’s certainly worth checking it out because it covers the difficult task of rewriting a codebase and writing unit tests to help the process.

Johnny-Five is an IoT and robotics library for Node.js. Johnny-Five makes it easy to interact with hardware by taking a similar approach that jQuery took to the web a decade ago: it normalizes the differences between various hardware platforms. Also like jQuery, Johnny-Five provides higher-level abstractions that make it easier to work with the platform.

Johnny-Five supports a wide array of platforms via IO Plugins, from the Arduino family, to the Tessel, to the Raspberry Pi, and many more. Each IO Plugin implements a standardized interface for interacting with lower-level hardware peripherals. Raspi IO, which I first created five years ago, is the IO plugin that implements support for the Raspberry Pi.

Any time there are multiple implementations that conform to one thing, there is a chance to share code. IO Plugins are no exception, however, we have not shared any code between IO Plugins to date. We recently decided, as a group, that we wanted to change this. The timing was fortuitous since I was planning on rewriting Raspi IO in TypeScript anyways, so I agreed to take on this task.

The goals of a base class

For those who many not be familiar with using class-based inheritance to enable code sharing, let’s do a quick walk-through of what I mean when I say “creating a base class to reuse code.”

A base class provides structure and common code that other classes can extend. Let’s take a look at a simplified TypeScript example base class that we will extend later:

abstract class Automobile {
  private _speed: number = 0;
  private _direction: number = 0;
  

An Event Apart Boston is Coming. Save Now!

(This is a sponsored post.)

An Event Apart Boston is almost here! We’re talking, like, less than a month away. If you’ve been holding off from registering, this might be your last chance because time and seating are both limited. Besides, we’re talking about three days of pure knowledge-dropping by an impressive lineup of speakers on a wide range of topics. Seriously, just look at the full schedule and prepare to be get stoked for a great time.

But, if a couple of weeks until show time is a little too tight for your liking, that’s where An Event Apart has you totally covered because there’s another one taking place in Washington D.C. this summer. And three more throughout the rest of the year in Chicago, Denver and San Francisco.

The reason an Event Apart is so near-and-dear to the CSS-Tricks family is that it scratches a common itch that we see come up around here often: how can we possibly stay on top of our careers as front-enders when our industry is changing at lightning speed and when we’re all-consumed trying to keep on top of our actual jobs? An Event Apart is our chance to take intention time away from the day-to-day and invest in our careers by learning from some of the best in the business, meeting folks who do what we do, and having those micro-interactions with others in the hallways that spark the interesting types of dialogues you just can’t get from Twitter.

Think about it: 17 speakers over three days covering everything from design systems and Progressive Web Apps to variable fonts and CSS Grid Layout. There’s so much to gain by attending. Just look at the awesome takeaways Chris got from An Event Apart Seattle in March.

And, to sweeten the pot, An Event Apart gave us a special discount code for CSS-Tricksters like yourself. Enter the AEACP at checkout to knock $100 off the price.

Hope to see you at one of the upcoming events!

Register Today

Direct Link to