CSS Snippets on Speckyboy Design Magazine https://speckyboy.com/topic/css-snippet/ Design News, Resources & Inspiration Tue, 19 Dec 2023 13:28:21 +0000 en-US hourly 1 8 CSS & JavaScript Snippets for Creating Complex Gradients https://speckyboy.com/snippets-gradients/ https://speckyboy.com/snippets-gradients/#respond Mon, 27 Nov 2023 18:50:29 +0000 https://speckyboy.com/?p=156265 Gradients are a true staple of web design. Their beauty lies in their versatility. Use them to make a big, bold statement. Or use them as an accent piece to...

The post 8 CSS & JavaScript Snippets for Creating Complex Gradients appeared first on Speckyboy Design Magazine.

]]>
Gradients are a true staple of web design. Their beauty lies in their versatility. Use them to make a big, bold statement. Or use them as an accent piece to create a mood.

The possibilities have never been greater. Modern CSS and JavaScript allow us to do more than mimic print design. We can use them to add movement and interactivity to the mix. But it goes deeper.

Gradients are no longer limited to container backgrounds. They can also style text content. It’s an opportunity to enhance headlines and calls to action.

So, what kinds of things can you do with gradients? We scanned the archives of CodePen to find eight great examples.



Grainy & Gradients Text Using color-mix by LukyVJ

This snippet uses the recent CSS color-mix property. The property simplifies the process of darkening, lightening, and desaturating colors. The result is a beautiful text gradient that allows the page background to come through. We don’t often associate gradients with graininess. But it works to perfection here.

See the Pen Grainy & Gradients text by LukyVJ

Single Element Gradient Background Patterns by Ana Tudor

Conic gradients add a unique twist to the element. The color transitions rotate around a center point. You can see it on display in this example. Each card sports a unique and intricate pattern.

See the Pen 1 element card background patterns (see description) by Ana Tudor

Animated Radial Gradient Pattern by Loktar

Gradients still make great backgrounds. And this animated presentation demonstrates how far they’ve come. It looks amazing. The relatively few lines of code that powers it are equally impressive.

See the Pen Moving Radial Gradient Pattern by Loktar

Single DIV Radial Gradient Swirl by Adam Argyle

How can a single div element contain so many colors? The magic is in multiple radial gradients. Four gradients start at the edges and meet in the middle. The result is a colorful delight.

See the Pen 4 Corner Radial Gradient Swirl by Adam Argyle

AI Prompt UI with Subtle Gradient by Vincent Durand

Check out the subtle gradient on this artificial intelligence (AI) interface. It cleverly mixes with glassmorphism to produce a unique aesthetic. The effect brings life to the page.

See the Pen Imagica – AI prompt UI by Vincent Durand

Radial Gradient Cursor Trailer by Uzo Awili

Here’s an example of gradients shining a light on a background image. Move your cursor and watch as it casts a bright pink hue. A tiny bit of CSS and JavaScript makes it work.

See the Pen Radial Gradient Cursor Trailer – Using Gradient Positioning by Uzo Awili

Magical CSS Blossoming Flowers at Night Md Usman Ansari

Gradients play a sizeable role in this “magical” snippet. They add dimension and allow the virtual plant life to fade into black. The CSS repeating-linear-gradient function simplifies the effect’s usage.

See the Pen CSS Blossoming Flowers at Magical Night by Md Usman Ansari

Complex Gradient Examples by Drew McConville

Combining multiple gradients into a CSS background can produce compelling results. Scroll through this snippet to see four such examples. You’ll find a mix of colors and gradient types. It may even convince you to do some experimentation.

See the Pen Complex Gradient Examples by Drew McConville

A Fresh Look at a Design Staple

There was a time when designers shied away from gradients. The era of flat design encouraged the use of solid colors. But we rightfully came back to them.

The examples above show that gradients are still a valuable tool. They add flavor to all sorts of design elements. And it seems like designers are constantly finding creative uses.

That speaks to their flexibility. You can tweak gradients in endless ways. Make them as simple or complex as you like.

Want to see even more CSS and JavaScript gradient ideas? Be sure to check out our CodePen collection!

