Daily Link Aggregating from the Best Design & Showcase Sites
18,124 Links to Search From

@linkgrabin #LinkoftheDay

Comics of the Week #430

Posted by Web Designer Depot - 2 hours ago
Every week we feature a set of comics created exclusively for WDD. The content revolves around web design, blogging and funny situations that we encounter in our daily lives as designers. These great cartoons are created by Jerry King, an award-winning cartoonist who’s one of the most published, prolific and versatile cartoonists in the world […]

Bobby Tarantino Vs Everybody Tour

Posted by One Page Love - 7 hours ago
Minimal One Pager with an textured design dedicated to promoting tickets for Logic’s 2018 US tour. Full Review | Direct Link


Posted by Site Inspire - 20 hours ago


Posted by One Page Love - 23 hours ago
Long-scrolling One Pager featuring a neat customization material slider for Romanian shirt tailors Cachet. Full Review | Direct Link

Wed'ze ski goggles collection

Posted by Awwwards - 1 day ago
Discover the tool we designed & created for Wed'ze to help you to choose the goggle which perfectly fit with your needs & your style!

Best WordPress Theme Clubs for Unlimited Sites

Posted by css Drive - News - 2 days ago
Review and comparison of the best Wordpress theme clubs for unlimited domains.

10 Tips for Designing Landing Pages That Don’t Suck

Posted by Design Shack - 2 days ago
A landing page is the first experience your customer (or potential customer) will have with your brand. It has to convey information, encourage a call-to-action, and reflect your personality. It’s difficult! Today we’re sharing ten landing page design tips to help. If you just stick your logo and product image on a template, it’ll be […]

Build a Website for Any Business With Wix

Posted by Design Shack - 2 days ago
Different business niches have completely different requirements when it comes to their website. Restaurants need a booking and menu system, musicians need support for playing their tracks, photographers need a beautiful gallery. No matter what business area you’re currently working on a project for, it’s worth taking a look at what Wix has to offer. […]

Accessibility Through Semantic HTML

Posted by 24 Ways - 2 days ago

Laura Kalbag takes us back to basics to make sure we consider accessibility when structuring our HTML. The Christmas tree needs to be standing firm before we drape it in lights and tinsel, and until you lot start doing it, we’re not going to stop preaching it.

Brought to you by An Event Apart. Discover the future of web design. At the UX and front-end conference where the future always seems to arrive first.

Working on Better, a tracker blocker, I spend an awful lot of my time with my nose in other people’s page sources. I’m mostly there looking for harmful tracking scripts, but often notice the HTML on some of the world’s most popular sites is in a sad state of neglect.

What does neglected HTML look like? Here’s an example of the markup I found on a news site just yesterday. There’s a bit of text, a few links, and a few images. But mostly it’s div elements.

      <div id="block1242235">
            <a href="#"><i></i></a>
          Some text <span>more text</span>

divs and spans, why do we use them so much?

While I find tracking scripts completely inexcusable, I do understand why people write HTML like the above. As developers, we like to use divs and spans as they’re generic elements. They come with no associated default browser styles or behaviour except that div displays as a block, and span displays inline. If we make our page up out of divs and spans, we know we’ll have absolute control over styles and behaviour cross-browser, and we won’t need a CSS reset.

Absolute control may seem like an advantage, but there’s a greater benefit to less generic, more semantic elements. Browsers render semantic elements with their own distinct styles and behaviours. For example, button looks and behaves differently from a. And ul is different from ol. These defaults are shortcuts to a more usable and accessible web. They provide consistent and well-tested components for common interactions.

Semantic elements aid usability

A good example of how browser defaults can benefit the usability of an element is in the <select> option menu. In Safari on the desktop, the browser renders <select> as a popover-style menu. On a touchscreen, Safari overlays the same menu over the lower half of the screen as a “picker view.”

Option menu in Safari on macOS.
Option menu picker in Safari on iOS.

The iOS picker is a much better experience than struggling to pick from a complicated interface inside the page. The menu is shown more clearly than in the confined space on the page, which makes the options easier to read. The required swipe and tap gestures are consistent with the rest of the operating system, making the expected interaction easier to understand. The whole menu is scaled up, meaning the gestures don’t need such fine motor control. Good usability is good accessibility.

