Blog

358 posts

Collective #590


Understanding Map and Set in JavaScript

Tania Rascia goes over the Map and Set objects, what makes them similar or different to Objects and Arrays, the properties and methods available to them, and examples of some practical uses.

Read it






Flight

3D video game experiments built with Three.js, TypeScript, React, Redux and GLSL shaders.

Check it out





Stage.js

In case you didn’t know about it: Stage.js is a 2D JavaScript library for cross-platform HTML5 game development.

Check it out




Google Fonts Tip

Addy Osmani shows how to shave up to 90% off the size of Google Fonts requests by declaring only characters you need with &text.

Check it out


Whoosh

A great game prototype by Charlie Gerard where you control a 3D spaceship with hand movements.

Check it out







Collective #590 was written by Pedro Botelho and published on Codrops.

What To Do If People Hate Your Brand Mascot

What To Do If People Hate Your Brand Mascot

What To Do If People Hate Your Brand Mascot

Suzanne Scacca

There are a number of reasons why businesses decide to use mascots to represent their brands:

  • They want there to be a friendly and reliable face to welcome visitors to the site.
  • They know they need something more than an inventory of products to make an emotional connection with shoppers.
  • They want a strong and recognizable personality that can tie all of their marketing channels together.

While it’s clear that mascots can be invaluable for the business-consumer connection, there’s a very thin line between mascots turning customers into loyal advocates and sending prospects running away in fear.

If you’re struggling to get traction on an existing website and fear the mascot might have something to do with it, this post is for you. You should also keep reading if you’re designing a mascot from-scratch and aren’t sure how to create something your audience will fall in love with.

There’s a very thin line between brand mascots turning customers into loyal advocates and sending prospects running away in fear.

Things You Can Do to Create a Brand Mascot People Love

Not everyone is going to get as lucky as TinyPNG, which has had the same brand mascot for years.

This was the mascot that sat at the top of the page in 2014:

TinyPNG website 2014
A snapshot of the TinyPNG website in 2014 with its panda mascot. (Image source: TinyPNG) (Large preview)

Here it is again in 2017, only it’s a bit brighter and larger in size:

TinyPNG website 2017
A snapshot of the TinyPNG website in 2017 with its panda mascot. (Image source: TinyPNG) (Large preview)

The mascot also started appearing with a crown on the bottom right. This callout encouraged users to subscribe to the Pro tool.

To this day, the website continues to use the mascot in this manner (and with nearly the same layout and content):

TinyPNG website 2020
A snapshot of the TinyPNG website in 2020 with its panda mascot. (Image source: TinyPNG) (Large preview)

The panda mascot works for a number of reasons. It looks very happy, for one. Also, it’s got a welcoming presence, like “Hey, I’m just chilling here, eating my bamboo. Feel free to upload your images whenever.” And it’s downright adorable.

But not every seemingly happy, friendly or cute brand mascot works out this well. Mascots are a subjective thing. It’s like they always say: beauty is in the eye of the beholder.

So, if your audience doesn’t interpret the attractiveness, humor or personality of the mascot as the original creators did, it’s going to be a problem for the business as a whole.

Let’s take a look at what your options are if you suspect that your client’s brand mascot isn’t as adored as they hoped it would be.

Option #1: Modernize It

The first thing to think about is whether or not the mascot is worth salvaging. Is there anything good about the mascot or its personality… or should you start over?

Don’t just go based on your gut. Do some market research and throw some user surveys out there. Maybe message old customers of your client or do a poll on Twitter. You need to know why the mascot isn’t hitting the mark.

Once you’ve nailed down what’s wrong, it’s time to redesign it. Let’s look at some websites that have given their mascots facelifts over the years, starting with HostGator:

HostGator website 2012
A snapshot of the HostGator website from 2012 with its alligator mascot logo and imagery. (Image source: HostGator) (Large preview)

This is what the HostGator website looked like in 2012. The alligator mascot had a heavy presence in the header of the website. His head also appears to be peaking out of the main banner.

Fast forward to 2017 and we see a different side of the HostGator mascot:

HostGator website 2017
A snapshot of the HostGator website from 2017 with its mascot slightly revamped. (Image source: HostGator) (Large preview)

For starters, the alligator in the logo is much smaller, so we can now see the entire body. This gives it a more human-like feeling as opposed to the bottomless gator which more closely resembles a puppet.

The mascot in the main banner is designed the same way it’s always been designed (including the facial expression). However, it’s now donning winter gear for a seasonal touch.

Since then, HostGator has given its mascot a major touchup:

HostGator website 2020
A snapshot of the HostGator website in 2020 with a redesigned alligator mascot. (Image source: HostGator) (Large preview)

Do you know what this redesign looks like to me? It looks like the CGI used in The Irishman.

The Irishman CGI touchup Joe Pesci
Vulture magazine shares a side-by-side look at CGI in the movie The Irishman from Netflix. (Image source: HostGator) (Large preview)

I’m not sure if that was the intention behind HostGator’s mascot redesign, but I’m going to assume that there was some user feedback that suggested that a softer and less intimidating mascot would perform better.

Another website that’s given its well-known mascot a touch-up is Chuck E. Cheese.

This was the Chuck E. Cheese website in 2011:

Chuck E. Cheese website 2011
A snapshot of the Chuck E. Cheese website from 2011 with its cartoon mouse mascot (Image source: Chuck E. Cheese) (Large preview)

Not even a decade ago, the Chuck E. Cheese website and its mascot looked like something out of Nickelodeon. Obviously, a design like this would’ve needed an upgrade no matter what considering how much web design has changed.

This is what the website looks like today:

Chuck E. Cheese website 2020
A snapshot of the Chuck E. Cheese website in 2020 without a mascot. (Image source: Chuck E. Cheese) (Large preview)

Gone are the crazy color palette and illustrations. Today, the website is much more subdued and customer-centric.

That said, the mascot pops up from time-to-time. Obviously, though, it’s undergone a much-needed redesign:

Chuck E. Cheese mascot 2020
The Chuck E. Cheese mascot in 2020. (Image source: Chuck E. Cheese) (Large preview)

The new mascot is still a buck-toothed mouse with a welcoming smile and wave. However, it looks more on par with the kinds of animations you’d see coming out of Pixar than old Saturday morning cartoons.

Even if there’s nothing necessarily wrong with the mascot your website is using, it might be worth looking at upgrading it so it better fits with the times as Chuck E. Cheese has done.

Option #2: Change The Tone Of It

Mascots can be really helpful at getting a brand’s message across — over and over again. However, there may be times when the kind of mascot you’ve chosen (or a lack of one) actually stands in the way of the message you’re trying to convey.

Take the old GEICO mascot: the caveman.

GEICO website 2005 - caveman
A snapshot of the GEICO website in 2005 when it featured the caveman mascot. (Image source: GEICO) (Large preview)

I don’t know that there was anything wrong with the caveman advertisements. They were smart and funny and were lauded for taking on the subject of political correctness.

That said, GEICO’s customer data must’ve told them that a change-up was needed. Maybe the messaging was too serious or the humor went over some people’s heads.

So, they scrapped the caveman mascot for an animated Cockney-accented gecko:

GEICO website 2020 - gecko
A snapshot of the GEICO website in 2020 with its gecko mascot. (Image source: GEICO) (Large preview)

Whereas the cavemen were always offended and storming off whenever someone would say “It’s so easy a caveman could do it”, this anthropomorphic mascot is a much more lighthearted figure in the GEICO landscape. The gecko is always there, ready to provide tips on how to get the most with GEICO.

In other words, it might not be enough to change your mascot to an adorable critter. You might also need to switch up your messaging, too.

While I was writing my last article on mobile storytelling, I did some digging into the alcohol industry. One company, in particular, stood out for its use of a human mascot and storyteller: Aviation Gin.

Now, what I hadn’t covered in that write-up was the fact that Aviation Gin has been around for a while. It was founded in the mid-2000s, long before current co-owner and mascot Ryan Reynolds had anything to do with it.