The post 8 CSS & JavaScript Snippets for Creating Complex Gradients appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/snippets-gradients/feed/ 0
8 CSS & JavaScript Snippets for Creating Notification UIs https://speckyboy.com/notification-css-javascript/ https://speckyboy.com/notification-css-javascript/#respond Tue, 24 Oct 2023 00:36:27 +0000 https://speckyboy.com/?p=154928 A collection of CSS and JavaScript code snippets for creating unique notification and alert systems and UIs.

The post 8 CSS & JavaScript Snippets for Creating Notification UIs appeared first on Speckyboy Design Magazine.

]]>
Website notifications have become commonplace. We see them in eCommerce, membership communities, and social media. They’re hard to escape.

And they’re also important for users. Notifications provide details regarding orders, messages, and other account information.

Thus, it’s interesting to see how notification UIs are evolving. Designers are using their creativity and adding personality. They’re proving that notifications can have both form and function.

With that, let’s take a look at eight unique notification UIs. They use CSS and (in some cases) JavaScript to go beyond the basics.



Neon Notification System with hover Effects by CleverYeti

This notification UI is perfect for websites using dark mode. The look is elegant while also being easy to digest. We’ll give bonus points for including some smooth CSS animation effects.

See the Pen Neon notification system by CleverYeti

Vertical Timeline Notifications by Alina N.

Here’s a neat way to organize multiple notifications. This timeline layout makes each item stand out. The spacing between entries keeps things easy to follow. The search field is also a welcome addition.

See the Pen Vertical Timeline – Notifications by Alina N.

Notification Badge Animation by Valery Alikin

Want to add an element of fun? This bright little UI resembles a “Minions” character. And if the colors don’t get your attention, the splatter animation will do the job.

See the Pen Notification Badge Animation by Valery Alikin

Project Notifications by Landon Messmer

Perhaps the “bell” icon is a bit overused. But in this case, it’s more about what’s inside. This notifications panel is beautiful and functional. It features a clean look and some handy features.

See the Pen Project Notifications by Landon Messmer

Error, Success, Warning, and Alert Notifications by Swarup Kumar Kuila

This notification UI brings a simple yet high-tech aesthetic. With bright colors and simple animation, it’s sure to draw attention. It’s powered by CSS, with an assist from the popular Font Awesome icon library.

See the Pen error, success, warning and alert Messages by Swarup Kumar Kuila

Info, Warning, and Alert Site Components by Dom Jay

These notification components are a fit for long-form content. Use them to display important details in an online course. Or as a call-out box within a blog post. Alerts aren’t just for user-specific info, after all.

See the Pen Site Component – Info/Warning/Alert by Dom Jay

Success, Error, Alert Flat Notifications by AbrarK

Click a button and watch as a colorful notification appears. This presentation uses a flat style reminiscent of Facebook and other popular services. It also features some slick animation.

See the Pen Flat Notify by AbrarK

Pop-Up Social Media Notification by Nooray Yemon

Here’s a highly stylized take on a notification UI. It shows that notifications can go beyond utility. They can also be a branding opportunity.

See the Pen Pop up social feed notification by Nooray Yemon

Serve Notice with These Awesome UI Examples

Notification UIs are now a staple of web design. They’re impacting all types of websites. Odds are that you’ll need to consider them in an upcoming project.

We can certainly stick with a generic look. But there’s an opportunity to do much more. CSS and JavaScript enable us to create a unique user experience. The examples above are just the tip of the iceberg.

The post 8 CSS & JavaScript Snippets for Creating Notification UIs appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/notification-css-javascript/feed/ 0
Get into the Halloween Spirit with These Spooky Snippets https://speckyboy.com/halloween-spooky-snippets/ https://speckyboy.com/halloween-spooky-snippets/#respond Wed, 20 Sep 2023 09:42:05 +0000 https://speckyboy.com/?p=103661 Creative examples of how you can turn CSS, HTML & JS into something spooky. Turn the lights down and prepare yourself for some Halloween fun!

The post Get into the Halloween Spirit with These Spooky Snippets appeared first on Speckyboy Design Magazine.

]]>
In recent years, Halloween has changed. What used to be an occasion for kids to score some sweet treats has become a big playground for adults, too. It’s not hard to spot those who feel the spirits – they’re usually the ones who have turned their home into a haunted house.

And web designers aren’t immune from Halloween fever. Indeed, some are decorating the web much like they do their front yards.