When we choose to use a div or span over a more semantic HTML element, we’re also doing hard work the browser could be doing for us. We don’t need to tie ourselves in knots making a custom div into a keyboard navigable option menu. Using select passes the bulk of the responsibility over to the browser. 

Letting the browser do most of the work is also more future-friendly. More devices, with different expected interactions, will be released in the future. When that happens, the devices’ browsers can adapt our sites according to those interactions. Then we can spend our time doing something more fun than rewriting cross-browser JavaScript for each new device.

HTML’s impact on accessibility

Assistive technology also uses semantic HTML to understand how best to convey each element to its user.

For screen readers

Semantic HTML gives context to screen readers. Screen readers are a type of assistive technology that reads the content of the screen to the person using it. All sites have a linear page source. Sighted visitors can use visual cues on the page to navigate to their desired content in a non-linear fashion. As screen readers output audio (and sometimes braille), those visual cues aren’t usable in the same way.

Screen readers provide alternative means of navigation, enabling people to jump between different types of content, such as links, forms, headings, lists, and paragraphs. If all our content is marked up using divs and spans, we’re not giving screen readers a chance to index the valuable content.

For keyboard navigation

Keyboard-only navigation is also aided by semantic HTML. Forms, option menus, navigation, video, and audio are particularly hard for people relying on a keyboard to access. For instance, option menus and navigation can be very fiddly if you need to use a mouse to hover a menu open and move to select the desired item at the same time. 

Again, we can leave much of the interaction to the browser through semantic HTML. Semantic form elements can convey if a check box has been checked, or which label is associated with which input field. These default behaviours can make the difference between a person being able to use a form or leaving the site out of frustration.

Did I convince you yet? I hope so. Let’s finish with some easy guidelines to follow.

1. Use the most semantic HTML element for the job

When you reach for a div, first check if there’s a better element to do the job. What is the role of that element? How should a person be interacting with the element?

Are you using class names like nav, header, or main? There are HTML5 elements for those sections! Using specific elements can also make writing CSS simpler, and ensure a consistent design with minimal effort.

2. Separate structure and style

Don’t choose HTML elements based on how they’re styled in your CSS. Nowadays, common practice is to use class names rather than elements for CSS selectors. You’re unlikely to wrap all your page content in an <h1> element because you want all the text to be big and bold. Still, it can be easy to choose an HTML element because it will be the easiest to style. Focusing on content without style will help us choose the most semantic HTML element without that temptation. For example, you could add a class of .btn to a div to make it look like a button. But we all know that only a button will really behave like a button.

3. Use progressive enhancement for enhanced functionality

Airbnb and Groupon recently proved we’re not past the laziness of “this site only works in X browser.” Baffling disregard for the open web aside, making complex interactive experiences work cross-browser and cross-device is not easy. We can use progressive enhancement to layer fancy or unsupported features on top of a baseline “it works” experience. 

We should build the baseline experience on a foundation of accessible, semantic HTML. Then, if you really want to add a specific feature for a proprietary browser, you can layer that on top, without breaking the underlying experience.

4. Test your work

Validators are always valuable for checking the browser will be able to correctly interpret your markup. Document outline checkers can be valuable for testing your structure, but be aware that the HTML5 document outline is not actually implemented in browsers.

Once you’ve got something resembling a web page, test the experience! Ensure that semantic HTML element you chose looks and behaves in a predictable manner consistent with its use across the web. Test cross-browser, test cross-device, and test with assistive technology. Testing with assistive technology is not as expensive as it used to be, you can even use your smartphone for testing on iOS and Android. Your visitors will thank you!

Further reading

About the author

Laura Kalbag is a designer from the UK, and author of Accessibility For Everyone from A Book Apart. She’s one third of Ind.ie, a tiny two-person-and-one-husky not-for-profit working for social justice in the digital age. At Ind.ie, Laura follows the Ethical Design Manifesto, and works on a web privacy tool called Better.

More articles by Laura


Posted by Site Inspire - 3 days ago

Uncanny Valley Studio

Posted by Awwwards - 2 hours ago
Transform navigation into an immersive journey where the users travel from one project to another.


Posted by css Drive - Gallery - 9 hours ago

Yo! #007 – Canada’s Vertical $10 Note, Google’s Mobile UI Framework