This was the Aviation Gin website in 2007:

Aviation Gin website 2007
A snapshot of the Aviation Gin website from 2007. (Image source: Aviation Gin) (Large preview)

Granted, these are the early days of the web, so we can’t expect much in the way of design. However, as far as mascots go, there are none to be seen. Unless you count the actual bottle of Aviation Gin.

Nearly 10 years later, Aviation Gin was still rocking the product-centric design:

Aviation Gin website 2016
A snapshot of the Aviation Gin website in 2016. (Image source: Aviation Gin) (Large preview)

It was still very simple in design and the bottle of gin remained the sole focus. Aside from some industry awards, Aviation Gin wasn’t the media darling it is now.

In 2018, Ryan Reynolds bought shares in the company and changed the whole tone of the brand:

Aviation Gin website 2020
A snapshot of the Aviation Gin website in 2020 featuring Ryan Reynolds. (Image source: Aviation Gin) (Large preview)

Today, Ryan Reynolds has become the face of Aviation Gin, pushing it at every turn on his social media. It hasn’t changed the direction of the company itself, but by having a human mascot like Reynolds on its side, the message (and likely the audience, too) has changed.

It’s also opened the brand up to bigger opportunities, like Reynolds’ latest announcement about their partnership with the Westminster Kennel Club Dog Show:

So, if you have a website that performs just “okay” with its audience, a change of tone and pace might be needed. And if you don’t have a mascot yet or one that’s not a good fit, creating one that’s well-designed for a modern-day audience might be exactly what you need.

Option #3: Minimize Its Presence On The Website

Let’s say the mascot’s design and the message it brings with it isn’t the problem. What you suspect is that it’s the amount of space given to it that’s the problem.

This is easy enough to confirm with A/B testing. You’ll just need to study your heatmaps as well as your user personas to come up with some hypotheses about where your mascot should or should not be on the site.

Let’s use Cats Who Code as an example. This was the website back in 2009:

Cats Who Code website 2009
A snapshot of the Cats Who Code website in 2009 with cat logo and imagery. (Image source: Cats Who Code) (Large preview)

Back then, cats were quite prevalent on the site, from the laptop-using cat in the header to the cats in the blog images. What’s more, the tagline of the site “Learn as fast as I catch mice!” made it perfectly clear that the kind of “cats” referred to here wasn’t referring to hip or cool cats. It really was referring to the furry pet.

Skip ahead to 2014 and the cat mascot and tagline has received a makeover:

Cats Who Code website 2014
A snapshot of the Cats Who Code website from 2014 with a new mascot. (Image source: Cats Who Code) (Large preview)

For starters, the mascot has gone from a small tabby to a large black-and-white cat. In addition, the website’s tagline now reads “100% animal-friendly web development blog”. Those are both pretty significant changes.

Now, let’s look at the website in the present day:

Cats Who Code website 2020
A snapshot of the Cats Who Code website in 2020. (Image source: Cats Who Code) (Large preview)

The cat mascot no longer exists in its previous iterations. Now, it’s relegated to a small cat-like icon with code brackets where its face used to be. The website’s cat-friendly messaging is gone, too.

Whether it’s because the cat imagery was distracting or people didn’t like it, this website has undergone a drastic change. Everything is now very buttoned-up.

Another brand that cut back on the appearance of its mascot is Green Giant.

This was the website in 2013:

Green Giant website 2013
A snapshot of the Green Giant website and its mascot in 2013. (Image source: Green Giant) (Large preview)

The jolly green giant mascot is front-and-center on the home page. This is in addition to all the small appearances it makes in every product featured on the site.

In 2016, however, the giant’s likeness was removed from the hero banner and moved up to the logo:

Green Giant website 2016
A snapshot of the Green Giant website in 2016 with the mascot in the logo. (Image source: Green Giant) (Large preview)

It looks like the company was experimenting here, trying to see if moving the mascot’s face to the logo would give them more room to allow their products to shine.

In 2020, though, there’s barely any trace of the mascot left:

Green Giant website 2020
A snapshot of the Green Giant website in 2020. (Image source: Green Giant) (Large preview)

The mascot is gone from the logo as well as the hero image… sort of. It’s subtle, but the mascot’s shadow remains.

The website now appears to be more focused towards sustainability and its mission to contribute to a better world. In that sense, it’s completely justified why the mascot and even the blatant pushing of its products would be moved out of the way.

So, if you feel like your mascot might be getting in the way of getting your point across or perhaps the brand has evolved in a way where a cartoonish figure no longer fits, test out other ways to keep your mascot but in a very lowkey way.

Option #4: Lean Into The Creepiness/Weirdness/Ugliness

One other option you have is to lean into it.

Obviously, you shouldn’t go this route if customers find the mascot to be offensive or boring. If it’s just not working and there’s no way to turn the situation around, just scrap the mascot altogether. You’ll be better off focusing on strengthening your content and building trust that way than to push an already delicate situation.

That said, if you feel like people are reacting negatively to the mascot because of how novel or different it is, then you might want to go crazy with it and see what happens. Before I show you an example of a website that does this, I’m going to show you a real-world example of a sports mascot that turned haters into the biggest of fans.

I was living outside of Philadelphia around the time the Flyers hockey team introduced their new mascot Gritty. It didn’t go over well — at first.

This is how they introduced Gritty:

Philadelphia Flyers Gritty mascot
The Philadelphia Flyers introduce their mascot Gritty on Twitter. (Image source: Twitter) (Large preview)

Here are some of the initial responses people had to the creature with the giant beer gut and flaming-orange googly eyes:

@shocks23 speculated about its origins:

Twitter speculation about Gritty mascot
Twitter user @shocks23 suspects the Flyers’ mascot has a seedy past. (Image source: Twitter)

@aclee_clips expressed fear:

Twitter user scared of Gritty
Twitter user @aclee_clips is horrified by the Philadelphia Flyers’ new mascot. (Image source: Twitter)

And, like so many others, @mirtle was shocked and confused:

Twitter user confused about Gritty mascot
Twitter user @mirtle expresses confusion about Philadelphia Flyers’ mascot. (Image source: Twitter)

However, this isn’t a story of a brand mascot that failed.

The city of Philadelphia (along with the rest of the world) eventually fell in love with Gritty after it posed Kim Kardashian-like with a champagne bottle and entered the arena on a wrecking ball Miley Cyrus-style.

Gritty the mascot meme
Flyers mascot Gritty gets cheeky by posing with a champagne glass on his bum. (Image source: Twitter)

Over the past couple of years, Gritty has worked very hard to win the hearts of consumers bringing a fun and lighthearted approach to everything it does both on the ice as well as off. And win the hearts it has.

Take, for instance, an incident that happened earlier this year when Gritty was accused of hitting a child at a game. The accusation was investigated and Gritty was cleared of the charges. Through it all, fans had the mascot’s back.