That presents us with the perfect opportunity to review some creative examples of how you can turn the latest web technologies into something scary. So, turn the lights down and prepare yourself for some Halloween fun – web designer style!



Beware of The Hockey Mask by Kevin Lehtla

Nothing quite says Halloween like a tribute to a scary movie. This hockey mask is an instantly-recognizable symbol of the Friday the 13th franchise. Notice the subtle red fill animation underneath the mask. That’s no Kool-Aid, kid.

A Friendly Ghost by Anthony Simone

Did you know that some ghosts are more afraid of you than you are of them? Seriously. Check out this shy-yet-smiling ghost, who disappears into a black hole when you hover over him. Thankfully, he reappears elsewhere on the screen just a few seconds later. After all, we mean no harm.

Select a Spooky Sidekick by Diogo Gomes

We’ve seen a lot of cool toggle switches. But we’ve not seen one that toggles from a Jack-O-Lantern to a vampire (most likely because we don’t need one). But here, the theme fits.

Ghost Hunting by Liam Egan

This snippet is not “officially” Halloween-themed, but it sure looks scary. It sports an x-ray style moving background that utilizes Three.js. Move your mouse over an area and it lights up, much like a flashlight beam in the dark. Even more creepy is that everything reacts to your clicks. No, we’re not scared – you are!

Where’d I Put My Head? by Sarah Drasner

There’s nothing quite like a Headless Horseman to get you thinking about Halloween. This gorgeous rendition features the famous “The Legend of Sleepy Hollow” character riding about in a darkened forest. The level of detail here is just stunning.

Better Than the Neighbor’s Yard by Amanda Ashley

As we mentioned earlier, some people really go all-out on the decorations this time of year. This animated example, which uses GSAP, puts them all to shame. A house just doesn’t get more haunted than this.

Make it Your Own by Mike White

One of the true joys of childhood is carving your very own pumpkin. It’s one of the few times you get to make a mess without consequences. But we’re older now, so no more messes. Instead, we can enjoy creating something scary with this drag-and-drop pumpkin. Much cleaner!

Nightmare on My Street by kittons

You want something really scary? Then feast your eyes on every developer’s worst nightmare. The sad thing is that this can happen all year round – not just Halloween.

All Hallows’ Eve on the Web

Halloween has indeed invaded the web. In fact, it was difficult to narrow down the snippets above to just a chosen few. Designers, like seemingly everyone else, can’t get enough of the scary stuff.

May these creepy-crawly examples inspire you to turn your own website into the devil’s playground. At least, for one night.

The post Get into the Halloween Spirit with These Spooky Snippets appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/halloween-spooky-snippets/feed/ 0
8 CSS & JavaScript Snippets for Creating Blur Effects https://speckyboy.com/css-javascript-blur-effects/ https://speckyboy.com/css-javascript-blur-effects/#respond Mon, 18 Sep 2023 06:04:47 +0000 https://speckyboy.com/?p=154155 We share some excellent examples of CSS & JavaScript blur effects. They are a surefire way of making a design element stand out.

The post 8 CSS & JavaScript Snippets for Creating Blur Effects appeared first on Speckyboy Design Magazine.

]]>
Adding blur effects is a surefire way to make a surrounding design element stand out. For example, adding a bit of haziness to a background photo will draw attention to the layered text on top.

Crafting this look used to require photo editing software. But that’s no longer the case. You can add stunning blur effects using CSS and JavaScript. And it’s easier than you may think.

There is also a wide array of possibilities. You could opt for that simple blur on a photo. But you can also combine the effect with animation and user actions. This allows you to add some creativity to the mix.

With that in mind, let’s explore eight excellent examples of CSS and JavaScript blur effects in action.


The post 8 CSS & JavaScript Snippets for Creating Blur Effects appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/css-javascript-blur-effects/feed/ 0
8 CSS Snippets for Creating Stylish Drop Caps https://speckyboy.com/css-snippets-drop-caps/ https://speckyboy.com/css-snippets-drop-caps/#respond Mon, 11 Sep 2023 12:18:36 +0000 https://speckyboy.com/?p=153740 A collection of eight CSS code snippets for creating elegant, professional and accessible drop caps. Add creative flair to your plain text!

The post 8 CSS Snippets for Creating Stylish Drop Caps appeared first on Speckyboy Design Magazine.

]]>
Recreating drop caps in web design hasn’t always been simple. Early implementations were often clunky. They required various hacks. Yet their look could vary from browser to browser. The text surrounding this decorative character also played a role.