Posted by One Page Love - 21 hours ago
This week in Yo! I cover Canada's Vertical $10 Note, Google's "Flutter" Mobile UI Framework, User Flow Diagramming Tool - Overflow, freebies, a failed "vlog" attempt, beautiful websites, great UX, beats and more ????

11 Free Laravel Video Tutorials For Absolute Beginners

Posted by Web Designer Depot - 1 day ago
If you can get through the basics of PHP then you’ll have a solid foundation on backend development. It’s knowledge you can use for WordPress coding or even to build your own webapps. But developers nowadays often use open source frameworks like Laravel. This is by far the most comprehensive framework for PHP development and […]

Care and Feeding of Burnout

Posted by 24 Ways - 1 day ago

Jessica Rose sets out her recipe for identifying and caring for the symptoms of professional burnout. This time of year is the perfect opportunity to pause and reflect – are you burning the advent candle at both ends, and if so, what should you do about it? Let’s find out.

Brought to you by The CSS Layout Workshop. Does developing layouts with CSS seem like hard work? How much time could you save without all the trial and error? Are you ready to really learn CSS layout?

You’ve been doing too much for too long. And it’s broken you. You’re burned out. You’re done.

Illustration by Kate Holden

Occupational burnout is a long-documented effect of stretching yourself further than the limits of your mental and physical health can carry you. And when it finally catches up with you, it can feel like the end of the world. But things can get better. With focused self care, reworking your priorities and lots of time, you can slog through burnout.

What is burnout? The Tl;dr linkdump tour

In this article, we’ll be looking at what you can do when you’re burned out. We’ll be skipping past a lot of information on what burnout is, what causes it and how it impacts the tech industry. We’re able to skip past this because many technologists have already created valuable content targeted to our industry. The videos and writing below may be helpful for readers who are less familiar with burnout.

A Wikipedia article may be a great starting point for learning about occupational burnout.

Understanding burnout: Brandon West

This conference talk by Brandon West covers a lot of burnout 101, from the perspective of a developer relations/community professional.

April Wensel writes about the need for the tech industry to move from the Valley’s burnout culture to a more sustainable model.

Catching Burnout [as] early [as possible]

One of the most challenging things about burnout is that it develops slowly and gradually. Many impacted don’t notice the water warming around them until it’s been brought to a boil, causing a crisis that can’t be overlooked. Catching burnout and taking steps to deal with it as early as possible can help limit the length and severity of your burnout.

Getting in the habit of checking in with yourself regularly about your stress and energy levels can be an effective habit for assessing burnout and for general wellness. The Mayo Clinic recommends asking yourself the following questions to determine if you might be suffering from burnout.

  • Have you become cynical or critical at work?
  • Do you drag yourself to work and have trouble getting started once you arrive?
  • Have you become irritable or impatient with co-workers, customers or clients?
  • Do you lack the energy to be consistently productive?
  • Do you lack satisfaction from your achievements?
  • Do you feel disillusioned about your job?
  • Are you using food, drugs or alcohol to feel better or to simply not feel?
  • Have your sleep habits or appetite changed?
  • Are you troubled by unexplained headaches, backaches or other physical complaints?

According to the Mayo Clinic, answering yes to more than one of these questions can be a sign that you need to take corrective action. We’ll look in more detail about the corrective actions you can take in the rest of this article.

Do less. Now.

To start getting things back on track, you’ll need to start doing less. Less work, less stress, less everything. Many technologists impacted by burnout have written or spoken on taking months or even years off work to give themselves time to recover. This can be a fantastic route back to wellness for those fortunate enough to have the professional and financial security to allow them to take large stretches of time off work. For the much larger group of burned out workers that need to balance earning a paycheck with their wellness, this can be more challenging.

For those of us who need to stay in the cycle of work to fund our daily needs, finding ways to do less can feel like adding another daunting task to the pile. To properly assess where and how you can cut back on your commitments, you’ll need to find a short stretch of time clear of stressors and responsibilities to take stock of what can be scaled back. A long weekend, weekend or even a few hours of time dedicated to looking only at how you can cut back on work and stress can be an effective way to take stock of your responsibilities.