Twitter users love team mascot Gritty
Twitter users love Gritty even in the face of scandal. (Image source: (Image source: Twitter)

If you can create a mascot with the right kind of personality, message and purpose, your website and brand will be able to experience this kind of die-hard fandom and support.

That said, this is social media we’re talking about. While the Flyers’ have gone all-in on showing off Gritty in the most awkward of situations or while humorously riffing on pop culture, the website itself only has one page where the mascot appears:

Get to Know Gritty fan page
The Get to Know Gritty fan page on the Philadelphia Flyers website. (Image source: Philadelphia Flyers (Large preview)

So, leaning into an awkward/strange/nightmare-inducing mascot might not be right for every site. Here’s one very well-known example where it was the right call:

This is the Mucinex website from 2010:

Mucinex website 2010
A snapshot of the Mucinex website in 2010 featuring its fat, green mucus mascot. (Image source: Mucinex) (Large preview)

If you ask me, this is one of the grossest mascots ever created. It’s literally mucus in human-like form. And yet, it works somehow because it’s done in a humorous manner.

In 2015, Mr. Mucus took on a sweaty and ill-looking appearance:

Mucinex website 2015
A snapshot of the Mucinex website in 2015 with its mucus mascot. (Image source: Mucinex) (Large preview)

This is the only look we get at Mr. Mucus on the website and I’m not sure it worked out very well for the brand. That may be because the mascot resembles Jabba the Hutt instead of a fun-loving mucus ball you want to watch walk down the aisle with Mrs. Mucus.

Nevertheless, the company pushed forward with the mascot, giving it even more airtime. The 2020 version of the website has Mr. Mucus appearing in various states:

Mucinex website 2020 - Mr. Mucus nervous
The Mucinex 2020 website shows off Mr. Mucus in different states. This is the mascot nervous about shipping. (Image source: Mucinex) (Large preview)

This looks similar to the Mr. Mucus we saw in 2015. However, something about the messaging in this banner gives his facial expression and clammy skin a different vibe this time around. It says, “Please don’t order this cold medicine. I don’t want to go away!”

In another banner image, we see Mr. Mucus rocking a dad bod alongside a message about working out:

Mucinex website 2020 - Mr. Mucus dad bod
The Mucinex 2020 website shows off Mr. Mucus in different states. This is the mascot with its dad bod. (Image source: Mucinex) (Large preview)

The mascot is still pretty gross, but there’s no denying how funny this image is. And then you have this banner that’s targeted at cold remedies for kids:

Mucinex website 2020 - Mr. Mucus kid
The Mucinex 2020 website shows off Mr. Mucus in different states. This is the mascot in kid form. (Image source: Mucinex) (Large preview)

I’m not sure if this is supposed to be Mr. Mucus as a kid or the child he had with Mrs. Mucus, but it’s another creative adaptation of the mascot.

According to CBC, Mucinex made a ton of money after launching its Mr. Mucus campaign in 2004, more than doubling its profits. And despite Mr. Mucus being one of the most recognizable mascots, it is also one of the least liked, too.

In this case, being hated was a good thing. Mucinex wanted its customers to be disgusted by Mr. Mucus. The whole purpose of the company is to help people fight off phlegmy throats and stuffed noses.

So, before you throw your hated mascot away, think about where the hate is coming from and if you can make it work to your advantage in another way.

If you can create a mascot with the right kind of personality, message and purpose, your website and brand will be able to experience this kind of die-hard fandom and support.

Wrapping Up

If your website could benefit from a little levity, a mascot would be a fantastic way to draw visitors into the content of your website as well as into the brand’s story. That doesn’t mean that every mascot should draw laughs or be shocking. There are plenty of recognizable and well-loved mascots that have subdued personalities. It’s all about working with the personality of your brand and fitting a mascot to it.

Further Reading on SmashingMag:

Smashing Editorial (ra, il)

New research explores the behaviour of water on the surface of graphene

New research from the Tokyo University of Science has revealed what happens to water molecules on the surface of graphene. The study, led by Professor Takahiro Yamamoto, combined statistical data analysis tools with molecular dynamics simulations to explore the change in the structure of water when in contact with the carbon-based material, suggesting there is […]

Rutgers researchers develop tunable bioink for supporting tissue growth

Biomedical engineers from Rutgers University in New Jersey have developed a bio-ink for 3D printing that enables the construction of scaffolds to support growing human tissues. Significantly, the stiffness of the scaffolds can be controlled depending on the mixture of ink used, enabling applications for different types of tissues for repair or replacement. Published in […]

3D Printing coming soon to a Telsa near you? Formlabs’ Tough 1500

Formlabs, Somerville-based manufacturer of SLA 3D printers, has announced its new material, Tough 1500.  The “1500” in the name signifies the material’s tensile modulus in MPa. Formlabs says it is the “most dynamic resin yet”, and was created based on users’ feedback. The aim was to make the material tough enough to withstand significant pressure […]

The 3D Printing Industry news bulletin

Kicking off the week, 3D Printing Industry is experimenting with a new format. Our new bulletin will get you up to speed with any additive manufacturing news you might have missed. Read on for a concise digest of new 3D printers, 3D printing events, and other updates you may have missed. Additive manufacturing events coming […]

5 Things I Wish I’d Known as a Young Web Designer

Like most things in life, no career is without its share of challenges and revelations. What’s really amazing is how experience can change our perspective and provide both insight and hindsight. It serves as a reminder that, no matter how smart we think we are, we often start out with very different ideas about what it takes to be a web designer.

This has all prompted me to think about the 20+ years I’ve spent in this industry. With it comes a whole host of things I wished I had known when I was just starting out. It may have saved a stressful incident or two, along with pushing me ahead of the curve when it comes to change.

So, fellow designers, I’m here to pass along some of the tidbits of knowledge that I wish someone had told me back in the day. May they help you on your journey! Or, at the very least, give you a hearty laugh.

1. You Don’t Need to Book Every Project

At the start of my career, my philosophy was essentially: “You need a website? Sure, I’ll build you one.” It provided a lot of experience, including a few I’d rather forget. While there is some value in that, it took me years to realize that I didn’t have to settle for every lousy project that I could find. It’s a common struggle.

When just starting out as a freelancer, it’s tempting to take every single project that comes along. But the reality is that you’re not a convenience store. The goal isn’t to sell product to everyone who walks through the door. Web design is a more nuanced game.

There are plenty of reasons why a particular project might not be a good fit. The size, the scope of work or the client’s personality can be major factors. The amount of available time in your schedule is also worth considering.

Plus, taking a project often means being stuck with it for some time. If that client comes back to your for maintenance or web hosting, you’re going to have to deal with them repeatedly.

So, before you say “yes” and sign that contract, think about the consequences and whether or not it’s the right gig for you.

A sign that reads "No".

2. Stay Flexible and Expect Change

Web design is a profession that doesn’t stay the same for very long. Trends come and go, as do tools and technologies.

As a beginner, I was very set in my ways. I just had to write every bit of code by hand (and deal with sore wrists at the end of the day). Layouts and graphics also had to be done a certain way.

But over time, I found myself out of the loop on more modern practices. This meant still using old-school table layouts while the world went to CSS. It was using my own clunky method for organizing content while the CMS was changing how websites were built.

Eventually, I figured out that I’d better adapt if I wanted to survive in this industry. While still a bit stuck in my ways, I try to acknowledge when I need to make changes to my workflow.

My advice: Love your work and your tools. But don’t expect them to last forever. Eventually, you’ll need to adapt to something new.

A book on a desk.

3. Don’t Be Afraid of What You Don’t Know

Part of the adaptation process is in boldly going where you haven’t been before. The problem is that the unknown can be awfully scary.

This was the case for me, as I often hid from the types of projects I didn’t know much about. eCommerce, for example, was terrifying. I’d convinced myself that there was simply too much to learn, and that I couldn’t possibly get up to speed.

Eventually, though, you need to take a chance or risk becoming a relic of a bygone era. And you know what? It’s not nearly as difficult as we may think.

Web designers literally have libraries worth of educational resources at our fingertips. Even better is that much of it is either free or low-cost. All it takes is the willingness to try.

A man reading outdoors.

4. Referrals Can Be the Lifeblood of Business

Signing up new clients can take up a lot of resources. And while it’s a necessary evil, if often means spending time away from design and development (a.k.a. the “fun stuff”).

In my earlier years, I spent way too much time on things that didn’t work. I tried various forms of advertising and made cold calls. The results weren’t justifying the commitment I was making (Side note: it might be because I’m terrible at sales gimmicks).

What did seem to work, however, was satisfying current clients enough that they referred others my way. This ended up being a great way to get new business – while requiring much less time and effort.

It takes a little while to get going, but once referrals start coming in, you might just say goodbye to rounding up new clients the old-fashioned way. It also goes to show that some patience can really pay off over the long haul.

Two people shaking hands.

5. Success Requires a Commitment

If you want to be successful (however you define it), don’t expect it to happen overnight. Maybe this sounds like common sense, but it’s not always so obvious. Especially when you’re first starting out, trying to establish yourself as a respected designer.

For the first few years of my career, I was convinced that I knew more than most of the people around me. It’s ultimately what led me to venture out as a freelancer. But, once I got out into the world, reality hit me like a ton of bricks.

I learned that I could only get so far on half-baked skills and little commitment to building a solid foundation. Eventually, I realized that my business couldn’t grow unless I grew as a person.

A little bit of humility, along with a strong work ethic, can help you get to where you want to go. It just takes a commitment to the process.

A laptop computer on a desk.

Advice Is One Thing, Experience Is Another

Looking back, maybe knowing all of these different things from the start wouldn’t have made such a huge difference. Why? Because the real knowledge comes from actually experiencing them.

In that way, none of the lessons above are a game-changer in themselves. But they can serve as good reminders about what it takes to be a web designer. And, more importantly, they provide those “a-ha” moments as we navigate our careers. Over time, it all adds up to a better understanding of who you are and what you do.

The post 5 Things I Wish I’d Known as a Young Web Designer appeared first on Speckyboy Design Magazine.

65 – 85% 3D Metal Filament for Desktop 3D Printers

PRINTING FILAMET™

Working with Filamet™ and Spool Placement

Due to its high metal content, Filamet™ will inherently break more easily than standard PLA. Following these instructions will make Filamet™ easy to use.

  • Place the spool so that pull and friction are reduced as much as possible. The filament should come off the spool straight into the feeder. for Direct Drive, this means you simply hang the spool right above the printer. for Bowden fed printers, this means placing the spool next to or under the feeder.

  • Use a FilaWarmer to ease the path from spool to printer.

    • The metal particles in Filamet™ are surrounded by plastic. This plastic keeps the memory of its shape on the spool. As Filamet™ passes through the warmer, the memory of the Filamet™ is reset and prints with ease. This effect lasts for about 24 hours.

    • Caution! Heating the entire spool at once will cause the filament to become extremely brittle. It’s important to heat only the single strand as it goes into the printer.

  • To report any issues with Filamet™ after trying a FilaWarmer, please contact info@thevirtualfoundry.com.

FilaWarmer Setup

The FilaWarmer comes pre-programmed to 60°C – perfect for Stainless Steel 316L and Stainless Steel 17-4 Filamet™.
For Bronze and Copper, adjust the temperature to 45°C to start.

Hang the FilaWarmer so that the top of the warming tube is at the same level as the spool center hole. Purchase a FilaWarmer in our Online Store.

Recommended Nozzle

Use a 0.6mm or larger stainless steel nozzle for the following filaments:

Use a 0.6mm or larger hardened steel nozzle for the following filaments:

Use a 0.8mm or larger hardened steel nozzle for the following filaments:


Printer Heat Settings

205-235°C (401-455°F)

Set print bed to 40-50°C (104-122°F) (optional)


Build Plate Preparation

With a glass build plate, apply a layer of glue using a glue stick. To remove the print, use water and a razor blade. If you still cannot get the print off, try freezing the build plate.

With a PEI, aluminum, or other non glass build plate, apply a layer of blue painters tape. For easier removal of prints, heat the build plate before removing the print.

Note: Do not print Filamet™ directly onto PEI. Prints will weld to the build plate.


Print Speed

30mm/sec (1800mm/min) to start.


Layer Height

Many slicers lay down an extra wide first layer to get good adhesion to the bed.

This is not a problem unless the first layer is very short. With traditional PLA, it will simply squeeze out at the sides. Filamet™ is more viscous which slows this process. If the nozzle seems clogged, it may be that the nozzle is too close to the build plate on the first layer. Once dialed in, some users are printing down to a layer height of 0.1mm.


Printing Tips

  • Filamet™ prints just like any other PLA 3D printing filament, with one exception… start slow. Rushed prints are the most common cause of rough prints.

  • With experience, prints can be faster, but for a quick win on a first try, start at about 30mm/sec (1800mm/min). Increase to normal speed as experience is gained.

  • Don’t be afraid to turn up your flow rate. Filamet™ prints different from other filaments and requires a greater flow to fill in all the gaps for a perfect, high density part.

    • Infill should overlap perimeters to ensure a solid part.

  • If prints fail from jams after the first layer, make sure the temperature on your printer is accurate.

  • For recommended print settings by filament, checkout the technical data sheets.


TVF’s Simplify3D FFF profiles: Use as a base for starting to use Filamet™.

SANDING AND POLISHING FILAMET™

P1200030.jpg

Sanding and polishing our metal filaments
With heat, our metal filament becomes clay-like. It can be carved, re-sculpted, pieces can be added and seams smoothed.

How to avoid melting when sanding metal filament
Important! Constant movement to different areas of the part is necessary when sanding to avoid unintentional melting. Experimenting is worthwhile.

Needle file:  To make print lines vanish, sand the surface even. The loose particles from sanding are smashed into the print line gaps with the heat from the friction, fixing them in place. This step is complete once the entire print’s surface is smooth and even.

Sandpaper or 3M Radial Disc:  Start with 120 grit sandpaper or 80 grit 3M Radial Disc, and go over every part of the print. The matte surface will become shiny as finer grits are used. Complete the entire surface of the print before moving to the next grit. The Virtual Foundry recommends using 4 grits with 3M and 6 or 7 grits with sandpaper. A nice shine can be achieved with less, but the mirror shine comes closer to the 7, ending around 3000 grit. After sanding, rub the print down with some flannel or a sunshine cloth to clean off loose particles. A mirror shine should be evident at this phase, even before the last step.

Sewn Buff and Zam:  Place sewn buff on a rotary tool, then liberally apply zam to the buff and to your print. The print will melt if it gets too hot, so it is critical to keep the buffer moving and continue to apply zam liberally. It may be useful to practice this step on a simple print or a “failed print.”

SINTERING FILAMET™

SINTERING IN AN OPEN ENVIRONMENT
(COPPER AND BRONZE FILAMET™ ONLY)


Items Needed:  

Kiln / Sintering Furnace
Refractory Container (Crucible)
Sintering Refractory Ballast
AI₂O₃

Coconut Shell Carbon
Brass brush

Crucible Preparation:

  1. Place a 10mm layer of refractory (AI₂O₃) on the bottom of a stainless steel crucible.

  2. Position the part(s) avoiding contact with other parts or the walls of the crucible.

  3. Cover the parts completely with a minimum of 10mm of refractory (AI₂O₃). Tap the crucible gently to compact the refractory around each part.

  4. Place a 10mm layer of granular coconut shell carbon on top of the refractory and place a suitable stainless steel cover over the crucible.

Sintering Program:

  1. Phase 1: Ramp Kiln/Furnace Temperature by 120°C per hour up to 815°C (Bronze) or 1000°C (Copper). Do not hold.

  2. Phase 2: Ramp Kiln Temperature by 25°C per hour to sinter temperature; 870°C (Bronze) or 1050°C (Copper) and hold at sinter temp for 1.5 hours for very small parts (15g or less) or up to 5.0 hours or more for larger parts (300g+).

  3. NOTE – Sinter temperature and hold times may vary based on Kiln model, part density and design.

  4. Let the crucible cool fully (less than 50°C) before handling the sintered part.

Post Sintering:

  1. Use a brass brush to clean the surface of the part under running water.

  2. Polish the part using a Dremel or in a tumbler using a suitable polishing media, water and detergent (dish soap).

Technical Support:

This open atmosphere sintering process was developed exclusively by Sapphire3D Inc. Sapphire3D Inc. is a Reseller of The Virtual Foundry Materials. For Sintering Services and Technical Support, contact Sapphire3D, Inc. directly at:

www.sapphire3D.com

Info@sapphire3d.com

SINTERING IN A VACUUM
OR INERT ENVIRONMENT
(ALL MATERIALS)

Items Needed:  
Sintering Furnace (Options Here)
Refractory Container (Crucible)
Sintering Refractory Ballast:
Powdered Graphite
AI₂O₃

Prep:  Place the object in the refractory, ensuring the entire print and all surfaces are completely covered and any protruding areas are fully supported. The print must be fully surrounded by the refractory. Ensure that at least 10mm of refractory insulates the print from the walls of the crucible.

Fire:  Place the Crucible in the furnace and begin the firing cycle.

Firing Cycle:

1. Start at room temperature.

2. Over the course of 200 minutes, ramp temp to 205°C (401°F). Do not hold.

3. Over the course of 180 minutes, ramp temp to 400°C (752°F). Do not hold.

4. For Copper: Over the course of 180 minutes, ramp temp to 1000°C (1832°F) and hold for 440 minutes.

For Bronze: Over the course of 180 minutes, ramp temp to 815°C (1499°F) and hold for 440 minutes.

For Stainless Steel 316L: Over the course of 180 minutes, ramp temp to 1225°C (2237°F) and hold for 240 minutes.

For High Carbon Iron: Over the course of 180 minutes, ramp temp to 1120°C (2048°F) and hold for 400 minutes.

5. End cycle and let furnace cool to ambient temp until Crucible can be removed by hand.

 *Note: Every situation is different and you may need to modify your sintering times and temperatures based on your application and use of our materials. These are just general guidelines.*

This process takes around 12 hours and has been tested on prints up to 200g.

For first trials, plan for 15-20% shrinkage of the part overall through the sintering process.

Tip:  The mechanical properties of the final product are directly related to how long the print is held at the sintering temperature. If the end product is powdery and brittle, it’s under sintered. If the print looks like old wrinkled fruit, it’s over-sintered.

Print is ready for finish work!

Filament  Sinter Temp
Aluminum 6061 Filamet™  555°C (1031°F)
Bronze Filamet™  815°C (1499°F)
Copper Filamet™  1000°C (1832°F)
High Carbon Iron Filamet™  1250-1350°C (2282-2462°F)
R3DS Tungsten Filament  1200-1400°C (2192-2552°F)
Stainless Steel 316L Filamet™  1200°C (2192°F)

Researchers create roadmap for 3D bioprinting

A worldwide collective of researchers and scientists from universities, institutions, and hospitals have come together to produce a roadmap for 3D bioprinting.  Published in Biofabrication, the paper details the current state of bioprinting, including recent advances of the technology in selected applications as well as the present developments and challenges. It also envisions how the […]

3DCERAM-SINTO ceramics technology used to manufacture X-ray imaging components

Technology from Limoges-based ceramics 3D printer manufacturer, 3DCERAM-SINTO, is set to dramatically increase the potency of current medical X-ray imaging technology via the addition of 3D printed detection components. The 2001-founded ceramics expert will use its advanced ceramics 3D printing technology to aid in the completion of the European Project H2020 NEXIS – developing the […]

Urwahn’s new bike is 3D printed and electric

German bicycle manufacturer Urwahn Bikes has announced a 3D printed e-bike, called Platzhirsch – this can be translated bigwig, big cheese or stag, referring to the bike’s “bursting power”.  To make the bicycle electric, Urwahn Bikes worked with MAHLE ebikemotion, the electronic component integration specialist of automotive parts manufacturer MAHLE.  The electronic components, including an LED […]

Staying Up To Date With Smashing Monthly Updates

Staying Up To Date With Smashing Monthly Updates

Staying Up To Date With Smashing Monthly Updates

Iris Lješnjanin

An important part of our job is staying up to date, and we know how difficult it can be. Technologies don’t really change that fast — coding languages take a long time to be specified and implemented. But the ideas surrounding these technologies and the things we can do with them are constantly evolving, and hundreds of blog posts and articles are published every day. There’s no way you can read all of those but you’ll still have to keep up to date.

Fear not, we’ve got your backs! Our bi-weekly Smashing Podcast has you covered with a variety of topics across multiple levels of expertise.

A shout-out and big thank you to both Drew McLellan and Bethany Andrew for making the episodes so brilliantly witty and informative!

Topple the cat wearing headphones and holding a coffee-to-go cup while listening to the Smashing Podcast
Catching up with what’s new in the web industry doesn’t mean you have to be tied up to a chair and desk! Do as Topple the Cat does it: grab your headphones and stretch those legs! You can subscribe and tune in anytime with any of your favorite apps.

A Lovely New Addition To The Smashing Books

We’re so proud to be introducing a new book to the Smashing bookshelf — a cover so eloquently designed and a book that covers topics that are very close to our hearts: ethics and privacy.

The “The Ethical Design Handbook” is our new guide on ethical design for digital products that respect customer choices and are built and designed with ethics in mind. It’s full of practical guidelines on how to make ethical decisions to influence positive change and help businesses grow in a sustainable way.

The cover of the Ethical Design Handbook
Written by Trine Falbe, Martin Michael Frederiksen and Kim Andersen. You can download a free PDF excerpt (5 MB) (also available as ePUB and Kindle) and get a sneakpeek beforehand!

Of course, you can jump right over to the table of contents and see for yourself, but be sure to pre-order the book while you can! There’s still a discount available before the official release — we’ll start shipping printed hardcover copies in the first two weeks of March! Stay tuned!

Learning And Networking, The Smashing Way

Our SmashingConfs are known to be friendly, inclusive events where front-end developers and designers come together to attend live sessions and hands-on workshops. From live designing to live debugging, we want you to ask speakers anything — from naming conventions to debugging strategies. For each talk, we’ll have enough time to go into detail, and show real examples from real work on the big screen.

We like to bring you closer to folks working in the web industry, and so every once in a while we interview the speakers who share the stage! For SmashingConf Austin, the spotlight shined on:

  • Miriam Suzanne, who’ll be talking about the wonderful new world of CSS, new techniques and possibilities.
  • Zach Leatherman, who’ll let us in on everything we need to know about type,font performance tooling and general workflow when it comes to web fonts.
  • Rémi Parmentier, who’ll bring us closer to the good ol’ HTML Email, common techniques, state of things and what you can achieve with HTML Email today (if you are willing enough to explore its unconventional world).
Four different illustrations designed by Ricardo Gimenes dressed up in different costumes representing each city where the SmashingConf will take place this year
This year, we’re organizing SmashingConf in four cities — see you there?

Shining The Spotlight On Optimizing Video Files

Mark your calendars! In less than two weeks (Feb. 25, we’ll be hosting a Smashing TV webinar with Doug Sillars who’ll be sharing several possible scenarios to optimize video files for fast and efficient playback on the web. Join us at 17:00 London time — we’d love to hear your thoughts and experiences you’ve had in your career!

Smashing TV illustration with Topple the Cat holding a video camera
Smashing TV is a series of webinars and live streams packed with practical tips for designers and developers. Think of it as some sort of a Hollywood blockbuster with cats, but only better, because it’s for people like you!

Ricardo Gimenes, the talent behind the illustrations on all things SmashingWe often get asked who the creative talent behind the illustrations is: It’s the one-and-only Ricardo Gimenes, someone we’re ever so proud to have in our team!

We publish a new article every day on various topics that are current in the web industry. Here are some that our readers seemed to enjoy the most and have recommended further:

  • How To Create Maps With React And Leaflet
    by Shajia Abidi
    Leaflet is a very powerful tool, and we can create a lot of different kinds of maps. This tutorial will help you understand how to create an advanced map along with the help of React and Vanilla JS.
  • Understanding CSS Grid: Grid Template Areas
    by Rachel Andrew
    In a new series, Rachel Andrew breaks down the CSS Grid Layout specification. This time, she takes us through grid-template-areas and how it can be used to place items.
  • How To Create A Headless WordPress Site On The JAMstack
    by Sarah Drasner & Geoff Graham
    In this post, Sarah and Geoff set up a demo site and tutorial for headless WordPress — including a starter template! They explain how to set up a Vue application with Nuxt, pulling in the posts from our application via the WordPress API.
  • Magic Flip Cards: Solving A Common Sizing Problem
    by Dan Halliday
    In this article, Dan reviews the standard approach to creating animated flip cards and introduces an improved method which solves its sizing problem.

Best Picks From Our Newsletter

With the start of a brand-new decade, we decided to start off with topics dedicated to web performance. There are so many talented folks out there working on brilliant projects, and we’d love to spread the word and give them the credit they deserve!

Note: A huge thank you to Cosima Mielke for writing and preparing these posts!

Tiny Helpers For Web Developers

Minifying an SVG, extracting CSS from HTML, or checking your color palette for accessibility — we all know those moments when we need a little tool to help us complete a task quickly and efficiently. If you ever find yourself in such a situation again, Tiny Helpers might have just the tool you’re looking for.

Tiny Helpers

Maintained by Stefan Judis, Tiny Helpers is a collection of free, single-purpose online tools for web developers. The tools cover everything from APIs, accessibility, and color, to fonts, performance, regular expressions, SVG, and unicode. And if you know of a useful tool that isn’t featured yet, you can submit a pull request with your suggestion. One for the bookmarks.

Real-World Color Palette Inspiration

There are a lot of fantastic sites out there that help you find inspiring color palettes. However, once you have found a palette you like, the biggest question is still left unanswered: how should you apply the colors to your design? Happy Hues is here to help.

Happy Hues

Designed by Mackenzie Child, Happy Hues gives you color palette inspiration while acting as a real-world example for how the colors could be used in your design. Just change the palette, and the Happy Hues site changes its colors to show you what your favorite palette looks like in an actual design. Clever!

Free Usability Heuristics Posters

Back in 1994, Jakob Nielsen wrote an article for Nielsen Norman Group, outlining general principles for interface design: the 10 usability heuristics. Today, decades later, these heuristics still serve as a checklist for interface designers. A fact that inspired the folks at Agente Studio to create a set of posters dedicated to them.

Usability poster illustrating the principle Aesthetic and Minimalist Design.

Each of the ten beautifully-designed posters illustrates and explains one of Nielsen’s heuristics. The posters are CC-licensed and can be downloaded and printed for free after you shared the page on social media. JPEG and EPS formats are available.

A Guide To Fighting Online Tracking

It’s no secret that we’re being tracked online. And while we can’t stop all of it, there are things we can do to fight back.

Illustration of a woman sweeping data away.

In his New York Times article, Tim Herrera dives deeper into the data companies collect about us and how they share it with third parties, into “secret scores” and shocking third-party reports that list our delivery service orders and private Airbnb messages from years ago. Besides being a good reminder to be more wary of handing out our data, the article features links to tools and practical tips for preventing advertiser tracking. A must-read.

The Illustrated Children’s Guide To Kubernetes

Have you ever tried to explain software engineering to a child or to a friend, colleague, or relative who isn’t that tech-savvy? Well, finding easy words to explain a complex concept can be a challenge. A challenge that “The Illustrated Children’s Guide to Kubernetes” masters beautifully.

The Illustrated Children’s Guide to Kubernetes

Designed as a storybook and available to be read online or as a PDF, the free guide tells the story of a PHP app named Phippy who wished she had her own environment, just her and a webserver she could call home. On her journey, she meets Captain Kube who gives her a new home on his ship Kubernetes. A beautiful metaphor to explain the core concept of Kubernetes.

Generator Of Geometric Shapes

To stand out from the crowd of a myriad of websites out there, we can define one unique thing, the signature, that brings a bit of personality into our digital products. Perhaps it’s a little glitch effect, or a pencil scribble, a game or unusual shapes. Or, it could be a set of seemingly random geometric flow lines.

Flow Lines Generator

Flow Lines Generator produces random geometric lines, and we can adjust the formulas and distances between the shapes drawn, and then export the outcome as SVG. Perhaps every single page on your site could have a variation of these lines in some way? It might be enough to stand out from the crowd, mostly because nobody else has that exact visual treatment. It might be worth looking at!

Git From Beginner To Advanced

Most of us will be dealing with Git regularly, sometimes running Git commands from terminal, and sometimes using a visual tool to pull, push, commit and merge. If you feel like you’d like to supercharge your skills and gain a few Git superpowers, where do you start?

Git Cheat Sheet

Mike Riethmueller has published a quick guide to Git, from beginner to advanced, explaining how Git works, how to configure it, aliases, important commands, staging/unstaging files, managing merge conflicts, stashing and a few advanced tips. Need more advanced stuff? Harry Roberts has published “Little Things I Like To Do With Git”, Atlassian has Advanced Git Tutorials, Bruno Passos lists useful git commands, and GitHub provides a Git Cheat Sheet PDF.

The Museum Of Obsolete Media

Do you remember the days when you listened to a music cassette on your Walkman, watched your favorite movie on video tape instead of streaming it, or stored your data on a floppy disk? The media we considered state-of-the-art back then, is obsolete today. And, well, a lot of other formats shared the same fate in the past.

IBM Magnabelt

In his Museum of Obsolete Media, Jason Curtis collects examples of media that went out of use, not just the ones you might remember, but also real curiosities and treasures dating back as far as to the middle of the 19th century. Things like the “carte de visite”, “Gould Moulded Records”, or “Magnabelt” for example. A fascinating trip back in time.

Each and every issue of the Smashing Newsletter is written and edited with love and care. No third-party mailings or hidden advertising — you’ve got our word.

Smashing Editorial (cm, vf, ra, il)

Markforged introduces pure copper to the Metal X 3D printer

US-based composite and metal 3D printer provider Markforged, has released a pure copper material option for use with the Metal X 3D printer.  By enabling copper 3D printing on the Metal X system, already compatible with a number of metal materials, Markforged aims to drive new manufacturing and supply chain efficiencies for customers. According to […]

Weekly News for Designers № 527

Envato Elements

UX Debt 101 – Learn what UX Debt is, how to identify it and how to resolve it.
Example from UX debt 101

10 Fantastic Podcasts for UX Designers for 2020 – Stay in the know with these podcasts aimed at UX designers.
Example from 10 Fantastic Podcasts for UX Designers for 2020

Crafting a Cutout Collage Layout with CSS Grid and Clip-path – Learn the secrets to creating this incredible effect with CSS.
Example from Crafting a Cutout Collage Layout with CSS Grid and Clip-path

Octomments – A tool that enables the use of GitHub issues as a comment system.
Example from Octomments

Design systems hub – A collection of best practices for…you guessed it: Design systems.
Example from Design systems hub

Creating a Custom User Role in WordPress – Custom user roles can provide just the capabilities your users actually need.
Example from Creating a Custom User Role in WordPress

Stacking Cards Effect – Learn how to create a stacking cards effect with CSS and Intersection Observer API.
Example from Stacking Cards Effect

How I recreated a Polaroid camera with CSS gradients only – A look at creating physical objects with a bit of CSS.
Example from How I recreated a Polaroid camera with CSS gradients only

Looking Outside of Web Design for Inspiration – Want to create something truly original? Look to areas outside of web design.
Example from Looking Outside of Web Design for Inspiration

Light and dark themed SVG favicon using the CSS prefers-color-scheme media feature – Load a favicon based on the browser’s color scheme.
Example from Light and dark themed SVG favicon using the CSS prefers-color-scheme media feature

Glitch Art Generator – Use this online tool to create compelling glitch effects for your projects.
Example from Glitch Art Generator

Dot Matrix – Generate a dot matrix screen with animated movements based on mouse/touch events.
Example from Dot Matrix

Avatar Library – Create a unique avatar illustration using the free Sketch App or Figma library.
Example from Avatar Library

25 Best Free Corporate Business Flyer Templates – Get your point across to customers with these stunning flyers.
Example from 25 Best Free Corporate Business Flyer Templates

Eye-Pop Vectors ® – Spice up your projects with these amazingly hand-crafted and open-source vector illustrations.
Example from Eye-Pop Vectors

Neumorphism.io – A tool for creating Soft-UI CSS code.
Example from Neumorphism.io

Sleuth – An open-source tool that enables your team to see how and where your design components are being used.
Example from Sleuth

50 Free Wireframe Templates for Mobile, Web and UX Design – A collection of templates that will get your projects off to a quick start.
Example from 50 Free Wireframe Templates for Mobile, Web and UX Design

The post Weekly News for Designers № 527 appeared first on Speckyboy Design Magazine.

Researchers develop handheld 3D bioprinter for treating large skin burns

Researchers from the University of Toronto (UoT) and Sunnybrook Health Sciences Centre have developed a handheld device capable of 3D bioprinting sheets of skin that can heal burn wounds.  Described as a “handheld 3D printer”, the device deposits sheets of material formed by a bioink that covers the wound, helping to accelerate the skin’s healing […]

Certification giant Element doubles down on California powder characterization facility

Global material and product certification leader Element has upgraded its laboratory in Huntington Beach, California with a dedicated characterization facility for additive manufacturing powders. The new testing equipment will allow for chemical composition analysis, powder sieve analysis, particle size distribution, flow rate, apparent density, tap density, and gas pycnometry – a method of measuring an […]

Wilhelmsen completes landmark delivery of 3D printed parts for maritime

Global maritime industry group Wilhelmsen has delivered a number of 3D printed parts to dry bulk shipping company Berge Bulk. Slated as a “landmark commercial delivery” by Wilhelmsen, the components included a set of 3D printed scupper plugs, delivered as part of the company’s Early Adopter Program (EAP) with additive manufacturing service bureau Ivaldi Group.  […]

Xometry promoted to prime by Dassault in on-demand MAKE marketplace

Dassault Systèmes, a software developer, has announced Xometry, an on-demand manufacturing marketplace, as the first “prime partner” on Dassault’s MAKE marketplace. MAKE marketplace as launched in 2018 as a service to connect designers with service bureaus and machine shops. At the time Xometry was among a number of early partners. Users can access additive manufacturing, […]

Setting Up API Mocking With Mirage JS And Vue.js

Setting Up API Mocking With Mirage JS And Vue.js

Setting Up API Mocking With Mirage JS And Vue.js

Kelvin Omereshone

In the era of SPA and the JAMstack, there has always been a separation of concern between the APIs and front-end development. Almost all JavaScript projects that can be found out in the wild interact with a web service or API and either use it for authentications or getting user-related data.

So, whenever you’re working on a project and the necessary API still hasn’t been implemented by the back-end team or you need to quickly test a feature, you have some of the following options:

  • You could proxy to a locally running version of your actual backend which, in most cases as a front-end developer, you wouldn’t have.
  • You could comment out actual request and replace with mock data. (This is okay but not so great as you would need to undo that to get to production and you might not be able to deal with network states and latency.)

What Is API Mocking?

API mocking is an imitation or a simulation of an actual API. It is mostly done in order to intercept requests that are supposed to be made to an actual backend API but this mocking exist on your frontend.

Why is API Mocking Important

API mocking is significantly important in a lot of ways:

  1. It makes for a very good front-end development experience not to depend on production APIs before building out features.
  2. You could share your entire frontend and it would work without depending on an actual backend API.

What Is Mirage JS?

Mirage JS was created 5 years ago and was pretty much used in the Ember community before Sam Selikoff officially announced its release on the 24th of January, 2020 on Twitter.

Mirage JS solves the pain point for testing backend APIs without depending on those APIs. It allows for seamless front-end development experience by mocking production APIs.

Mirage JS is an API mocking library for Vue.js, React, Angular and Ember frameworks

What Makes Mirage JS A Better Choice?

There have been other options for API mocking (such as Axios interceptors, Typicode’s JSON server, and so on) but what I think is pretty interesting about Mirage is that it doesn’t get in the way of your development process (as you would see when we set it up with Vue in a bit). It is lightweight and yet powerful.

It comes with battery included out of the box that allows you to replicate real production API consumption scenarios like simulating a slow network with its timing option.

Getting Started With Mirage JS And Vue.js

So now that you know what Mirage JS is and why it’s important to your front-end development workflow, let’s look at setting it up with the progressive web framework: Vue.js.

Creating A Green-Field (Clean Installation) Vue Project

Using the Vue CLI, create a fresh Vue.js project by going into the directory you want the project to be created in and running (in your terminal):

vue create miragejs-demo-vue 

The above command would set up a new Vue project which you can now cd into and run either yarn serve or npm run serve.

#Installing Mirage JS

Now let’s install Mirage JS as a development dependency in our Vue.js project by running the following command:

yarn add -D miragejs

Or if you are using NPM, run this:

npm install --save-dev miragejs

And that’s it! Mirage JS is now installed in our Vue.js project.

Let’s Mock Out Something

With Mirage JS installed, let’s see how we configure it to talk to Vue and mock out a basic todos (an API that returns a list of todos) API.

Define Your Server

To get started, we need to create a server.js file in the /src directory of our Vue.js project. After that, add the following:

import { Server, Model } from 'miragejs'

export function makeServer({ environment = "development" } = {}) {

let server = new Server({
  environment,

    models: {
      todo: Model,
    },

  seeds(server) {
  server.create("todo", { content: "Learn Mirage JS" })
  server.create("todo", { content: "Integrate With Vue.js" })
  },

  routes() {

    this.namespace = "api"

    this.get("/todos", schema => {
      return schema.todos.all()
    })
    
  },
  })

  return server
}

Code Explained

Firstly, the server.js file is how you set up Mirage JS to create a new instance of it’s mock (fake) server which will intercept all API calls you make in your app matching the routes that you define.

Now, I agree the above may be overwhelming at first, but let’s take a closer look at what’s going on here:

import { Server, Model } from 'miragejs'

From the above code snippet, we are importing Server and Model from miragejs.

  • Server
    This is a class exposed by Mirage to helps us instantiate a new instance of a Mirage JS server to “serve” as our fake server.
  • Model
    Another class exposed by Mirage to help in creating models(a model determines the structure of a Mirage JS database entry) powered by Mirage’s ORM.
export function makeServer({ environment = "development" } = {}) {}

The above basically export a function called makeServer from the src/server.js. You could also note we are passing in an environment parameter and setting Mirage’s environment mode to development (you would see us passing test environment later on in this article).

The Body Of makeServer

Now we are doing a couple of things in the makeServer body. Let’s take a look:

let server = new Server({})

We are instantiating a new instance of the Server class and passing it a configuration option. The content of the configuration options help set up mirage:

{
  environment,

  models: {
    todo: Model,
  },

  seeds(server) {
  server.create("todo", { content: "Learn Mirage JS" })
  server.create("todo", { content: "Integrate With Vue.js" })
  },

  routes() {

    this.namespace = "api"

    this.get("/todos", schema => {
      return schema.todos.all()
    })
  },
  
  }

Firstly we are passing the environment parameter we initialized in the function definition.

models: {
    todo: Model,
  },

The next option which is the models option takes an object of the different models we want Mirage to mock.

In the above, we simply want a todo model which we are instantiating from the Model class.

seeds(server) {
server.create("todo", { content: "Learn Mirage JS" })
server.create("todo", { content: "Integrate With Vue.js" })
},

The next option is the seeds method which takes in a parameter called server. The seeds method helps create seeds(seeds are initial data or an entry into Mirage’s database) for our models. In our case to create the seeds for the todo model we do:

server.create("todo", { content: "Learn Mirage JS" })
server.create("todo", { content: "Integrate With Vue.js" })

so the server has a create method which expects as the first argument a string which corresponds to the name of the model, then an object which will contain the properties or attributes of a particular seed.

routes() {

    this.namespace = "api"

    this.get("/todos", schema => {
      return schema.todos.all()
    })
  },

finally, we have the routes method which defines the various route(routes are our mock API endpoints) Mirage JS is going to mock. Let’s look at the body of the method:

this.namespace = "api"

this line sets up the namespace for all routes that means our todo route can now be accessed from /api/todos.

this.get("/todos", schema => {
  return schema.todos.all()
})

The above creates a get route and it’s handler using the this.get() method. The get() method expects the route i.e “/todos” and a handler function that takes in schema as an argument. The schema object is how you interact with Mirage’s ORM which is powered by Mirage JS in-memory database.

Finally:

return schema.todos.all()

We are returning a list of all our todos, using the schema object made possible by Mirage’s ORM.

src/main.js

So we are done setting up src/server.js but Vue doesn’t know about it(at least not yet). So let’s import it in our main.js file like so:

import { makeServer } from "./server"

Then we call the makeServer function like so:

if (process.env.NODE_ENV === "development") {
  makeServer()
}

The above if conditional is a guard to make sure mirage only runs in development.

Set up Complete!

Now we’ve set up Miragejs with Vue. Let’s see it in action. In our App.vue file, we would clear out the content and replace with the below snippet:

<template>
  <ul id="todos">
    <li v-for="todo in todos" v-bind:key="todo.id">{{ todo.content }}</li>
  </ul>
</template>

<script>
  export default {
    name: 'app',

    data() {
      return {
        todos: []
      }
    },

    created() {
      fetch("/api/todos")
        .then(res => res.json())
        .then(json => {
          this.todos = json.todos
        })
    }
  }
</script>

If you are familiar with Vue.js, the above would be nothing new but for the sake of being total, what we are doing is making an API request using fetch when our App.vue component is created, then we pass in the returned data to the todos array in our component state. Afterward, we are using a v-for to iterate the todos array and displaying the content property of each todo.

Where Is The Mirage JS Part?

If you notice, in our App.vue component, we didn’t do anything specific to Mirage, we are just making an API call as we would normally do. This feature of Mirage is really great for DX cause under the hood, Mirage would intercept any requests that match any of the routes defined in src/server.js while you are in development.

This is pretty handy cause no work would be needed in your part to switch to an actual production server when you are in a production environment provided the routes match your production API endpoints.

So restart your Vue dev server via yarn serve to test Mirage JS.

You should see a list of two todos. One thing you’d find pretty interesting is that we did not need to run a terminal command to start up Mirage because it removes that overhead by running as a part of your Vue.js application.

Mirage JS And Vue test-utils

If you are already using Vue Test-utils in your Vue application, you’d find it exciting to know that Mirage can easily work with it to mock network requests. Let’s see an example set up using our todos application.

We would be using Jest for our unit-testing. So if you are following along, you could pretty much use the Vue CLI to install the @vue/unit-jest plugin like so:

vue add @vue/unit-jest

The above will install @vue/cli-plugin-unit-jest and @vue/test-utils development dependencies while also creating a tests directory and a jest.config.js file. It will also add the following command in our package.json scripts section (pretty neat):

"test:unit": "vue-cli-service test:unit"

Let’s Test!

We would update our App.vue to look like this:

<!-- src/App.vue -->
<template>
  <div v-if="serverError" data-testid="server-error">
    {{ serverError }}
  </div>

  <div v-else-if="todos.length === 0" data-testid="no-todos">
    No todos!
  </div>

  <div v-else>
    <ul id="todos">
      <li
        v-for="todo in todos"
        v-bind:key="todo.id"
        :data-testid="'todo-' + todo.id"
      >
        {{ todo.content }}
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    name: "app",

    data() {
      return {
        todos: [],
        serverError: null,
      }
    },

    created() {
      fetch("/api/todos")
        .then(res => res.json())
        .then(json => {
          if (json.error) {
            this.serverError = json.error
          } else {
            this.todos = json.todos
          }
        })
    },
  }
</script>

Nothing really epic is going on in the above snippet; we are just structuring to allow for the network testing we would be implementing with our unit test.

Although Vue CLI has already added a /tests folder for us, I find it to be a much better experience when my tests are placed close to the components they are testing. So create a /__tests__ folder in src/ and create an App.spec.js file inside it. (This is also the recommended approach by Jest.)

// src/__tests__/App.spec.js
import { mount } from "@vue/test-utils"
import { makeServer } from "../server"
import App from "../App.vue"

let server

beforeEach(() => {
  server = makeServer({ environment: "test" })
})

afterEach(() => {
  server.shutdown()
})

So to set up our unit testing, we are importing the mount method from @vue/test-utils, importing the Miragejs server we created earlier and finally importing the App.vue component.

Next, we are using the beforeEach life cycle function to start the Mirage JS server while passing in the test environment. (Remember, we set by default the environment to be development.)

Lastly, we are shutting down the server using server.shutdown in the afterEach lifecycle method.

Our Tests

Now let’s flesh out our test (we would be adopting the quickstart section of the Mirage js docs. So your App.spec.js would finally look like this:

// src/__tests__/App.spec.js

import { mount } from "@vue/test-utils"
import { makeServer } from "./server"
import App from "./App.vue"

let server

beforeEach(() => {
  server = makeServer({ environment: "test" })
})

it("shows the todos from our server", async () => {
  server.create("todo", { id: 1, content: "Learn Mirage JS" })
  server.create("todo", { id: 2, content: "Integrate with Vue.js" })

  const wrapper = mount(App)

  // let’s wait for our vue component to finish loading data
  // we know it’s done when the data-testid enters the dom.
  await waitFor(wrapper, '[data-testid="todo-1"]')
  await waitFor(wrapper, '[data-testid="todo-2"]')

  expect(wrapper.find('[data-testid="todo-1"]').text()).toBe("Learn Mirage JS")
  expect(wrapper.find('[data-testid="todo-2"]').text()).toBe("Integrate with Vue.js")
})

it("shows a message if there are no todo", async () => {
  // Don’t create any todos

  const wrapper = mount(App)
  await waitFor(wrapper, '[data-testid="no-todos"]')

  expect(wrapper.find('[data-testid="no-todos"]').text()).toBe("No todos!")
})

// This helper method returns a promise that resolves
// once the selector enters the wrapper’s dom.
const waitFor = function(wrapper, selector) {
  return new Promise(resolve => {
    const timer = setInterval(() => {
      const todoEl = wrapper.findAll(selector)
      if (todoEl.length > 0) {
        clearInterval(timer)
        resolve()
      }
    }, 100)
  })
}

afterEach(() => {
  server.shutdown()
})

Note: We are using a helper here (as defined in the Mirage JS docs). It returns a promise that allows us to know when the elements we are testing are already in the DOM.

Now run yarn test:unit.

All your tests should pass at this point.

Testing Different Server State With Mirage JS

We could alter our Mirage JS server to test for different server states. Let’s see how.

// src/__tests__/App.spec.js
import { Response } from "miragejs"

First, we import the Response class from Mirage, then we create a new test scenario like so:

it("handles error responses from the server", async () => {
  // Override Mirage’s route handler for /todos, just for this test
  server.get("/todos", () => {
    return new Response(
      500,
      {},
      {
        error: "The database is taking a break.",
      }
    )
  })

  const wrapper = mount(App)

  await waitFor(wrapper, '[data-testid="server-error"]')

  expect(wrapper.find('[data-testid="server-error"]').text()).toBe(
    "The database is taking a break."
  )
})

Run your test and it all should pass.

Conclusion

This article aimed to introduce you to Mirage JS and show you how it makes for a better front-end development experience. We saw the problem Mirage JS created to address (building production-ready front-end without any actual backend API) and how to set it up with Vue.js.

Although this article scratched the surface of what Mirage JS can do, I believe it is enough to get you started.

  • You could go through the docs as well as join the Mirage JS discord server.
  • The supporting repo for this article is available on GitHub.

References

Smashing Editorial (dm, il)

VELO3D and Honeywell to qualify Sappire 3D printer for aerospace

VELO3D, a Californian metal 3D printer manufacturer, has announced a partnership with Honeywell Aerospace to qualify VELO3D’s Sapphire 3D printer for use in the production of components for aerospace applications. The qualification process will determine the viability of the Sapphire 3D printer as a manufacturing system for 3D printing aircraft components. As the aerospace division […]