Modern CSS has a way of making things easier. And the drop cap is no exception. It’s now possible to create an attractive and functional element.

No wonder web designers are flocking to them. They add a professional and elegant touch to blog posts and long-form content. Drop caps are capable of more than you might think. Here are eight unique implementations that show what’s possible.



Beautiful Book Layout with Drop Cap by Erin E. Sullivan

Let’s start with a nod to the drop cap’s lineage. This snippet recreates a book layout – complete with beautiful typography. The drop cap uses a CSS float, along with the :first-letter pseudo-element, to position the letter.

See the Pen Book Layout by Erin E. Sullivan

CSS Houdini – Simple Generative Drop Caps by George Francis

Here’s a fun example of web technologies dressing up a single character. Each time you refresh the page, the background of this drop cap changes. This generative effect is powered by CSS Houdini. Let’s see a printed page beat this one.

See the Pen CSS Houdini – Simple Generative Drop Caps! ✨ by George Francis

CSS Drop Cap Numbers by Thom Epps

Drop caps aren’t only for paragraph text. They can also add a dimension to other HTML content. Here, a colorful character dresses up an ordered list element. You might use a similar effect to make multi-step instructions easier to follow.

See the Pen DropCap Nubers by Thom Epps

Huge Drop Cap CSS by Noah Blon

Drop caps often fit within the first few lines of a paragraph. But this snippet aims to go bigger. A giant red character towers above the rest of the text. And it also serves as a background. It’s an attention-getting look. But some accessibility tweaks would help with legibility.

See the Pen Big Drop Cap by Noah Blon

Beautiful & Accessible CSS Drop Caps by Aquent Gymnasium

How do drop caps impact accessibility? A poor implementation could make it harder for users of screen readers. These examples demonstrate a couple of ways to keep the characters accessible. One uses a pseudo-element, while the other hides a copy of the decorative element.

See the Pen Creating Beautiful and Accessible Drop Caps (Completed) by Aquent Gymnasium

Accessible Drop Cap Examples by Adrian Roselli

Keeping with the theme of accessibility, here are three drop-cap examples. In this case, author Adrian Roselli recommends the third implementation. It’s the only one that is CSS-only. There’s also a companion article that digs into the options.

See the Pen Accessible Drop Caps by Adrian Roselli

Styling an Ornate Letter Drop Cap by Andy Hullinger

Positioning a drop cap can be a challenge. For example, getting the character to look good with paragraphs of various lengths is tedious. This example uses CSS transforms to account for the paragraph’s line height. The idea here is to create more predictable results.

See the Pen Styling an Initial Letter “Drop Cap” by Andy Hullinger

Drop Cap Ordered List Grid by Stephen Lindberg

Here’s a simple CSS snippet that makes ordered list items stand out. First, it uses the CSS counter() function to enumerate each item. Then, it uses CSS pseudo-elements to add bold styling to the digit. The use of CSS Grid ensures that the presentation is responsive.

See the Pen dropcap-grid ol by Stephen Lindberg

Dropping Some CSS Style Into Your Text

It’s easy to see why drop caps have become commonplace. First, they add creative flair to plain text. Plus, they can help make long passages of text more intuitive. They can also serve as an extension of your brand.

And CSS offers multiple options for adding drop caps to your layout. The examples above demonstrate what’s possible. You can create beautiful characters that maintain accessibility. What’s not to love?

The post 8 CSS Snippets for Creating Stylish Drop Caps appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/css-snippets-drop-caps/feed/ 0
8 CSS Snippets for Creating Horizontal Rules & Dividers https://speckyboy.com/horizontal-rules-dividers-css/ https://speckyboy.com/horizontal-rules-dividers-css/#respond Thu, 10 Aug 2023 07:54:37 +0000 https://speckyboy.com/?p=124495 If you're looking to take your HR’s up to the next level, this stunning collection of free CSS divider code snippets goes beyond the default.

The post 8 CSS Snippets for Creating Horizontal Rules & Dividers appeared first on Speckyboy Design Magazine.

]]>
Some design elements are so common that they almost become afterthoughts. The horizontal rule (hr) is one of them. It’s easy to simply place them within our content without any attention to detail.