Make a list of stressors and activities to begin to triage. Anything that would damage or seriously disrupt your life if not attended to (doing your taxes, showing up at work, paying rent) should be marked as essential. Grade other activities in your life, marking the ones that aren’t essential and working to temporarily reduce these or remove them from your life. It can feel difficult to let go of things while recovering from burnout. This process can benefit from a second opinion, if you’re working with a coach, therapist or trusted friend to manage your burnout.

Reducing your workload and stressors can let you begin to recover from burnout. You can reintroduce things back into your schedule and life. Reintroduce stressors and activities back into your life slowly, to minimize risk of relapse. Keeping a journal will let you keep tabs on how different activities are impacting your energy levels and state of mind.

Remove toxicity

Toxic people or settings can drain you faster than overwork alone can. While you work to reduce your workload and stress, coworkers, friends, family or bosses who are toxic influences can act as a multiplier for the stressors that remain. Identifying these people and limiting your interactions with them during your recovery can help you get back on track faster and happier. A journal can be an important tool in tracking how interactions with different people impact your wellness and state of mind. If the toxic presence in your life is someone you can avoid or cut out without penalty, burnout is a great reason to finally replace them with healthier relationships.

If you can’t remove them from your life, minimizing the impact toxic people have on your wellness is vital. Work to identify what aspect of the relationship is draining or damaging and create interventions around damaging interactions. While a chronically complaining coworker’s negativity can be stopped short with setting firm conversational boundaries and redirection, a combative boss can be a harder challenge. Seeking allies and advice can make you feel less alone in your battles and provide healthy emotional support.

Ask for help

Trying to find your way back to health and wellness after burning out can be a daunting task. Seeking help from health care professionals, trusted peers or both can give you backup on your journey back to feeling better. With symptoms that can mirror those of depression, burnout can be the precursor to a number of mental and physical ailments. Talk to your doctor immediately if you’re experiencing symptoms of depression or any other health concerns.

Being open with your trusted friends about burnout can let you access valuable support and help explain why you may need extra care and consideration while you recover. Many suffering from burnout report finding maintaining relationships a challenge. Letting your loved ones know what you’re going through and why you may be less available invites them to be more understanding of cancelled plans or other issues while you’re recovering. Burnout can impact memory and cognitive function. Letting your support network assist in decision making during burnout can help add perspective to counterbalance these deficits.

Talking to your friends and peers about your health and needs can offer valuable support. But those who are pushed to a mental or physical health crisis by burnout should work with healthcare professionals to plan their recovery. Sufferers of mild to moderate burnout can also benefit from planning their return to wellness with an experienced practitioner. Medical or counseling professionals may prescribe medicines, talk therapy, group sessions or other therapeutic intervention.

Go easy on yourself

Recovering from burnout is a process that takes energy, time and compassion for yourself. In the same way that toxic people or workplaces can set you back, negative repetitive thoughts will harm your recovery. Recognizing that burnout’s impact on you is a temporary state that isn’t your fault can help you begin to manage your feelings and expectations for yourself. Sufferers often report feeling stupid, lazy or that they lack the skills to do their job. This is natural, as burnout can severely limit your cognitive function, your energy levels and resilience while dramatically increasing your cognitive load. Working with a counselor may help if you’re finding it difficult to be patient with your progress back to health or are troubled by persistent intrusive thoughts.

Burnout can seriously limit the amount of energy you have. Spend as little of the energy you have left beating yourself up as possible. You’re going to be ok. It’s all going to be ok.

This article doesn’t offer one-size-fits all fixes for burnout or overwork, but aims to provide a framework with points to consider that may help shape your wellness. No article can act as a substitute for professionally administered healthcare or robust self care.

About the author

Jessica Rose is a technical manager at FutureLearn, helping a great team deliver social learning experiences to the world. She’s founded the Open Code meetup series, co-founded Trans*Code and hosts the Pursuit Podcast. You can find her on the web at Jessica.tech or argue with her on Twitter.

More articles by Jessica

Paste by FiftyThree

Posted by Site Inspire - 2 days ago

Marylou Faure

Posted by cssdsgn - 2 days ago

The Bohen Foundation

Posted by cssdsgn - 2 days ago

CSS Conf

Posted by Best Web Gallery - 2 days ago


Posted by One Page Love - 3 days ago
‘Cardea’ is a unique One Page WordPress theme perfect to create a colorful One Page portfolio. The theme loads projects using AJAX allowing the reader to browse your full portfolio without reloading the page. Other features include a sticky header navigation, smooth scroll to sections, marketing copy slider, about section with video overlay, blog feed, […]