But this venerable HTML tag is capable of doing so much more – thanks to some clever CSS. Horizontal rules can be quite decorative, whether you prefer a bold or subtle design. They can also be used as an enhanced branding mechanism, complete with color and logo elements in tow.

If you’re looking to take your HR up to the next level, you’ll want to check out this collection of fanciful dividers that go beyond the default. Let’s dig in!



The Measure of an HR by John W

This example is incredibly clever, if a bit on the extreme side. It features a large conglomerate of <hr> tags (100 in all) that are styled to simulate the look of a ruler. Practical? Maybe not. But it’s certainly creative.

See the Pen A Horizontal rule-er by John W

Inline Lines by Ohad

While this snippet doesn’t use an actual horizontal rule, it simulates the effect with CSS. Text or other design elements can be placed inline with the divider, making for an attention-grabbing effect. It’s also delightfully simple in terms of code.

See the Pen Inline horizontal rule by Ohad

Iconic HR Shapes by szpakoli

Here’s proof that subtlety can still stand out. A standard horizontal rule is enhanced with shapes (circle, diamond, star, etc.) and provides for an attractive visual. Combined with the rule’s short width and bright color, it helps readers delineate one section of content from another.

See the Pen Fancy Horizontal Rules by szpakoli

Accordion Rules by Will Boyd

Accordions have become one of the more popular UI elements due to their penchant for being space savers. This pure CSS take on the feature includes horizontal rules as part of the user interface. A rare instance of the good old <hr> being used for functional purposes.

See the Pen Accordion Effect with Horizontal Rules by Will Boyd

Simple HR Style Variations by Mark Murray

This snippet offers nine interesting horizontal rules that can fit a variety of styles and use cases. Examples include the usage of symbols, centered text, colors and border patterns. There’s something here for everyone.

See the Pen Some HR Styles by Mark Murray

Medium Style with Accessibility by Zoë Bijl

Placing text inside a horizontal rule can be tricky. It often involves techniques that aren’t very accessible. This snippet is different, as it utilizes content from <h2> tags. It not only offers a cool Medium-style aesthetic, but it’s friendly to screen readers as well.

See the Pen Accessible Medium Style Dividers by Zoë Bijl

Decorative & Minimal HR Designs by Ibrahim Jabbari

Perhaps you’d like your dividers to look nice without distracting from the rest of your content. This collection of 18 simple styles is for you. The effects are well-executed without going over the top with flashy features.

See the Pen 18 Simple Styles for Horizontal Rules (hr CSS Design) by Ibrahim Jabbari

Charlie Brown’s Shirt or Bart Simpson’s Hair? by m0cha

When viewing this zig-zag pattern, one conjures up images of cartoon characters. But its also a clever bit of code. It’s a combination of two <hr> tags with angled CSS gradients. Now, which character does it best represent? Let’s go with Bart’s hair.

See the Pen Zigzag Horizontal Rule by m0cha

(Horizontally) Divide and Conquer

Sure, the default styling of a horizontal rule gets the job done – but where’s the fun in that? Take a cue from the examples above and create something that compliments all of your great design work.

The post 8 CSS Snippets for Creating Horizontal Rules & Dividers appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/horizontal-rules-dividers-css/feed/ 0
8 CSS & JavaScript Snippets for Creating Chat UIs https://speckyboy.com/chat-ui-css-javascript-code-snippets/ https://speckyboy.com/chat-ui-css-javascript-code-snippets/#respond Thu, 10 Aug 2023 07:03:24 +0000 https://speckyboy.com/?p=133825 A collection of CSS and JavaScript code snippets for creating modern messaging and chat UIs that your users will love.

The post 8 CSS & JavaScript Snippets for Creating Chat UIs appeared first on Speckyboy Design Magazine.

]]>
Long before social media took over our screens, internet chat was the original online time-waster. One could spend hours on IRC and other assorted live messaging apps. For those who took part in the obsession, late nights often turned into early mornings. Sleep was lost, wrists were sore. What a time to be alive!

While chat has changed quite a bit since those early days, it’s still every bit as relevant. Only now it has become a staple of customer service and team Slack channels.

And communication has been further improved by the latest CSS and JavaScript techniques. They allow for creating amazingly interactive UIs, while providing more advanced functionality as well.

Today, we’ll show you eight interesting and unique chat UIs. They’re so great, you might even LOL.



Messaging App UI with Dark Mode by Aysenur Turk

Facebook Messenger is wildly popular and it’s no wonder developers are looking to imitate it. The look is simple, effective and instantly-recognizable. Here’s a remix that includes an ever-so-trendy dark mode option.

See the Pen Messaging App UI with Dark Mode by Aysenur Turk

Daily UI #013:Direct Messaging by Fabio Ottaviani

Glassmorphism is a popular look these days. Here, a touch of its style is used to liven up this private messaging UI. Thankfully, the result is miles away from the boring, plain-text chat apps of the past.

See the Pen Daily UI #013:Direct Messaging by Fabio Ottaviani

MSN Messenger 7.5 Visual Demo with WebComponents (HTML+CSS+Javascript) by Manz

Speaking of the past, this UI snippet recreates the look of MSN Messenger. It’s pretty authentic, right down to the chunky 3D icons. Not only does this show how far we’ve come, but it’s also a nice exercise in using modern styling to bring back an old favorite.

See the Pen MSN Messenger 7.5 Visual Demo with WebComponents (HTML+CSS+Javascript) by Manz

floating website chat button (intercom inspired) by neil kalman

Here’s a trend we’re seeing just about everywhere. The “floating” chat UI that’s uncomfortably stuck on the bottom right of the screen. Click the button and start typing away. It certainly is handy, especially for sales and support purposes. Just beware:you’re probably talking to a bot, rather than a real human.

See the Pen floating website chat button (intercom inspired) by neil kalman

Mock Chat Animation by Jacob Foster

Perhaps you’re in the beginning stages of a chat-based project and haven’t fully figured out the UI just yet. No worries, as this mock chat animation snippet can serve as a solid stand-in. The demo is clean, colorful and inspiring. That makes it perfect for wireframing.

See the Pen Mock Chat Animation by Jacob Foster

Stylish chat window design by Mamun Khandaker

For those who use chat to provide customer support, it’s likely that you’re dealing with multiple conversations. This UI snippet provides a solution in the form of neatly-arranged windows. Each one can be minimized and maximized. Notice the status indicator icons within the title – making it easier to see what’s going on.

See the Pen Stylish chat window design by Mamun Khandaker

Simple Chat UI by Sajad Hashemian

Like most design-related things, simple is often better. Chat UIs can become littered with goofy effects and unreadable fonts. But not here. Instead, this “Simple Chat” is intuitive. Best of all, you won’t need to zoom in to read it.

See the Pen Simple Chat UI by Sajad Hashemian

Club Command Line by Jon Kantner

There’s no rule that says chat has to be a text-only experience. Certain instances may call for something a bit more fun. And that’s exactly what this video game-like chat UI does. Use your arrow keys to move your character around and chat up a storm. If you want to keep better track of the conversation, the “View Chat” button pulls up a text archive.

See the Pen Club Command Line by Jon Kantner

BRB, Building a Better Chat UI

With so many cutting-edge technologies available, there are a world of possibilities for chat UIs. Yet, the overall goal should be the same. No matter what bells and whistles we add to the mix, the idea is to create something that’s easy to use and understand.

The other lesson here is that the design choices we make should be based on need. For example, some of the snippets above would be great for an online gaming community – but not so much for a corporate sales channel. A user interface works best when it reflects the people it will serve.

The post 8 CSS & JavaScript Snippets for Creating Chat UIs appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/chat-ui-css-javascript-code-snippets/feed/ 0
8 CSS & JavaScript Snippets for Creating Accordion UIs https://speckyboy.com/accordion-css-javascript-snippets/ https://speckyboy.com/accordion-css-javascript-snippets/#respond Thu, 10 Aug 2023 06:50:45 +0000 https://speckyboy.com/?p=142722 A collection of accordion UIs, built with CSS & JavaScript, that showcase what can be achieved with modern coding techniques.

The post 8 CSS & JavaScript Snippets for Creating Accordion UIs appeared first on Speckyboy Design Magazine.

]]>
The accordion UI has long been a favorite of web designers. It’s handy for storing a significant amount of content in a limited space. Plus, it adds the kind of interactivity clients love on mobile and desktop devices.