Posted by CSS Mania - 2 hours ago

Ladies, Wine & Design

Posted by Site Inspire - 14 hours ago

Qual Agency

Posted by Site Inspire - 22 hours ago

Investment Calculator

Posted by One Page Love - 1 day ago
Gorgeously designed One Pager hosting an online Investment Calculator. The color palette is beautiful and the calculator interactions reflect instantly on the alongside graph. A real bonus is the practical saving tips as you scroll the rest of the Single Page website. Full Review | Direct Link

Club of the Waves

Posted by css Drive - Gallery - 1 day ago

L'Observatoire International

Posted by Site Inspire - 2 days ago

Klasse Roggan

Posted by cssdsgn - 2 days ago

Jermaine Davis

Posted by cssdsgn - 2 days ago

Volta Loftid

Posted by css Drive - Gallery - 2 days ago

JJ Ying

Posted by One Page Love - 3 days ago
One Page portfolio for UI designer JJ Ying featuring neat animated GIF overlays to bring each project item to life. Full Review | Direct Link

Feeding the Audio Graph

Posted by 24 Ways - 5 hours ago

Ben Foxall dives deep into the Web Audio API to serve up such well known Christmas hits as I’m Dreaming Of A White Noise Generator, and All I Want For Christmas Is 440Hz. Get ready to dance around your browser this season, because it certainly won’t be a silent night.

Brought to you by The CSS Layout Workshop. Does developing layouts with CSS seem like hard work? How much time could you save without all the trial and error? Are you ready to really learn CSS layout?

In 2004, I was given an iPod.

I count this as one of the most intuitive pieces of technology I’ve ever owned. It wasn’t because of the the snazzy (colour!) menus or circular touchpad. I loved how smoothly it fitted into my life. I could plug in my headphones and listen to music while I was walking around town. Then when I got home, I could plug it into an amplifier and carry on listening there.

There was no faff. It didn’t matter if I could find my favourite mix tape, or if my WiFi was flakey - it was all just there.

Nowadays, when I’m trying to pair my phone with some Bluetooth speakers, or can’t find my USB-to-headphone jack, or even access any music because I don’t have cellular reception; I really miss this simplicity.

The Web Audio API

I think the Web Audio API feels kind of like my iPod did.

It’s different from most browser APIs - rather than throwing around data, or updating DOM elements - you plug together a graph of audio nodes, which the browser uses to generate, process, and play sounds.

The thing I like about it is that you can totally plug it into whatever you want, and it’ll mostly just work.

So, let’s get started. First of all we want an audio source.

<audio src="night-owl.mp3" controls />

(Song - Night Owl by Broke For Free)

This totally works. However, it’s not using the Web Audio API, so we can’t access or modify the sound it makes.

To hook this up to our audio graph, we can use an AudioSourceNode. This captures the sound from the element, and lets us connect to other nodes in a graph.

const audioCtx = new AudioContext()

const audio = document.querySelector('audio')
const input = audioCtx.createAudioSourceNode(audio)


Great. We’ve made something that looks and sounds exactly the same as it did before. Go us.


Let’s plug in a GainNode - this allows you to alter the amplitude (volume) of an an audio stream.

We can hook this node up to an <input> element by setting the gain property of the node. (The syntax for this is kind of weird because it’s an AudioParam which has options to set values at precise intervals).

const node = audioCtx.createGain()

const input = document.querySelector('input')
input.oninput = () => node.gain.value = parseFloat(input.value)


You can now see a range input, which can be dragged to update the state of our graph. This input could be any kind of element, so now you’ll be free to build the volume control of your dreams.

There’s a number of nodes that let you modify/filter an audio stream in more interesting ways. Head over to the MDN Web Audio page for a list of them.


Something else we can add to our graph is an AnalyserNode. This doesn’t modify the audio at all, but allows us to inspect the sounds that are flowing through it. We can put this into our graph between our AudioSourceNode and the GainNode.

const analyser = audioCtx.createAnalyser()


And now we have an analyser. We can access it from elsewhere to drive any kind of visuals. For instance, if we wanted to draw lines on a canvas we could totally do that:

const waveform = new Uint8Array(analyser.fftSize)
const frequencies = new Uint8Array(analyser.frequencyBinCount)
const ctx = canvas.getContext('2d')

const loop = () => {

    waveform.forEach((f, i) => ctx.lineTo(i, f))
    frequencies.forEach((f, i) => ctx.lineTo(i, 255-f))

You can see that we have two arrays of data available (I added colours for clarity):

  1. The waveform - the raw samples of the audio being played.
  2. The frequencies - a fourier transform of the audio passing through the node.

What’s cool about this is that you’re not tied to any specific functionality of the Web Audio API. If it’s possible for you to update something with an array of numbers, then you can just apply it to the output of the analyser node.

For instance, if we wanted to, we could definitely animate a list of emoji in time with our music.

  (s, i) => s.style.transform = `scale(${1 + (frequencies[i]/100)})`

Generating Audio

So far, we’ve been using the <audio> element as a source of sound.

There’s a few other sources of audio that we can use. We’ll look at the AudioBufferNode - which allows you to manually generate a sound sample, and then connect it to our graph.

First we have to create an AudioBuffer, which holds our raw data, then we pass that to an AudioBufferNode which we can then treat just like our AudioSource node. This can get a bit boring, so we’ll use a helper method that makes it simpler to generate sounds.

const generator = (audioCtx, target) => (seconds, fn) => {
  const { sampleRate } = audioCtx

  const buffer = audioCtx.createBuffer(
      1, sampleRate * seconds, sampleRate
  const data = buffer.getChannelData(0)

  for (var i = 0; i < data.length; i++) {
    data[i] = fn(i / sampleRate, seconds)

  return () => {
    const source = audioCtx.createBufferSource()
    source.buffer = audioBuffer

    source.connect(target || audioCtx.destination)

const sound = generator(audioCtx, gain)

Our wrapper will let us provide a function that maps time (in seconds) to a sample (between 1 and -1). This generates a waveform, like we saw before with the analyser node.

For example, the following will generate 0.75 seconds of white noise at 20% volume.

const noise = sound(0.75, t => Math.random() * 0.2)

button.onclick = noise

Now we’ve got a noisy button! Handy.

Rather than having a static set of audio nodes, each time we click the button, we add a new node to our graph. Although this feels inefficient, it’s not actually too bad - the browser can do a good job of cleaning up old nodes once they’ve played.

An interesting property of defining sounds as functions is that we can combine multiple function to generate new sounds. So if we wanted to fade our noise in and out, we could write a higher order function that does that.

const ease = fn => (t, s) =>
  fn(t) * Math.sin((t / s) * Math.PI)

const noise = sound(0.75, ease(t => Math.random() * 0.2))

And we can do more than just white noise - if we use Math.sin, we can generate some nice pure tones.

// Math.sin with period of 0..1
const wave = v => Math.sin(Math.PI * 2 * v)
const hz = f => t => wave(t * f)

const _440hz = sound(0.75, ease(hz(440)))
const _880hz = sound(0.75, ease(hz(880)))

We can also make our functions more complex. Below we’re combining several frequencies to make a richer sounding tone.

const harmony = f => [4, 3, 2, 1].reduce(
    (v, h, i) => (sin(f * h) * (i+1) ) + v

const a440 = sound(0.75, ease(harmony(440)))


We’re still not using any audio-specific functionality, so we can repurpose anything that does an operation on data. For example, we can use d3.js - usually used for interactive data visualisations - to generate a triangular waveform.

const triangle = d3.scaleLinear()
    .domain([0, .5,  1])
    .range([-1,  1, -1])

const wave = t => triangle(t % 1)

const a440 = sound(0.75, ease(harmony(440)))

It’s pretty interesting to play around with different functions. I’ve plonked everything in jsbin if you want to have a play yourself.

A departure from best practice

We’ve been generating our audio from scratch, but most of what we’ve looked at can be implemented by a series of native Web Audio nodes. This would be way performant (because it’s not happening on the main thread), and more flexible in some ways (because you can set timings dynamically whilst the note is playing). But we’re going to stay with this approach because it’s fun, and sometimes the fun thing to do might not technically be the best thing to do.

Making a keyboard

Having a button that makes a sound is totally great, but how about lots of buttons that make lots of sounds? Yup, totally greater-er.

The first thing we need to know is the frequency of each note. I thought this would be awkward because pianos were invented more than 250 years before the Hz unit was defined, so surely there wouldn’t be a simple mapping between the two?

const freq = note => 27.5 * Math.pow(2, (note - 21) / 12)

This equation blows my mind; I’d never really figured how tightly music and maths fit together. When you see a chord or melody, you can directly map it back to a mathematical pattern.

Our keyboard is actually an SVG picture of a keyboard, so we can traverse the elements of it and map each element to a sound generated by one of the functions that we came up with before.

  .sort((a, b) => + a.x - b.x)
  .forEach((key, i) =>
      sound(0.75, ease(harmony(freq(i + 48))))

Et voilà. We have a keyboard.

What I like about this is that it’s completely pure - there’s no lookup tables or hardcoded attributes; we’ve just defined a mapping from SVG elements to the sound they should probably make.

Doing better in the future

As I mentioned before, this could be implemented more performantly with Web Audio nodes, or even better - use something like Tone.js to be performant for you.

Web Audio has been around for a while, though we’re getting new challenges with immersive WebXR experiences, where spatial audio becomes really important. There’s also always support and API improvements (if you like AudioBufferNode, you’re going to love AudioWorklet)


And that’s about it. Web Audio isn’t some black box, you can easily link it with whatever framework, or UI that you’ve built (whether you should is an entirely different question).

If anyone ever asks you “could you turn this SVG into a musical instrument?” you don’t have to stare blankly at them any more.

About the author

Ben Foxall is a JavaScript Engineer and Adventurist. After 16 years of avoiding the subject; he’d like to tell Jamie that he probably did lose that mix-tape – he’s sorry about that. Oh and also, Chris, sorry for breaking your phone, and that I still laugh every time I think about it.

More articles by Ben


Posted by Site Inspire - 18 hours ago

Lemonly Annual Report 2017

Posted by One Page Love - 22 hours ago
Lemonly have combined their 2017 Annual Report with an interactive survey to create their own 2017 Lemonly Awards – voted by you. Fun touch adding the ballon popping footer animation. Great effort! Full Review | Direct Link


Posted by cssdsgn - 1 day ago

Kuon Yagi

Posted by css Drive - Gallery - 1 day ago

Steve Alexander?

Posted by Featured / by - 2 days ago
Steve Alexander (Rinzen) – is the co-founder of the well-known design collective Rinzen. Featured? Some of his typographic works.

Henry J Lyons

Posted by Site Inspire - 2 days ago

The I Am Woman Project

Posted by cssdsgn - 2 days ago


Posted by css Drive - Gallery - 2 days ago

30+ Best Modern & Futuristic Fonts

Posted by Design Shack - 3 days ago
If you’re looking for a way to future-proof your designs, there’s no better way to start than finding a modern, futuristic font for your projects. And this collection of the best modern and futuristic fonts is a great place to start! We’ve picked out some of the best futuristic fonts you can use with your […]

Best WordPress Page Builders Compared and Reviewed

Posted by css Drive - News - 5 hours ago
5 of the best Wordpress Page Builder plugins you should consider to format and create complex layouts in Wordpress like a Pro.


Posted by cssdsgn - 19 hours ago

It Will Glow

Posted by One Page Love - 23 hours ago
Fun launching soon page for upcoming event It Will Glow featuring a pizza cursor, a retro logo animation and a hilarious NOPE button that’s unclickable ???? Full Review | Direct Link


Posted by cssdsgn - 1 day ago

Laws of UX

Posted by css Drive - Gallery - 1 day ago

Row 7 Seed Company

Posted by Site Inspire - 2 days ago

How Incapsula Designed its UX

Posted by Web Designer Depot - 2 days ago
When you build a site, you need to start with the user experience (UX) and work backwards. Even before you write a single line of code, you’ll need to know who the users you’re writing that code for are, as well as what the client’s objective experience is for those users. Who Are Our Users? […]


Posted by Awwwards - 2 days ago
New brand image, new website.

Pixels 28 awards

Posted by Featured / by - 3 days ago
Winner of 28 awards – Pixels – was created by Patrick Jean and the metaphors using old school video games.. no wonder – this short film got such a phenomenal reception. _______ I might be late in the game – just watch it! I think the featured movie was too much in comparison.

Next Wave

Posted by cssdsgn - 3 days ago