Accordions are also evolving quite a bit. Thanks to advancements in CSS and JavaScript, it’s now possible to go well beyond the standard UIs we’re used to seeing. Everything from animation to alignment can be tweaked to create something unique.

Today, we’ll introduce you to eight accordion UIs that showcase what can be achieved with modern coding techniques. Let’s get started!



Pure CSS Horizontal Accordion by Aysha Anggraini

Accordion UIs have traditionally been vertical – but no rule says things have to stay that way. This horizontally-oriented snippet reveals content on hover. Even better is that there’s no JavaScript required.

See the Pen Pure CSS Horizontal Accordion by Aysha Anggraini

Funky Pure CSS Accordion by Jamie Coulter

CSS both powers and styles this accordion, turning it into an interactive event list. Animation is used to aid in tab transitions and introduce decorative icons. Overall, it’s a slick UI and demonstrates that accordions can be both useful and beautiful.

See the Pen Funky Pure CSS Accordion by Jamie Coulter

Minimal Accordion in React by Matthew Vincent

JavaScript libraries such as React are also fertile ground for building accordion components. This attractive snippet features smooth animation and a minimal design. It’s a perfect fit for modern web applications.

See the Pen Accordion – React by Matthew Vincent

Native Accordion with <details>by Giana

With the details HTML element, you no longer need other languages to create an accordion UI. As in this example, CSS is merely used as a way to enhance the styling. This native feature means great performance and more accessibility. Oh, and it’s also supported by all modern browsers!

See the Pen Native accordion with <details> by Giana

ARIA Accessible Accordion by Kiri Egington

Accessibility is a prime concern for all UI elements. For accordions, the focus is on more than just having readable fonts and acceptable color contrast ratios. The ability to navigate each section via keyboard is also important – which is where this snippet comes in. By using the TAB and ENTER keys, it’s possible to go through each section and consume its content.

See the Pen ARIA Accessible Accordion by Kiri Egington

Gracefully-Degrading <details>Accordion (Vanilla JS) by Keith Pickering

As we previously mentioned, an HTML-powered accordion is possible via the details element. However, the user experience can still be enhanced. Here, CSS and vanilla JavaScript has been used to add animation and calculate each section’s height. If a user doesn’t have JavaScript enabled, the UI will gracefully degrade.

See the Pen Gracefully-degrading <details>accordion (Vanilla JS) by Keith Pickering

Pure Accordion CSS by Tuna

This pure CSS accordion demonstrates what a few clever design features can add to the mix. The author makes great use of typography to ensure that each section’s title stands out. In addition, hashtag links are used to theoretically take users to related subjects. There are a lot of possibilities to fit into a relatively tiny space.

See the Pen Accordion by Tuna

Responsive CSS Accordion Gallery with Zoom Animation by Daniel Subat

An accordion-based photo gallery? Not only is it possible, but also very nicely implemented in this snippet. There’s a lot to explore:CSS image filters, hover effects and transforms make for a compelling UX. Despite all of that goodness, the amount of code behind the scenes is minimal.

See the Pen accordion gallery zoom animation (css, responsive) by Daniel Subat

Bring Out the Accordions

Accordion UIs have withstood the test of time. Thankfully their looks have finally caught up to their utility. Designers can take advantage of the latest CSS to achieve virtually any style, while JavaScript can add advanced functionality.

Perhaps the biggest revelation is the ability to create these interfaces using native HTML. This puts compatibility and accessibility at the forefront. It also ensures that we’ll be adding accordions to our projects for years to come.

The post 8 CSS & JavaScript Snippets for Creating Accordion UIs appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/accordion-css-javascript-snippets/feed/ 0
8 Ways To Dress up Quotes With CSS & JavaScript https://speckyboy.com/css-javascript-snippets-quotes/ https://speckyboy.com/css-javascript-snippets-quotes/#respond Thu, 10 Aug 2023 06:49:24 +0000 https://speckyboy.com/?p=151475 Eight compelling CSS & JavaScript snippets to present quotes on your website. There is a style here to fit just about every need.

The post 8 Ways To Dress up Quotes With CSS & JavaScript appeared first on Speckyboy Design Magazine.

]]>
Quotes are among the most versatile web design elements. They can practically leap off the page. And you can also use them to create separation within long text passages.

As for styling, there’s a whole world of possibilities. We can use the power of CSS and JavaScript to build quote UIs to fit our desired aesthetic. Everything from subtle typographic layouts to interactive presentations is possible.

With that in mind, here are eight compelling ways to present quotes on your website. There is a style here to fit just about every need.



Quote Particle Animation by isladjan

If you want quotes to take center stage, this snippet is a prime example of how to do it. The slick particle animation background looks stunning. But it doesn’t distract from the text overlay. It’s also a slideshow, as clicking on the presentation loads a new quote.

See the Pen Quotes animation made by particles by isladjan

Water Effect Quote Animation by Shane Burns

You might say that the water effects in this quote are pretty immersive. Bad puns aside, the animation does a great job of adding context. Readability may be a concern, however. That could be cleared up with a few code tweaks.

See the Pen Become the Cup by Shane Burns

Quote Sliding Cards by Sabine Robart

Here’s a stylish way to fit multiple quotes into a small area. This quote card allows you to click through entries one at a time. It’s perfect for those who want a compact and understated look.

See the Pen Quote cards by Sabine Robart

Variable Font Quote by Cassie Evans

This snippet uses a variable font to create a smooth transition between character styles. The GSAP-powered animation targets each word, encouraging users to read along. It’s a simple formula that creates a bold look.

See the Pen Bricks by Cassie Evans

Flexible, Full-Width, and “Justified” Text Blocks by Reuben L. Lillie

The use of justified text brings a clean, blocky aesthetic to quotes. Here, the effect is combined with varying text sizes to make for a more interesting presentation. It also scales beautifully to fit smaller screens.

See the Pen Flexible, Full-Width, Justified Text Blocks by Reuben L. Lillie

Scrolling Quote UI by Andrew Sims

This scrolling quote UI is the total package. The typography is attractive and easy to read. Its use of color creates noticeable contrast. And the blurred scroll effects add dramatic flair. What else could you want?

See the Pen Design brings challenges into focus #Codevember by Andrew Sims

Simple & Pretty Blockquotes by Mark Sottek

It’s hard to go wrong with simplicity. This snippet happens to lack fancy effects. But it more than makes up for it with detail-oriented spacing and typography. The result is a timeless look that could fit with any design.

See the Pen Simple, Pretty Blockquote by Mark Sottek

Random Quote Machine by Skybird Trill

Within this snippet’s well-worn cover are pages of quotes. The book-inspired design allows you to elegantly navigate between pages. The included social sharing buttons are a nice touch that can be changed to suit.

See the Pen Random Quote Machine by Skybird Trill

Ways To Make Your Website Quotable

Web designers no longer have to settle for boring quote presentations. The examples above demonstrate a wide range of use cases. And experimentation with layouts and special effects only adds to the possibilities.

No matter the look and functionality, you can use CSS and JavaScript to make it happen. What’s more, quotes can also be the star of the show. Advanced techniques turn them into a centerpiece, rather than a bit player.

The post 8 Ways To Dress up Quotes With CSS & JavaScript appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/css-javascript-snippets-quotes/feed/ 0
8 CSS & JavaScript Snippets for Recreating Iconic Titles https://speckyboy.com/css-javascript-snippets-iconic-titles/ https://speckyboy.com/css-javascript-snippets-iconic-titles/#respond Thu, 10 Aug 2023 06:21:54 +0000 https://speckyboy.com/?p=148865 A collection of CSS & JavaScript code snippets that will allow you to recreate popular titles, like Avengers, Frozen, Netflix, and more.

The post 8 CSS & JavaScript Snippets for Recreating Iconic Titles appeared first on Speckyboy Design Magazine.

]]>
Title sequences can become iconic. These familiar scenes from movies, television, and video games often become etched in our memories.

They also serve as a cultural marker of sorts, helping us define an era. For example, Star Wars has come to define the late 1970s and early 1980s. These days, the title of Stranger Things has forged its own signature.

Thus, it’s no wonder that web designers use title sequences as a proving ground. By recreating their favorites in CSS and JavaScript, they’re sharpening their skills and paying tribute.

Let’s have a look at eight famous titles that designers felt worthy of imitation. Some are spot-on facsimiles, while others use a bit more artistic license. But they’re all worth celebrating in our book.


The post 8 CSS & JavaScript Snippets for Recreating Iconic Titles appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/css-javascript-snippets-iconic-titles/feed/ 0