Jump to content

Welcome to CodeNameJessica

Welcome to CodeNameJessica!

💻 Where tech meets community.

Hello, Guest! 👋
You're just a few clicks away from joining an exclusive space for tech enthusiasts, problem-solvers, and lifelong learners like you.

🔐 Why Join?
By becoming a member of CodeNameJessica, you’ll get access to:
In-depth discussions on Linux, Security, Server Administration, Programming, and more
Exclusive resources, tools, and scripts for IT professionals
A supportive community of like-minded individuals to share ideas, solve problems, and learn together
Project showcases, guides, and tutorials from our members
Personalized profiles and direct messaging to collaborate with other techies

🌐 Sign Up Now and Unlock Full Access!
As a guest, you're seeing just a glimpse of what we offer. Don't miss out on the complete experience! Create a free account today and start exploring everything CodeNameJessica has to offer.

  • Entries

    144
  • Comments

    0
  • Views

    1255

Entries in this blog

by: Chris Coyier
Mon, 21 Apr 2025 17:10:35 +0000


I enjoyed Trys Mudford’s explanation of making rounded triangular boxes. It was a very real-world client need, and I do tend to prefer reading about technical solutions to real problems over theoretical ones. This one was tricky because this particular shape doesn’t have a terribly obvious way to draw it on the web.

CSS’ clip-path is useful, but the final rounding was done with an unintuitive feGaussianBlur SVG filter. You could draw it all in SVG, but I think the % values you get to use with clip-path are a more natural fit to web content than pure SVG is. SVG just wasn’t born in a responsive web design world.

The thing is: SVG has a viewBox which is a fixed coordinate system on which you draw things. The final SVG can be scaled and squished and stuff, but it’s all happening on this fixed grid.

I remember when trying to learn the <path d=""> syntax in SVG how it’s almost an entire language unto itself, with lots of different letters issues commands to a virtual pen. For example:

  • M 100,100 means “Pick up the pen and move it to the exact coordinates 100,100”
  • m 100,100 means “Move the Pen 100 down and 100 right from wherever you currently are.”

That syntax for the d attribute (also expressed with the path() function) can be applied in CSS, but I always thought that was very weird. The numbers are “unitless” in SVG, and that makes sense because the numbers apply to that invisible fixed grid put in place by the viewBox. But there is no viewBox in regular web layout., so those unitless numbers are translated to px, and px also isn’t particularly responsive web design friendly.

This was my mind’s context when I saw the Safari 18.4 new features. One of them being a new shape() function:

For complex graphical effects like clipping an image or video to a shape, authors often fall back on CSS masking so that they can ensure that the mask adapts to the size and aspect ratio of the content being masked. Using the clip-path property was problematic, because the only way to specify a complex shape was with the path() function, which takes an SVG-style path, and the values in these paths don’t have units; they are just treated as CSS pixels. It was impossible to specify a path that was responsive to the element being clipped.

Yes! I’m glad they get it. I felt like I was going crazy when I would talk about this issue and get met with blank stares.

Tyrs got so close with clip-path: polygon() alone on those rounded arrow shapes. The % values work nicely for random amounts of content inside (e.g. the “nose” should be at 50% of the height) and if the shape of the arrow needed to be maintained px values could be mix-and-matched in there.

But the rounding was missing. There is no rounding with polygon().

Or so I thought? I was on the draft spec anyway looking at shape(), which we’ll circle back to, but it does define the same round keyword and provide geometric diagrams with expectations on how it’s implemented.

An optional <length> after a round keyword defines rounding for each vertex of the polygon. 

There are no code examples, but I think it would look something like this:

/* might work one day? */
clip-path: polygon(0% 0% round 0%, 75% 0% round 10px, 100% 50% round 10px, 75% 100% round 10px, 0% 100% round 0%);

I’d say “draft specs are just… draft specs”, but stable Safari is shipping with stuff in this draft spec so I don’t know how all that works. I did test this syntax across the browsers and nothing supports it. If it did, Trys’ work would have been quite a bit easier. Although the examples in that post where a border follows the curved paths… that’s still hard. Maybe we need clip-path-border?

There is precedent for rounding in “basic shape” functions already. The inset() function has a round keyword which produces a rounded rectangle (think a simple border-radius). See this example, which actually does work.

But anyway: that new shape() function. It looks like it is trying to replicate (the entire?) power of <path d=""> but do it with a more CSS friendly/native syntax. I’ll post the current syntax from the spec to help paint the picture it’s a whole new language (🫥):

<shape-command> = <move-command> | <line-command> | close |
                  <horizontal-line-command> | <vertical-line-command> | 
                  <curve-command> | <smooth-command> | <arc-command>

<move-command> = move <command-end-point>
<line-command> = line <command-end-point>
<horizontal-line-command> = hline
        [ to [ <length-percentage> | left | center | right | x-start | x-end ]
        | by <length-percentage> ]
<vertical-line-command> = vline
        [ to [ <length-percentage> | top | center | bottom | y-start | y-end ]
        | by <length-percentage> ]
<curve-command> = curve
        [ [ to <position> with <control-point> [ / <control-point> ]? ]
        | [ by <coordinate-pair> with <relative-control-point> [ / <relative-control-point> ]? ] ]
<smooth-command> = smooth
        [ [ to <position> [ with <control-point> ]? ]
        | [ by <coordinate-pair> [ with <relative-control-point> ]? ] ]
<arc-command> = arc <command-end-point>
            [ [ of <length-percentage>{1,2} ]
              && <arc-sweep>? && <arc-size>? && [rotate <angle>]? ]

<command-end-point> = [ to <position> | by <coordinate-pair> ]
<control-point> = [ <position> | <relative-control-point> ]
<relative-control-point> = <coordinate-pair> [ from [ start | end | origin ] ]?
<coordinate-pair> = <length-percentage>{2}
<arc-sweep> = cw | ccw
<arc-size> = large | small

So instead of somewhat obtuse single-letter commands in the path syntax, these have more understandable names. Here’s an example again from the spec that draws a speech bubble shape:

.bubble { 
  clip-path: 
    shape(
      from 5px 0,
      hline to calc(100% - 5px),
      curve to right 5px with right top,
      vline to calc(100% - 8px),
      curve to calc(100% - 5px) calc(100% - 3px) with right calc(100% - 3px),
      hline to 70%,
      line by -2px 3px,
      line by -2px -3px,
      hline to 5px,
      curve to left calc(100% - 8px) with left calc(100% - 3px),
      vline to 5px,
      curve to 5px top with left top
     );
}

You can see the rounded corners being drawn there with literal curve commands. I think it’s neat. So again Trys’ shapes could be drawn with this once it has more proper browser support. I love how with this syntax we can mix and match units, we could abstract them out with custom properties, we could animate them, they accept readable position keywords like “right”, we can use calc(), and all this really nice native CSS stuff that path() wasn’t able to give us. This is born in a responsive web design world.

Very nice win, web platform.

by: Ojekudo Oghenemaro Emmanuel
Sun, 20 Apr 2025 08:04:07 GMT


Introduction

In today’s digital world, security is paramount, especially when dealing with sensitive data like user authentication and financial transactions. One of the most effective ways to enhance security is by implementing One-Time Password (OTP) authentication. This article explores how to implement OTP authentication in a Laravel backend with a Vue.js frontend, ensuring secure transactions.

Why Use OTP Authentication?

OTP authentication provides an extra layer of security beyond traditional username and password authentication. Some key benefits include:

  • Prevention of Unauthorized Access: Even if login credentials are compromised, an attacker cannot log in without the OTP.
  • Enhanced Security for Transactions: OTPs can be used to confirm high-value transactions, preventing fraud.
  • Temporary Validity: Since OTPs expire after a short period, they reduce the risk of reuse by attackers.

Prerequisites

Before getting started, ensure you have the following:

  • Laravel 8 or later installed
  • Vue.js configured in your project
  • A mail or SMS service provider for sending OTPs (e.g., Twilio, Mailtrap)
  • Basic understanding of Laravel and Vue.js

In this guide, we’ll implement OTP authentication in a Laravel (backend) and Vue.js (frontend) application. We’ll cover:

  • Setting up Laravel and Vue (frontend) from scratch
  • Setting up OTP generation and validation in Laravel
  • Creating a Vue.js component for OTP input
  • Integrating OTP authentication into login workflows
  • Enhancing security with best practices

By the end, you’ll have a fully functional OTP authentication system ready to enhance the security of your fintech or web application.

Setting Up Laravel for OTP Authentication

Step 1: Install Laravel and Required Packages

If you haven't already set up a Laravel project, create a new one:

composer create-project "laravel/laravel:^10.0" example-app

Next, install the Laravel Breeze package for frontend scaffolding:

composer require laravel/breeze --dev

After composer has finished installing, run the following command to select the framework you want to use—the Vue configuration:

php artisan breeze:install

You’ll see a prompt with the available stacks:

Which Breeze stack would you like to install?
- Vue with Inertia   
Would you like any optional features?
- None   
Which testing framework do you prefer? 
- PHPUnit

Breeze will automatically install the necessary packages for your Laravel Vue project. You should see:

INFO Breeze scaffolding installed successfully.

Now run the npm command to build your frontend assets:

npm run dev

Then, open another terminal and launch your Laravel app:

php artisan serve

Step 2: Setting up OTP generation and validation in Laravel

We'll use a mail testing platform called Mailtrap to send and receive mail locally. If you don’t have a mail testing service set up, sign up at Mailtrap to get your SMTP credentials and add them to your .env file:

MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=1780944422200a
MAIL_PASSWORD=a8250ee453323b
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME="${APP_NAME}"

To send OTPs to users, we’ll use Laravel’s built-in mail services. Create a mail class and controller:

php artisan make:mail OtpMail
php artisan make:controller OtpController

Then modify the OtpMail class:

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class OtpMail extends Mailable
{
    use Queueable, SerializesModels;

    public $otp;

    /**
     * Create a new message instance.
     */
    public function __construct($otp)
    {
        $this->otp = $otp;
    }

    /**
     * Build the email message.
     */
    public function build()
    {
        return $this->subject('Your OTP Code')
            ->view('emails.otp')
            ->with(['otp' => $this->otp]);
    }

    /**
     * Get the message envelope.
     */
    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'OTP Mail',
        );
    }
}

Create a Blade view in resources/views/emails/otp.blade.php:

<!DOCTYPE html>
<html>
    <head>
        <title>Your OTP Code</title>
    </head>
    <body>
        <p>Hello,</p>
        <p>Your One-Time Password (OTP) is: <strong>{{ $otp }}</strong></p>
        <p>This code is valid for 10 minutes. Do not share it with anyone.</p>
        <p>Thank you!</p>
    </body>
</html>

Step 3: Creating a Vue.js component for OTP input

Normally, after login or registration, users are redirected to the dashboard. In this tutorial, we add an extra security step that validates users with an OTP before granting dashboard access.

Create two Vue files:

  • Request.vue: requests the OTP
  • Verify.vue: inputs the OTP for verification

Now we create the routes for the purpose of return the View and the functionality of creating OTP codes, storing OTP codes, sending OTP codes through the mail class, we head to our web.php file:

Route::middleware('auth')->group(function () {
    Route::get('/request', [OtpController::class, 'create'])->name('request');
    Route::post('/store-request', [OtpController::class, 'store'])->name('send.otp.request');

    Route::get('/verify', [OtpController::class, 'verify'])->name('verify');
    Route::post('/verify-request', [OtpController::class, 'verify_request'])->name('verify.otp.request');
});

Putting all of this code in the OTP controller returns the View for our request.vue and verify.vue file and the functionality of creating OTP codes, storing OTP codes, sending OTP codes through the mail class and verifying OTP codes, we head to our web.php file to set up the routes.

public function create(Request $request)
{
    return Inertia::render('Request', [
        'email' => $request->query('email', ''),
    ]);
}

public function store(Request $request)
{
    $request->validate([
        'email' => 'required|email|exists:users,email',
    ]);

    $otp = rand(100000, 999999);

    Cache::put('otp_' . $request->email, $otp, now()->addMinutes(10));

    Log::info("OTP generated for " . $request->email . ": " . $otp);

    Mail::to($request->email)->send(new OtpMail($otp));

    return redirect()->route('verify', ['email' => $request->email]);
}

public function verify(Request $request)
{
    return Inertia::render('Verify', [
        'email' => $request->query('email'),
    ]);
}

public function verify_request(Request $request)
{
    $request->validate([
        'email' => 'required|email|exists:users,email',
        'otp' => 'required|digits:6',
    ]);

    $cachedOtp = Cache::get('otp_' . $request->email);

    Log::info("OTP entered: " . $request->otp);
    Log::info("OTP stored in cache: " . ($cachedOtp ?? 'No OTP found'));

    if (!$cachedOtp) {
        return back()->withErrors(['otp' => 'OTP has expired. Please request a new one.']);
    }

    if ((string) $cachedOtp !== (string) $request->otp) {
        return back()->withErrors(['otp' => 'Invalid OTP. Please try again.']);
    }

    Cache::forget('otp_' . $request->email);

    $user = User::where('email', $request->email)->first();
    if ($user) {
        $user->email_verified_at = now();
        $user->save();
    }

    return redirect()->route('dashboard')->with('success', 'OTP Verified Successfully!');
}

Having set all this code, we return to the request.vue file to set it up.

<script setup>
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
import InputError from '@/Components/InputError.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import { Head, useForm } from '@inertiajs/vue3';

const props = defineProps({
    email: {
        type: String,
        required: true,
    },
});

const form = useForm({
    email: props.email,
});

const submit = () => {
    form.post(route('send.otp.request'), {
        onSuccess: () => {
            alert("OTP has been sent to your email!");
            form.get(route('verify'), { email: form.email }); // Redirecting to OTP verification
        },
    });
};
</script>

<template>
    <Head title="Request OTP" />

    <AuthenticatedLayout>
        <form @submit.prevent="submit">
            <div>
                <InputLabel for="email" value="Email" />

                <TextInput
                    id="email"
                    type="email"
                    class="mt-1 block w-full"
                    v-model="form.email"
                    required
                    autofocus
                />

                <InputError class="mt-2" :message="form.errors.email" />
            </div>

            <div class="mt-4 flex items-center justify-end">
                <PrimaryButton :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
                    Request OTP
                </PrimaryButton>
            </div>
        </form>
    </AuthenticatedLayout>
</template>

Having set all this code, we return to the verify.vue to set it up:

<script setup>
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
import InputError from '@/Components/InputError.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import { Head, useForm, usePage } from '@inertiajs/vue3';

const page = usePage();
// Get the email from the URL query params
const email = page.props.email || '';

// Initialize form with email and OTP field
const form = useForm({
    email: email,
    otp: '',
});

// Submit function
const submit = () => {
    form.post(route('verify.otp.request'), {
        onSuccess: () => {
            alert("OTP verified successfully! Redirecting...");
            window.location.href = '/dashboard'; // Change to your desired redirect page
        },
        onError: () => {
            alert("Invalid OTP. Please try again.");
        },
    });
};
</script>

<template>
    <Head title="Verify OTP" />

    <AuthenticatedLayout>
        <form @submit.prevent="submit">
            <div>
                <InputLabel for="otp" value="Enter OTP" />

                <TextInput
                    id="otp"
                    type="text"
                    class="mt-1 block w-full"
                    v-model="form.otp"
                    required
                />

                <InputError class="mt-2" :message="form.errors.otp" />
            </div>

            <div class="mt-4 flex items-center justify-end">
                <PrimaryButton :disabled="form.processing">
                    Verify OTP
                </PrimaryButton>
            </div>
        </form>
    </AuthenticatedLayout>
</template>

Step 4: Integrating OTP authentication into login and register workflows

Update the login controller:

public function store(LoginRequest $request): RedirectResponse
{
    $request->authenticate();

    $request->session()->regenerate();

    return redirect()->intended(route('request', absolute: false));
}

Update the registration controller:

public function store(Request $request): RedirectResponse
{
    $request->validate([
        'name' => 'required|string|max:255',
        'email' => 'required|string|lowercase|email|max:255|unique:' . User::class,
        'password' => ['required', 'confirmed', Rules\Password::defaults()],
    ]);

    $user = User::create([
        'name' => $request->name,
        'email' => $request->email,
        'password' => Hash::make($request->password),
    ]);

    event(new Registered($user));

    Auth::login($user);

    return redirect(route('request', absolute: false));
}

Conclusion

Implementing OTP authentication in Laravel and Vue.js enhances security for user logins and transactions. By generating, sending, and verifying OTPs, we can add an extra layer of protection against unauthorized access. This method is particularly useful for financial applications and sensitive user data.

by: Geoff Graham
Fri, 18 Apr 2025 12:12:35 +0000


Hey, did you see the post Jen Simmons published about WebKit’s text-wrap: pretty implementation? It was added to Safari Technology Preview and can be tested now, as in, like, today. Slap this in a stylesheet and your paragraphs get a nice little makeover that improves the ragging, reduces hyphenation, eliminates typographic orphans at the end of the last line, and generally avoids large typographic rivers as a result. The first visual in the post tells the full story, showing how each of these is handled.

A screenshot of paragraph text that demonstrates a short last line, bad rag, bad hyphenation, and a typographic river.
Credit: WebKit Blog

That’s a lot of heavy lifting for a single value! And according to Jen, this is vastly different from Chromium’s implementation of the exact same feature.

According to an article by the Chrome team, Chromium only makes adjustments to the last four lines of a paragraph. It’s focused on preventing short last lines. It also adjusts hyphenation if consecutive hyphenated lines appear at the end of a paragraph.

Jen suggests that performance concerns are the reason for the difference. It does sound like the pretty value does a lot of work, and you might imagine that would have a cumulative effect when we’re talking about long-form content where we’re handling hundreds, if not thousands, of lines of text. If it sounds like Safari cares less about performance, that’s not the case, as their approach is capable of handling the load.

One thing to know as a developer, the performance of text-wrap is not affected by how many elements on the page it’s applied to. Perf concerns emerge as the pretty algorithm takes more and more lines into consideration as it calculates what to do. In WebKit-based browsers or apps, your text element would need to be many hundreds or thousands of lines long to see a performance hit — and that kind of content is unusual on the web. If your content is broken up into typical-length paragraphs, then you have no reason to worry. Use text-wrap: pretty as much as you want, and rely on our browser engineers to ensure your users will not experience any downsides.

Great, carry on! But now you know that two major browsers have competing implementations of the same feature. I’ve been unclear on the terminology of pretty since it was specced, and now it truly seems that what is considered “pretty” really is in the eye of the beholder. And if you’re hoping to choose a side, don’t, because the specification is intentionally unopinionated in this situation, as it says (emphasis added):

The user agent may among other things attempt to avoid excessively short last lines… but it should also improve the layout in additional ways. The precise set of improvements is user agent dependent, and may include things such as: reducing the variation in length between lines; avoiding typographic rivers; prioritizing different classes of soft wrap opportunities, hyphenation opportunities, or justification opportunities; avoiding hyphenation on too many consecutive lines.

So, there you have it. One new feature. Two different approaches. Enjoy your new typographic powers. 💪


“Pretty” is in the eye of the beholder originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Zell Liew
Thu, 17 Apr 2025 12:38:05 +0000


There was once upon a time when native CSS lacked many essential features, leaving developers to come up with all sorts of ways to make CSS easier to write over the years.

These ways can mostly be categorized into two groups:

  1. Pre-processors
  2. Post-processors

Pre-processors include tools like Sass, Less, and Stylus. Like what the category’s name suggests, these tools let you write CSS in their syntax before compiling your code into valid CSS.

Post-processors work the other way — you write non-valid CSS syntax into a CSS file, then post-processors will change those values into valid CSS.

There are two major post-processors today:

  • PostCSS
  • LightningCSS

PostCSS is the largest kid on the block while Lightning CSS is a new and noteworthy one. We’ll talk about them both in a bit.

I think post-processors have won the compiling game

Post-processors have always been on the verge of winning since PostCSS has always been a necessary tool in the toolchain.

The most obvious (and most useful) PostCSS plugin for a long time is Autoprefixer — it creates vendor prefixes for you so you don’t have to deal with them.

/* Input */
.selector {
  transform: /* ... */; 
}

.selector {
  -webkit-transform: /* ... */;
  transform: /* ... */;
}

Arguably, we don’t need Autoprefixer much today because browsers are more interopable, but nobody wants to go without Autoprefixer because it eliminates our worries about vendor prefixing.

What has really tilted the balance towards post-processors includes:

  1. Native CSS gaining essential features
  2. Tailwind removing support for pre-processors
  3. Lightning CSS

Let me expand on each of these.

Native CSS gaining essential features

CSS pre-processors existed in the first place because native CSS lacked features that were critical for most developers, including:

  • CSS variables
  • Nesting capabilities
  • Allowing users to break CSS into multiple files without additional fetch requests
  • Conditionals like if and for
  • Mixins and functions

Native CSS has progressed a lot over the years. It has gained great browser support for the first two features:

  • CSS Variables
  • Nesting

With just these two features, I suspect a majority of CSS users won’t even need to fire up pre-processors or post-processors. What’s more, The if() function is coming to CSS in the future too.

But, for the rest of us who needs to make maintenance and loading performance a priority, we still need the third feature — the ability to break CSS into multiple files. This can be done with Sass’s use feature or PostCSS’s import feature (provided by the postcss-import plugin).

PostCSS also contains plugins that can help you create conditionals, mixins, and functions should you need them.

Although, from my experience, mixins can be better replaced with Tailwind’s @apply feature.

This brings us to Tailwind.

Tailwind removing support for pre-processors

Tailwind 4 has officially removed support for pre-processors. From Tailwind’s documentation:

Tailwind CSS v4.0 is a full-featured CSS build tool designed for a specific workflow, and is not designed to be used with CSS pre-processors like Sass, Less, or Stylus. Think of Tailwind CSS itself as your pre-processor — you shouldn’t use Tailwind with Sass for the same reason you wouldn’t use Sass with Stylus. Since Tailwind is designed for modern browsers, you actually don’t need a pre-processor for things like nesting or variables, and Tailwind itself will do things like bundle your imports and add vendor prefixes.

If you included Tailwind 4 via its most direct installation method, you won’t be able to use pre-processors with Tailwind.

@import `tailwindcss`

That’s because this one import statement makes Tailwind incompatible with Sass, Less, and Stylus.

But, (fortunately), Sass lets you import CSS files if the imported file contains the .css extension. So, if you wish to use Tailwind with Sass, you can. But it’s just going to be a little bit wordier.

@layer theme, base, components, utilities;

@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);

Personally, I dislike Tailwind’s preflight styles so I exclude them from my files.

@layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities);

Either way, many people won’t know you can continue to use pre-processors with Tailwind. Because of this, I suspect pre-processors will get less popular as Tailwind gains more momentum.

Now, beneath Tailwind is a CSS post-processor called Lightning CSS, so this brings us to talking about that.

Lightning CSS

Lightning CSS is a post-processor can do many things that a modern developer needs — so it replaces most of the PostCSS tool chain including:

Besides having a decent set of built-in features, it wins over PostCSS because it’s incredibly fast.

Lightning CSS is over 100 times faster than comparable JavaScript-based tools. It can minify over 2.7 million lines of code per second on a single thread.

Comparing build times for CSS Nano (544 milliseconds), ES Build (17 milliseconds), and Lightning CSS (4 milliseconds).

Speed helps Lightning CSS win since many developers are speed junkies who don’t mind switching tools to achieve reduced compile times. But, Lightning CSS also wins because it has great distribution.

It can be used directly as a Vite plugin (that many frameworks support). Ryan Trimble has a step-by-step article on setting it up with Vite if you need help.

// vite.config.mjs
export default {
  css: {
    transformer: 'lightningcss'
  },
  build: {
    cssMinify: 'lightningcss'
  }
};

If you need other PostCSS plugins, you can also include that as part of the PostCSS tool chain.

// postcss.config.js
// Import other plugins...
import lightning from 'postcss-lightningcss'

export default {
  plugins: [lightning, /* Other plugins */],
}

Many well-known developers have switched to Lightning CSS and didn’t look back. Chris Coyier says he’ll use a “super basic CSS processing setup” so you can be assured that you are probably not stepping in any toes if you wish to switch to Lightning, too.

If you wanna ditch pre-processors today

You’ll need to check the features you need. Native CSS is enough for you if you need:

  • CSS Variables
  • Nesting capabilities

Lightning CSS is enough for you if you need:

  • CSS Variables
  • Nesting capabilities
  • import statements to break CSS into multiple files

Tailwind (with @apply) is enough for you if you need:

  • all of the above
  • Mixins

If you still need conditionals like if, for and other functions, it’s still best to stick with Sass for now. (I’ve tried and encountered interoperability issues between postcss-for and Lightning CSS that I shall not go into details here).

That’s all I want to share with you today. I hope it helps you if you have been thinking about your CSS toolchain.


So, You Want to Give Up CSS Pre- and Post-Processors… originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Preethi
Wed, 16 Apr 2025 12:34:50 +0000


This article covers tips and tricks on effectively utilizing the CSS backdrop-filter property to style contemporary user interfaces. You’ll learn how to layer backdrop filters among multiple elements, and integrate them with other CSS graphical effects to create elaborate designs.

Below is a hodgepodge sample of what you can build based on everything we’ll cover in this article. More examples are coming up.

The blurry, frosted glass effect is popular with developers and designers these days — maybe because Josh Comeau wrote a deep-dive about it somewhat recently — so that is what I will base my examples on. However, you can apply everything you learn here to any relevant filter. I’ll also be touching upon a few of them in my examples.

What’s essential in a backdrop filter?

If you’re familiar with CSS filter functions like blur() and brightness(), then you’re also familiar with backdrop filter functions. They’re the same. You can find a complete list of supported filter functions here at CSS-Tricks as well as over at MDN.

The difference between the CSS filter and backdrop-filter properties is the affected part of an element. Backdrop filter affects the backdrop of an element, and it requires a transparent or translucent background in the element for its effect to be visible. It’s important to remember these fundamentals when using a backdrop filter, for these reasons:

  1. to decide on the aesthetics,
  2. to be able to layer the filters among multiple elements, and
  3. to combine filters with other CSS effects.

The backdrop

Design is subjective, but a little guidance can be helpful. If you’ve applied a blur filter to a plain background and felt the result was unsatisfactory, it could be that it needed a few embellishments, like shadows, or more often than not, it’s because the backdrop is too plain.

Plain backdrops can be enhanced with filters like brightness(), contrast(), and invert(). Such filters play with the luminosity and hue of an element’s backdrop, creating interesting designs. Textured backdrops complement distorting filters like blur() and opacity().

<main>
<div>
  <section>
    <h1>Weather today</h1>
    Cloudy with a chance of meatballs. Ramenstorms at 3PM that will last for ten minutes.
  </section>
</div>
</main>
main {
  background: center/cover url("image.jpg");
  box-shadow: 0 0 10px rgba(154 201 255 / 0.6);
  /* etc. */
  
  div {
    backdrop-filter: blur(10px);
    color: white;
    /* etc. */
  }
}

Layering elements with backdrop filters

As we just discussed, backdrop filters require an element with a transparent or translucent background so that everything behind it, with the filters applied, is visible.

If you’re applying backdrop filters on multiple elements that are layered above one another, set a translucent (not transparent) background to all elements except the bottommost one, which can be transparent or translucent, provided it has a backdrop. Otherwise, you won’t see the desired filter buildup.

<main>
<div>
  <section>
    <h1>Weather today</h1>
    Cloudy with a chance of meatballs. Ramenstorms at 3PM that will last for ten minutes.
  </section>
  <p>view details</p>
</div>
</main>
main {
  background: center/cover url("image.jpg");
  box-shadow: 0 0 10px rgba(154 201 255 / 0.6);
  /* etc. */

  div {
    background: rgb(255 255 255 / .1);
    backdrop-filter: blur(10px);
    /* etc. */

    p {
      backdrop-filter: brightness(0) contrast(10);
      /* etc. */
    }
  }
}

Combining backdrop filters with other CSS effects

When an element meets a certain criterion, it gets a backdrop root (not yet a standardized name). One criterion is when an element has a filter effect (from filter and background-filter). I believe backdrop filters can work well with other CSS effects that also use a backdrop root because they all affect the same backdrop.

Of those effects, I find two interesting: mask and mix-blend-mode. Combining backdrop-filter with mask resulted in the most reliable outcome across the major browsers in my testing. When it’s done with mix-blend-mode, the blur backdrop filter gets lost, so I won’t use it in my examples. However, I do recommend exploring mix-blend-mode with backdrop-filter.

Backdrop filter with mask

Unlike backdrop-filter, CSS mask affects the background and foreground (made of descendants) of an element. We can use that to our advantage and work around it when it’s not desired.

<main>
  <div>
    <div class="bg"></div>
    <section>
     <h1>Weather today</h1>
      Cloudy with a chance of meatballs. Ramenstorms at 3PM that will last for ten minutes. 
    </section>
  </div>
</main>
main {
  background: center/cover url("image.jpg");
  box-shadow: 0 0 10px rgba(154 201 255 / 0.6);
  /* etc. */
  
  > div {
      .bg {
        backdrop-filter: blur(10px);
        mask-image: repeating-linear-gradient(90deg, transparent, transparent 2px, white 2px, white 10px);
        /* etc. */
      }
    /* etc. */
  }
}

Backdrop filter for the foreground

We have the filter property to apply graphical effects to an element, including its foreground, so we don’t need backdrop filters for such instances. However, if you want to apply a filter to a foreground element and introduce elements within it that shouldn’t be affected by the filter, use a backdrop filter instead.

<main>
  <div class="photo">
    <div class="filter"></div>
  </div>
  <!-- etc. -->
</main>
.photo {
  background: center/cover url("photo.jpg");

  .filter {
    backdrop-filter: blur(10px) brightness(110%);
    mask-image: radial-gradient(white 5px, transparent 6px);
    mask-size: 10px 10px;
    transition: backdrop-filter .3s linear;
    /* etc.*/
  }

  &:hover .filter {
    backdrop-filter: none;
    mask-image: none;
  }
}

In the example below, hover over the blurred photo.

There are plenty of ways to play with the effects of the CSS backdrop-filter. If you want to layer the filters across stacked elements then ensure the elements on top are translucent. You can also combine the filters with other CSS standards that affect an element’s backdrop. Once again, here’s the set of UI designs I showed at the beginning of the article, that might give you some ideas on crafting your own.

References


Using CSS backdrop-filter for UI Effects originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Chris Coyier
Mon, 14 Apr 2025 16:36:55 +0000


I joked while talking with Adam Argyle on ShopTalk the other day that there is more CSS in one of the demos we were looking at that I have in my whole CSS brain. We were looking at his Carousel Gallery which is one of the more impressive sets of CSS demos I’ve ever seen. Don’t let your mind get too stuck on that word “carousel”. I think it’s smart to use that word here, but the CSS technologies being developed here have an incredible number of uses. Things that relate to scrolling interactivity, inertness, column layout, and more. Some of it is brand spanking new. In fact just a few weeks ago, I linked up the Carousel Configurator and said:

It only works in Google Chrome Canary because of experimental features.

Which was kind of true at the time, but the features aren’t that experimental anymore. All the features went live in Chrome 135 which is in stable release now for the world. Of course, you’ll need to think in terms of progressive enhancement if you’re looking to roll this stuff out to production, but this is real world movement on some huge stuff for CSS. This stuff is in the category where, looking a few years out, it’s a real mistake if carousels and carousel-like behavior isn’t built this way. This is the way of best performance, best semantics, and best accessibility, which ain’t gonna get beat with your MooTools Super Slider ok. Brecht is already bloggin’ about it. That’s a finger on the pulse right there.

What else is pretty hot ‘n’ fresh in CSS land?

  • CSS multicol block direction wrapping by Rachel Andrew — The first implementation of of columns being able to wrap down instead of across. Useful.
  • Can you un-mix a mixin? by Miriam Suzanne — Mixins are likely to express themselves as @apply in CSS eventually (despite being abandoned on purpose once?). We can already sort of do it with custom properties and style queries, which actually have the desirable characteristic of cascading. What will @apply do to address that?
  • Feature detect CSS @starting-style support by Bramus Van Damme — Someday, @supports at-rule(@starting-style) {} will work, but there (🫥) is no browser support for that yet. There is a way to do it with the space toggle trick fortunately (which is one of the most mind bending things ever in CSS if you ask me). I feel like mentioning that I was confused how to test a CSS function recently, but actually since they return values, it’s not that weird. I needed to do @supports (color: light-dark(white, black) {} which worked fine. Related to @starting-style, this is a pretty good article.
  • New Values and Functions in CSS by Alvaro Montoro — speaking of new functions, there are a good number of them, like calc-size(), first-valid(), sibling-index(), random-item(), and more. Amazing.
  • A keyframe combo trick by Adam Argyle — Two animations on a single element, one for the page load and one for a scroll animation. They fight. Or do they?
  • Container Queries Unleashed by Josh Comeau — If you haven’t boned up on the now-available-everyone @container stuff, it rules, and Josh does a great job of explaining why.
  • A Future of Themes with CSS Inline if() Conditions by Christopher Kirk-Nielsen — Looks like if() in CSS behaves like a switch in other languages and what you’re doing is checking if the value of a custom property is equal to a certain value, then returning whatever value you want. Powerful! Chris is building something like light-dark() here except with more than two themes and where the themes effect more than just color.
by: Declan Chidlow
Mon, 14 Apr 2025 12:40:46 +0000


The cursor is a staple of the desktop interface but is scarcely touched by websites. This is for good reason. People expect their cursors to stay fairly consistent, and meddling with them can unnecessarily confuse users. Custom cursors also aren’t visible for people using touch interfaces — which excludes the majority of people.

Geoff has already covered styling cursors with CSS pretty comprehensively in “Changing the Cursor with CSS for Better User Experience (or Fun)” so this post is going to focus on complex and interesting styling.

Custom cursors with JavaScript

Custom cursors with CSS are great, but we can take things to the next level with JavaScript. Using JavaScript, we can use an element as our cursor, which lets us style it however we would anything else. This lets us transition between cursor states, place dynamic text within the cursor, apply complex animations, and apply filters.

In its most basic form, we just need a div that continuously positions itself to the cursor location. We can do this with the mousemove event listener. While we’re at it, we may as well add a cool little effect when clicking via the mousedown event listener.

That’s wonderful. Now we’ve got a bit of a custom cursor going that scales on click. You can see that it is positioned based on the mouse coordinates relative to the page with JavaScript. We do still have our default cursor showing though, and it is important for our new cursor to indicate intent, such as changing when hovering over something clickable.

We can disable the default cursor display completely by adding the CSS rule cursor: none to *. Be aware that some browsers will show the cursor regardless if the document height isn’t 100% filled.

We’ll also need to add pointer-events: none to our cursor element to prevent it from blocking our interactions, and we’ll show a custom effect when hovering certain elements by adding the pressable class.

Very nice. That’s a lovely little circular cursor we’ve got here.

Fallbacks, accessibility, and touchscreens

People don’t need a cursor when interacting with touchscreens, so we can disable ours. And if we’re doing really funky things, we might also wish to disable our cursor for users who have the prefers-reduced-motion preference set.

We can do this without too much hassle:

What we’re doing here is checking if the user is accessing the site with a touchscreen or if they prefer reduced motion and then only enabling the custom cursor if they aren’t. Because this is handled with JavaScript, it also means that the custom cursor will only show if the JavaScript is active, otherwise falling back to the default cursor functionality as defined by the browser.

const isTouchDevice = "ontouchstart"in window || navigator.maxTouchPoints > 0;
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;

if (!isTouchDevice && !prefersReducedMotion && cursor) {
  // Cursor implementation is here
}

Currently, the website falls back to the default cursors if JavaScript isn’t enabled, but we could set a fallback cursor more similar to our styled one with a bit of CSS. Progressive enhancement is where it’s at!

Here we’re just using a very basic 32px by 32px base64-encoded circle. The 16 values position the cursor hotspot to the center.

html {
  cursor:
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0Jve
D0iMCAwIDMyIDMyIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iYmxhY2siIC8+Cjwvc3ZnPg==")
    16 16,
    auto;
}

Taking this further

Obviously this is just the start. You can go ballistic and completely overhaul the cursor experience. You can make it invert what is behind it with a filter, you can animate it, you could offset it from its actual location, or anything else your heart desires.

As a little bit of inspiration, some really cool uses of custom cursors include:

  • Studio Mesmer switches out the default cursor for a custom eye graphic when hovering cards, which is tasteful and fits their brand.
  • Iara Grinspun’s portfolio has a cursor implemented with JavaScript that is circular and slightly delayed from the actual position which makes it feel floaty.
  • Marlène Bruhat’s portfolio has a sleek cursor that is paired with a gradient that appears behind page elements.
  • Aleksandr Yaremenko’s portfolio features a cursor that isn’t super complex but certainly stands out as a statement piece.
  • Terra features a giant glowing orb containing text describing what you’re hovering over.

Please do take care when replacing browser or native operating system features in this manner. The web is accessible by default, and we should take care to not undermine this. Use your power as a developer with taste and restraint.


Next Level CSS Styling for Cursors originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Fri, 11 Apr 2025 12:39:26 +0000


Normally, I like to publish one of these updates every few months. But seeing as the last one dates back to September of last year, I’m well off that mark and figured it’s high time to put pen to paper. The fact is that a lot is happening around here at CSS-Tricks — and it’s all good stuff.

The Almanac is rolling

In the last post of 2024, I said that filling the Almanac was a top priority heading into this year. We had recently refreshed the whole dang thing, complete with completely new sections for documenting CSS selectors, at-rules, and functions on top of the sections we already had for properties and pseudo-selectors. The only problem is that those new sections were pretty bare.

Well, not only has this team stepped up to produce a bunch of new content for those new sections, but so have you. Together, we’ve published 21 new Almanac entries since the start of 2025. Here they are in all their glory:

What’s even better? There are currently fourteen more in the hopper that we’re actively working on. I certainly do not expect us to sustain this sort of pace all year. A lot of work goes into each and every entry. Plus, if all we ever did was write in Almanac, we would never get new articles and tutorials out to you, which is really what we’re all about around here.

A lot of podcasts and events

Those of you who know me know that I’m not the most social person in all the land. Yes, I like hanging out with folks and all that, but I tend to keep my activities to back-of-the-house stuff and prefer to stay out of view.

So, that’s why it’s weird for me to call out a few recent podcast and event appearances. It’s not like I do these things all that often, but they are fun and I like to note them, even if its only for posterity.

  • I hosted Smashing Meets Accessibility, a mini online conference that featured three amazing speakers talking about the ins and outs of WCAG conformance, best practices, and incredible personal experiences shaped by disability.
  • I hosted Smashing Meets CSS, another mini conference from the wonderful Smashing Magazine team. I got to hang out with Adam Argyle, Julia Micene, and Miriam Suzanne, all of whom blew my socks off with their presentations and panel discussion on what’s new and possible in modern CSS.
  • I’m co-hosting a brand-new podcast with Brad Frost called Open Up! We recorded the first episode live in front of an audience that was allowed to speak up and participate in the conversation. The whole idea of the show is that we talk more about the things we tend to talk less about in our work as web designers and developers — the touchy-feely side of what we do. We covered so many heady topics, from desperation during layoffs to rediscovering purpose in your work.
  • I was a guest on the Mental Health in Tech podcast, joining a panel of other front-enders to discuss angst in the face of recent technological developments. The speed and constant drive to market new technologies is dizzying and, to me at least, off-putting to the extent that I’ve questioned my entire place in it as a developer. What a blast getting to return to the podcast a second time and talk shop with a bunch of the most thoughtful, insightful people you’ll ever hear. I’ll share that when it’s published.

A new guide on styling counters

We published it just the other week! I’ll be honest and say that a complete guide about styling counters in CSS was not the first thing that came to my mind when we started planning new ideas, but I’ll be darned if Juan didn’t demonstrate just how big a topic it is. There are so many considerations when it comes to styling counters — design! accessibility! semantics! — and the number of tools we have in CSS to style them is mind-boggling, including two functions that look very similar but have vastly different capabilities for creating custom counters — counter() and counters() (which are also freshly published in the Almanac).

At the end of last year, I said I hoped to publish 1-2 new guides, and here we are in the first quarter of 2025 with our first one out in the wild! That gives me hope that we’ll be able to get another comprehensive guide out before the end of the year.

Authors

I think the most exciting update of all is getting to recognize the folks who have published new articles with us since the last update. Please help me extend a huge round of applause to all the faces who have rolled up their sleeves and shared their knowledge with us.

And, of course, nothing on this site would be possible without ongoing help from Juan Diego Rodriguez and Ryan Trimble. Those two not only do a lot of heavy lifting to keep the content machine fed, but they are also just two wonderful people who make my job a lot more fun and enjoyable. Seriously, guys, you mean a lot to this site and me!


CSS-Tricks Chronicles XLIII originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Zell Liew
Thu, 10 Apr 2025 12:39:43 +0000


By this point, it’s not a secret to most people that I like Tailwind.

But, unknown to many people (who often jump to conclusions when you mention Tailwind), I don’t like vanilla Tailwind. In fact, I find most of it horrible and I shall refrain from saying further unkind words about it.

But I recognize and see that Tailwind’s methodology has merits — lots of them, in fact — and they go a long way to making your styles more maintainable and performant.

Today, I want to explore one of these merit-producing features that has been severely undersold — Tailwind’s @apply feature.

What @apply does

Tailwind’s @apply features lets you “apply” (or simply put, copy-and-paste) a Tailwind utility into your CSS.

Most of the time, people showcase Tailwind’s @apply feature with one of Tailwind’s single-property utilities (which changes a single CSS declaration). When showcased this way, @apply doesn’t sound promising at all. It sounds downright stupid. So obviously, nobody wants to use it.

/* Input */
.selector {
  @apply p-4;
}

/* Output */
.selector {
  padding: 1rem;
}

To make it worse, Adam Wathan recommends against using @apply, so the uptake couldn’t be worse.

Personally, I think Tailwind’s @apply feature is better than described.

Tailwind’s @apply is like Sass’s @includes

If you have been around during the time where Sass is the dominant CSS processing tool, you’ve probably heard of Sass mixins. They are blocks of code that you can make — in advance — to copy-paste into the rest of your code.

  • To create a mixin, you use @mixin
  • To use a mixin, you use @includes
// Defining the mixin
@mixin some-mixin() {
  color: red; 
  background: blue; 
}

// Using the mixin
.selector {
  @include some-mixin(); 
}

/* Output */
.selector {
  color: red; 
  background: blue; 
}

Tailwind’s @apply feature works the same way. You can define Tailwind utilities in advance and use them later in your code.

/* Defining the utility */
@utility some-utility {
  color: red; 
  background: blue; 
}

/* Applying the utility */
.selector {
  @apply some-utility; 
}

/* Output */
.selector {
  color: red; 
  background: blue; 
}

Tailwind utilities are much better than Sass mixins

Tailwind’s utilities can be used directly in the HTML, so you don’t have to write a CSS rule for it to work.

@utility some-utility {
  color: red; 
  background: blue; 
}
<div class="some-utility">...</div> 

On the contrary, for Sass mixins, you need to create an extra selector to house your @includes before using them in the HTML. That’s one extra step. Many of these extra steps add up to a lot.

@mixin some-mixin() {
  color: red; 
  background: blue; 
}

.selector {
  @include some-mixin(); 
}

/* Output */
.selector {
  color: red; 
  background: blue; 
}
<div class="selector">...</div>

Tailwind’s utilities can also be used with their responsive variants. This unlocks media queries straight in the HTML and can be a superpower for creating responsive layouts.

<div class="utility1 md:utility2">…</div> 

A simple and practical example

One of my favorite — and most easily understood — examples of all time is a combination of two utilities that I’ve built for Splendid Layouts (a part of Splendid Labz):

  • vertical: makes a vertical layout
  • horizontal: makes a horizontal layout

Defining these two utilities is easy.

  • For vertical, we can use flexbox with flex-direction set to column.
  • For horizontal, we use flexbox with flex-direction set to row.
@utility horizontal {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

@utility vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

After defining these utilities, we can use them directly inside the HTML. So, if we want to create a vertical layout on mobile and a horizontal one on tablet or desktop, we can use the following classes:

<div class="vertical sm:horizontal">...</div>

For those who are new to Tailwind, sm: here is a breakpoint variant that tells Tailwind to activate a class when it goes beyond a certain breakpoint. By default, sm is set to 640px, so the above HTML produces a vertical layout on mobile, then switches to a horizontal layout at 640px.

If you prefer traditional CSS over composing classes like the example above, you can treat @apply like Sass @includes and use them directly in your CSS.

<div class="your-layout">...</div> 
.your-layout {
  @apply vertical; 

  @media (width >= 640px) {
    @apply horizontal;
  }
}

The beautiful part about both of these approaches is you can immediately see what’s happening with your layout — in plain English — without parsing code through a CSS lens. This means faster recognition and more maintainable code in the long run.

Tailwind’s utilities are a little less powerful compared to Sass mixins

Sass mixins are more powerful than Tailwind utilities because:

  1. They let you use multiple variables.
  2. They let you use other Sass features like @if and @for loops.
@mixin avatar($size, $circle: false) {
  width: $size;
  height: $size;

  @if $circle {
    border-radius: math.div($size, 2);
  }
}

On the other hand, Tailwind utilities don’t have these powers. At the very maximum, Tailwind can let you take in one variable through their functional utilities.

/* Tailwind Functional Utility */
@utility tab-* { 
  tab-size: --value(--tab-size-*);
}

Fortunately, we’re not affected by this “lack of power” much because we can take advantage of all modern CSS improvements — including CSS variables. This gives you a ton of room to create very useful utilities.

Let’s go through another example

A second example I often like to showcase is the grid-simple utility that lets you create grids with CSS Grid easily.

We can declare a simple example here:

@utility grid-simple {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap, 1rem);
}

By doing this, we have effectively created a reusable CSS grid (and we no longer have to manually declare minmax everywhere).

After we have defined this utility, we can use Tailwind’s arbitrary properties to adjust the number of columns on the fly.

<div class="grid-simple [--cols:3]"> 
  <div class="item">...</div>
  <div class="item">...</div>
  <div class="item">...</div>
</div>

To make the grid responsive, we can add Tailwind’s responsive variants with arbitrary properties so we only set --cols:3 on a larger breakpoint.

<div class="grid-simple sm:[--cols:3]"> 
  <div class="item">...</div>
  <div class="item">...</div>
  <div class="item">...</div>
</div>

This makes your layouts very declarative. You can immediately tell what’s going on when you read the HTML.

Now, on the other hand, if you’re uncomfortable with too much Tailwind magic, you can always use @apply to copy-paste the utility into your CSS. This way, you don’t have to bother writing repeat and minmax declarations every time you need a grid that grid-simple can create.

.your-layout {
  @apply grid-simple; 
  @media (width >= 640px) {
    --cols: 3;
  }
}
<div class="your-layout"> ... </div>

By the way, using @apply this way is surprisingly useful for creating complex layouts! But that seems out of scope for this article so I’ll be happy to show you an example another day.

Wrapping up

Tailwind’s utilities are very powerful by themselves, but they’re even more powerful if you allow yourself to use @apply (and allow yourself to detach from traditional Tailwind advice). By doing this, you gain access to Tailwind as a tool instead of it being a dogmatic approach.

To make Tailwind’s utilities even more powerful, you might want to consider building utilities that can help you create layouts and nice visual effects quickly and easily.

I’ve built a handful of these utilities for Splendid Labz and I’m happy to share them with you if you’re interested! Just check out Splendid Layouts to see a subset of the utilities I’ve prepared.

By the way, the utilities I showed you above are watered-down versions of the actual ones I’m using in Splendid Labz.

One more note: When writing this, Splendid Layouts work with Tailwind 3, not Tailwind 4. I’m working on a release soon, so sign up for updates if you’re interested!


Tailwind’s @apply Feature is Better Than it Sounds originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Thu, 10 Apr 2025 11:26:00 +0000


If I were starting with CSS today for the very first time, I would first want to spend time understanding writing modes because that’s a great place to wrap your head around direction and document flow. But right after that, and even more excitedly so, I would jump right into display and get a firm grasp on layout strategies.

And where would I learn that? There are lots of great resources out there. I mean, I have a full course called The Basics that gets into all that. I’d say you’d do yourself justice getting that from Andy Bell’s Complete CSS course as well.

But, hey, here’s a brand new way to bone up on layout: Miriam Suzanne is running a workshop later this month. Cascading Layouts is all about building more resilient and maintainable web layouts using modern CSS, without relying on third-party tools. Remember, Miriam works on CSS specifications, is a core contributor to Sass, and is just plain an all-around great educator. There are few, if any, who are more qualified to cover the ins and outs of CSS layout, and I can tell you that her work really helped inspire and inform the content in my course. The workshop is online, runs April 28-30, and is a whopping $ 100 off if you register by April 12.

Just a taste of what’s included:


Cascading Layouts: A Workshop on Resilient CSS Layouts originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

CSS Carousels

by: Geoff Graham
Wed, 09 Apr 2025 13:00:24 +0000


The CSS Overflow Module Level 5 specification defines a couple of new features that are designed for creating carousel UI patterns:

  • Scroll Buttons: Buttons that the browser provides, as in literal <button> elements, that scroll the carousel content 85% of the area when clicked.
  • Scroll Markers: The little dots that act as anchored links, as in literal <a> elements that scroll to a specific carousel item when clicked.

Chrome has prototyped these features and released them in Chrome 135. Adam Argyle has a wonderful explainer over at the Chrome Developer blog. Kevin Powell has an equally wonderful video where he follows the explainer. This post is me taking notes from them.

First, some markup:

<ul class="carousel">
  <li>...</li>
  <li>...</li>
  <li>...</li>
  <li>...</li>
  <li>...</li>
</ul>

First, let’s set these up in a CSS auto grid that displays the list items in a single line:

.carousel {
  display: grid;
  grid-auto-flow: column;
}

We can tailor this so that each list item takes up a specific amount of space, say 40%, and insert a gap between them:

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 40%;
  gap: 2rem;
}

This gives us a nice scrolling area to advance through the list items by moving left and right. We can use CSS Scroll Snapping to ensure that scrolling stops on each item in the center rather than scrolling right past them.

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 40%;
  gap: 2rem;

  scroll-snap-type: x mandatory;

  > li {
    scroll-snap-align: center;
  }
}

Kevin adds a little more flourish to the .carousel so that it is easier to see what’s going on. Specifically, he adds a border to the entire thing as well as padding for internal spacing.

So far, what we have is a super simple slider of sorts where we can either scroll through items horizontally or click the left and right arrows in the scroller.

We can add scroll buttons to the mix. We get two buttons, one to navigate one direction and one to navigate the other direction, which in this case is left and right, respectively. As you might expect, we get two new pseudo-elements for enabling and styling those buttons:

  • ::scroll-button(left)
  • ::scroll-button(right)

Interestingly enough, if you crack open DevTools and inspect the scroll buttons, they are actually exposed with logical terms instead, ::scroll-button(inline-start) and ::scroll-button(inline-end).

DevTools with an arrow pointing at the two scroll buttons in the HTML showing them with logical naming.

And both of those support the CSS content property, which we use to insert a label into the buttons. Let’s keep things simple and stick with “Left” and “Right” as our labels for now:

.carousel::scroll-button(left) {
  content: "Left";
}
.carousel::scroll-button(right) {
  content: "Right";
}

Now we have two buttons above the carousel. Clicking them either advances the carousel left or right by 85%. Why 85%? I don’t know. And neither does Kevin. That’s just what it says in the specification. I’m sure there’s a good reason for it and we’ll get more light shed on it at some point.

But clicking the buttons in this specific example will advance the scroll only one list item at a time because we’ve set scroll snapping on it to stop at each item. So, even though the buttons want to advance by 85% of the scrolling area, we’re telling it to stop at each item.

Remember, this is only supported in Chrome at the time of writing:

We can select both buttons together in CSS, like this:

.carousel::scroll-button(left),
.carousel::scroll-button(right) {
  /* Styles */
}

Or we can use the Universal Selector:

.carousel::scroll-button(*) {
  /* Styles */
}

And we can even use newer CSS Anchor Positioning to set the left button on the carousel’s left side and the right button on the carousel’s right side:

.carousel {
  /* ... */
  anchor-name: --carousel; /* define the anchor */
}

.carousel::scroll-button(*) {
  position: fixed; /* set containment on the target */
  position-anchor: --carousel; /* set the anchor */
}

.carousel::scroll-button(left) {
  content: "Left";
  position-area: center left;
}
.carousel::scroll-button(right) {
  content: "Right";
  position-area: center right;
}

Notice what happens when navigating all the way to the left or right of the carousel. The buttons are disabled, indicating that you have reached the end of the scrolling area. Super neat! That’s something that is normally in JavaScript territory, but we’re getting it for free.

Let’s work on the scroll markers, or those little dots that sit below the carousel’s content. Each one is an <a> element anchored to a specific list item in the carousel so that, when clicked, you get scrolled directly to that item.

We get a new pseudo-element for the entire group of markers called ::scroll-marker-group that we can use to style and position the container. In this case, let’s set Flexbox on the group so that we can display them on a single line and place gaps between them in the center of the carousel’s inline size:

.carousel::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

We also get a new scroll-marker-group property that lets us position the group either above (before) the carousel or below (after) it:

.carousel {
  /* ... */
  scroll-marker-group: after; /* displayed below the content */
}

We can style the markers themselves with the new ::scroll-marker pseudo-element:

.carousel {
  /* ... */

  > li::scroll-marker {
    content: "";
    aspect-ratio: 1;
    border: 2px solid CanvasText;
    border-radius: 100%;
    width: 20px;
  }
}

When clicking on a marker, it becomes the “active” item of the bunch, and we get to select and style it with the :target-current pseudo-class:

li::scroll-marker:target-current {
  background: CanvasText;
}

Take a moment to click around the markers. Then take a moment using your keyboard and appreciate that we can all of the benefits of focus states as well as the ability to cycle through the carousel items when reaching the end of the markers. It’s amazing what we’re getting for free in terms of user experience and accessibility.

We can further style the markers when they are hovered or in focus:

li::scroll-marker:hover,
li::scroll-marker:focus-visible {
  background: LinkText;
}

And we can “animate” the scrolling effect by setting scroll-behavior: smooth on the scroll snapping. Adam smartly applies it when the user’s motion preferences allow it:

.carousel {
  /* ... */

  @media (prefers-reduced-motion: no-preference) {
    scroll-behavior: smooth;
  }
}

Buuuuut that seems to break scroll snapping a bit because the scroll buttons are attempting to slide things over by 85% of the scrolling space. Kevin had to fiddle with his grid-auto-columns sizing to get things just right, but showed how Adam’s example took a different sizing approach. It’s a matter of fussing with things to get them just right.


This is just a super early look at CSS Carousels. Remember that this is only supported in Chrome 135+ at the time I’m writing this, and it’s purely experimental. So, play around with it, get familiar with the concepts, and then be open-minded to changes in the future as the CSS Overflow Level 5 specification is updated and other browsers begin building support.


CSS Carousels originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Chris Coyier
Mon, 07 Apr 2025 17:01:01 +0000


Love HTML? Good. It’s very lovable. One of my favorite parts is how you can screw it all up and it still it’s absolute best to render how it thinks you meant. Not a lot of other languages like that. Are there any? English, I suppose lolz. Anyway — I figured I’d just share 10 links about HTML that I’ve save because, well, I personally thought there were interesting and enjoyed learning what they had to teach.

  1. The selected date must be within the last 10 years by Gerardo Rodriguez — That’s the requirement. How do you do it? Definitely use the HTML validation features for the date input. But unfortunately, JavaScript will need to be involved to set them, which means timezones and all that.
  2. Just because you can doesn’t mean you should: the <meter> element by Sophie Koonin — I think the HTML
    Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>
    is hilarious(ly silly). As Sophie puts it, this is the “letter, not the spirit, of semantic HTML.”
  3. Fine-tuning Text Inputs by Garrett Dimon — One of those articles that reminds you that there are actually quite a few bonus attributes for HTML inputs and they are all actually pretty useful and you should consider using them.
  4. How to think about HTML responsive images by Dan Cătălin Burzo — Speaking of loads of fairly complex attributes, it’s hard to beat responsive images in that regard. Always interesting to read something thinking through it all. This always leads me to the conclusion that it absolutely needs to be automated.
  5. Styling an HTML dialog modal to take the full height of the viewport by Simon Willison — Sometimes unexpected browser styles can bite you. DevTools help uncover that of course… if you can see them. I was once very confused about weird behaving dialogs when I set it to be position: relative; (they are fixed by browser styles), so watch for that too.
  6. Foundations: grouping forms with <fieldset> and <legend> by Demelza Feltham — “Accessible grouping benefits everyone”. Let’s clean up the weird styling of fieldset while we’re at it.
  7. HTML Whitespace is Broken by Douglas Parker — I think a lot of us have a developed intuition of how HTML uses or ignores whitespace, but Douglas manages to point out some real oddities I hadn’t thought of clearly defining before. Like if there is a space both before and after a </a>, the space will collapse, but with the single space be part of the link or not? Formatters struggle with this as their formatting can introduce output changes. It’s one reason I like JSX because it’s ultra opinionated on formatting and how spacing is handled.
  8. A highly configurable switch component using modern CSS techniques by Andy Bell — We’ve got <input type="checkbox" switch> coming (it’s in Safari now), but if you can’t wait you can build your own, as long as you are careful.
  9. Building a progress-indicating scroll-to-top button in HTML and CSS by Manuel Matuzović — I like that trick where you can use scroll-driven animations to only reveal a “scroll back to the top” button after you’ve scrolled down a bit. I also like Manuel’s idea here where the button itself fills up as you scroll down. I generally don’t care for scroll progress indicators, but this is so subtle it’s cool.
  10. Test-driven HTML and accessibility by David Luhr — I’ve written Cypress tests before and this echos of that but feels kinda lower level. It’s interesting looking at Server JavaScript executing DOM JavaScript with expect tests. I suppose it’s a bit like building your own aXe.
by: Lee Meyer
Mon, 07 Apr 2025 14:41:53 +0000


When I was young and dinosaurs walked the earth, I worked on a software team that developed a web-based product for two years before ever releasing it. I don’t just mean we didn’t make it publicly available; we didn’t deploy it anywhere except for a test machine in the office, accessed by two internal testers, and this required a change to each tester’s hosts file. You don’t have to be an agile evangelist to spot the red flag. There’s “release early, release often,” which seemed revolutionary the first time I heard it after living under a waterfall for years, or there’s building so much while waiting so long to deploy that you guarantee weird surprises in a realistic deployment, let alone when you get feedback from real users. I’m told the first deployment experience to a web farm was very special.

A tale of a dodgy deployment

Being a junior, I was spared being involved in the first deployment. But towards the end of the first three-month cycle of fixes, the team leader asked me, “Would you be available on Tuesday at 2 a.m. to come to the office and do a deployment?”

“Yep, sure, no worries.” I went home thinking what a funny dude my team leader was.

So on Tuesday at 9 a.m., I show up and say good morning to the team leader and the architect, who sit together staring at one computer. I sit down at my dev machine and start typing.

“Man, what happened?” the team leader says over the partition. “You said you’d be here at 2 a.m.”

I look at him and see he is not smiling. I say, ”Oh. I thought you were joking.”

“I was not joking, and we have a massive problem with the deployment.”

Uh-oh.

I was junior and did not have the combined forty years of engineering experience of the team leader and architect, but what I had that they lacked was a well-rested brain, so I found the problem rather quickly: It was a code change the dev manager had made to the way we handled cookies, which didn’t show a problem on the internal test server but broke the world on the real web servers. Perhaps my finding the issue was the only thing that saved me from getting a stern lecture. By the time I left years later, it was just a funny story the dev manager shared in my farewell speech, along with nice compliments about what I had achieved for the company — I also accepted an offer to work for the company again later.

Breaking news: Human beings need sleep

I am sure the two seniors would have been capable of spotting the problem under different circumstances. They had a lot working against them: Sleep deprivation, together with the miscommunication about who would be present, would’ve contributed to feelings of panic, which the outage would’ve exacerbated after they powered through and deployed without me. More importantly, they didn’t know whether the problem was in the new code or human error in their manual deployment process of copying zipped binaries and website files to multiple servers, manually updating config files, comparing and updating database schemas — all in the wee hours of the morning.

They were sleepily searching for a needle in a haystack of their own making. The haystack wouldn’t have existed if they had a proven automated deployment process, and if they could be sure the problem could only reside in the code they deployed. There was no reason everything they were doing couldn’t be scripted. They could’ve woken up at 6 a.m. instead of 2 a.m. to verify the automated release of the website before shifting traffic to it and fix any problems that became evident in their release without disrupting real users. The company would get a more stable website and the expensive developers would have more time to focus on developing.

If you manually deploy overnight, and then drive, you’re a bloody idiot

The 2 a.m. deployments might seem funny if it wasn’t your night to attend and if you have a dark sense of humor. In the subsequent years, I attended many 2 a.m. deployments to atone for the one I slept through. The company paid for breakfast on those days, and if we proved the deployment was working, we could leave for the day and catch up on sleep, assuming we survived the drive home and didn’t end up sleeping forever.

The manual deployment checklist was perpetually incomplete and out-of-date, yet the process was never blamed for snafus on deployment days. In reality, sometimes it was a direct consequence of the fallibility of manually working from an inaccurate checklist. Sometimes manual deployment wasn’t directly the culprit, but it made pinpointing the problem or deciding whether to roll back unnecessarily challenging. And you knew rolling back would mean forgoing your sleep again the next day so you’d have a mounting sleep debt working against you.

I learned a lot from that team and the complex features I had the opportunity to build. But the deployment process was a step backward from my internship doing Windows programming because in that job I had to write installers so my code would work on user machines, which by nature of the task, I didn’t have access to. When web development removes that inherent limitation, it’s like a devil on your shoulder tempting you to do what seems easy in the moment and update production from your dev machine. You know you want to, especially when the full deployment process is hard and people want a fix straightaway. This is why if you automate deployments, you want to lock things down so that the automated process is the only way to deploy changes.

As I became more senior and had more say in how these processes happened at my workplace, I started researching — and I found it easy to relate to the shots taken at manual deployers, such as this presentation titled “Octopus Deploy and how to stop deploying like an idiot” and Octopus Deploy founder Paul Stovell’s sentiments on how to deploy database updates: “Your database isn’t in source control? You don’t deserve one. Go use Excel.” This approach to giving developers a kick in their complacency reminds me of the long-running anti-drunk driving ads here in Australia with the slogan “If you drink then drive, you’re a bloody idiot,” which scared people straight by insulting them for destructive life choices.

In the “Stop deploying like an idiot” talk, Damian Brady insults a hypothetical deployment manager at Acme Corp named Frank, who keeps being a hero by introducing risk and wasted time to a process that could be automated using Octopus, which would never make stupid mistakes like overwriting the config file.

“Frank’s pretty proud of his process in general,” says Damian. “Frank’s an idiot.”

Why are people like this?

Frankly, some of the Franks I have worked with were something worse than idiots. Comedian Jim Jeffries has a bit in which he says he’d take a nice idiot over a clever bastard. Frank’s a cunning bastard wolf in idiotic sheep’s clothing — the demographic of people who work in software shows above average IQ, and a person appointed “deployment manager” will have googled the options to make this task easier, but he chose not to use them. The thing is, Frank gets to seem important, make other devs look and feel stupid when they try to follow his process while he’s on leave, and even when he is working he gets to take overseas trips to hang with clients because he is the only one who can get the product working on a new server. Companies must be careful which behaviors they reward, and Conway’s law applies to deployment processes.

What I learned by being forced to do deployments manually

To an extent, the process reflecting hierarchy and division of responsibility is normal and necessary, which is why Octopus Deploy has built-in manual intervention and approval steps. But also, some of the motivations to stick with manual deployments are nonsense. Complex manual deployments are still more widespread than they need to be, which makes me feel bad for the developers who still live like me back in the 2000s — if you call that living.

I guess there is an argument for the team-building experiences in those 2 a.m. deployments, much like deployments in the military sense of the word may teach the troops some valuable life lessons, even if the purported reason for the battle isn’t the real reason, and the costs turn out to be higher than anyone expects.

It reminds me of a tour I had the good fortune to take in 2023 of the Adobe San Jose offices, in which a “Photoshop floor” includes time capsule conference rooms representing different periods in Photoshop’s history, including a 90’s room with a working Macintosh Classic running Photoshop 1.0. The past is an interesting and instructive place to visit but not somewhere you’d want to live in 2025.

Even so, my experience of Flintsones-style deployments gave me an appreciation for the ways a tool like Octopus Deploy automates everything I was forced to do manually in the past, which kept my motivation up when I was working through the teething problems once I was tasked with transforming a manual deployment process into an automated process. This appreciation for the value proposition of a tool like Octopus Deploy was why I later jumped at the opportunity to work for Octopus in 2021.

What I learned working for Octopus Deploy

The first thing I noticed was how friendly the devs were and the smoothness of the onboarding process, with only one small manual change to make the code run correctly in Docker on my dev box. The second thing I noticed was that this wasn’t heaven, and there were flaky integration tests, slow builds, and cake file output that hid the informative build errors. In fairness, at the time Octopus was in a period of learning how to upscale. There was a whole project I eventually joined to performance-tune the integration tests and Octopus itself. As an Octopus user, the product had seemed as close to magic as we were likely to find, compared to the hell we had to go through without a proper deployment tool. Yet there’s something heartening about knowing nobody has a flawless codebase, and even Octopus Deploy has some smelly code they have to deal with and suboptimal deployments of some stuff.

Once I made my peace with the fact that there’s no silver bullet that magically and perfectly solves any aspect of software, including deployments, my hot take is that deploying like an idiot comes down to a mismatch between the tools you use to deploy and the reward in complexity reduced versus complexity added. Therefore, one example of deploying like an idiot is the story I opened with, in which team members routinely drove to the office at 2 a.m. to manually deploy a complicated website involving database changes, background processes, web farms, and SLAs. But another example of deploying like an idiot might be a solo developer with a side project who sets up Azure Devops to push to Octopus Deploy and pays more than necessary in money and cognitive load. Indeed, Octopus is a deceptively complex tool that can automate anything, not only deployments, but the complexity comes at the price of a learning curve and the risk of decision fatigue.

For instance, when I used my “sharpening time” (the Octopus term for side-project time) to explore ways to deploy a JavaScript library, I found at least two different ways to do it in Octopus, depending on whether it’s acceptable to automate upgrading all your consumers to the latest version of your library or whether you need more control of versioning per consumer. Sidenote: the Angry Birds Octopus parody that Octopus marketing created to go with my “consumers of your JavaScript library as tenants” article was a highlight of my time at Octopus — I wish we could have made it playable like a Google Doodle.

Nowadays I see automation as a spectrum for how automatic and sophisticated you need things to be, somewhat separate from the choice of tools. The challenge is locating that sweet spot, where automation makes your life easier versus the cost of licensing fees and the time and energy you need to devote to working on the deployment process. Octopus Deploy might be at one end of the spectrum of automated deployments when you need lots of control over a complicated automatic process. On the other end of the spectrum, the guy who runs Can I Use found that adopting git-ftp was a life upgrade from manually copying the modified files to his web server while keeping his process simple and not spending a lot of energy on more sophisticated deployment systems. Somewhere in the middle reside things like Bitbucket Pipelines or GitHub Actions, which are more automated and sophisticated than just git-ftp from your dev machine, but less complicated than Octopus together with TeamCity, which could be overkill on a simple project.

The complexity of deployment might be something to consider when defining your architecture, similar to how planning poker can trigger a business to rethink the value of certain features once they obtain holistic feedback from the team on the overall cost. For instance, you might assume you need a database, but when you factor in the complexity it adds to roll-outs, you may be motivated to rethink whether your use case truly needs a database.

What about serverless? Does serverless solve our problems given it’s supposed to eliminate the need to worry about how the server works?

Reminder: Serverless isn’t serverless

It should be uncontroversial to say that “serverless” is a misnomer, but how much this inaccuracy matters is debatable. I’ll give this analogy for why I think the name “serverless” is a problem: Early cars had a right to call themselves “horseless carriages” because they were a paradigm shift that meant your carriage could move without a horse. “Driverless cars” shouldn’t be called that, because they don’t remove the need for a driver; it’s just that the driver is an AI. “Self-driving car” is therefore a better name. Self-driving cars often work well, but completely ignoring the limitations of how they work can be fatal. When you unpack the term “serverless,” it’s like a purportedly horseless carriage still pulled by horse — but the driver claims his feeding and handling of the horse will be managed so well, the carriage will be so insulated from neighing and horse flatulence, passengers will feel as if the horse doesn’t exist. My counterargument is that the reality of the horse is bound to affect the passenger experience sooner or later.

For example, one of my hobby projects was a rap battle chat deployed to Firebase. I needed the Firebase cloud function to calculate the score for each post using the same rhyme detection algorithm I used to power the front end. This worked fine in testing when I ran the Firebase function using the Cloud Functions emulator — but it performed unacceptably after my first deployment due to a cold start (loading the pronunciation dictionary was the likely culprit if you’re wondering). Much like my experiences in the 2000s, my code behaved dramatically differently on my dev machine than on the real Firebase, almost as though there is still a server I can’t pretend doesn’t exist — but now I had limited ability to tweak it. One way to fix it was to throw money at the problem.

That serverless experience reminds me of a scene in the science fiction novel Rainbows End in which the curmudgeonly main character cuts open a car that isn’t designed to be serviced, only to find that all the components inside are labeled “No user-serviceable parts within.” He’s assured that even if he could cut open those parts, the car is “Russian dolls all the way down.” One of the other characters asks him: “Who’d want to change them once they’re made? Just trash ’em if they’re not working like you want.”

I don’t want to seem like a curmudgeon — but my point is that while something like Firebase offers many conveniences and can simplify deployment and configuration, it can also move the problem to knowing which services are appropriate to pay extra for. And you may find your options are limited when things go wrong with a deployment or any other part of web development.

Deploying this article

Since I love self-referential twist endings, I’ll point out that even publishing an article like this has a variety of possible “deployment processes.” For instance, Octopus uses Jekyll for their blog. You make a branch with the markdown of your proposed blog post, and then marketing proposes changes before setting a publication date and merging. The relevant automated process will handle publication from there. This process has the advantage of using familiar tools for collaborating on changes to a file — but it might not feel approachable to teams not comfortable with Git, and it also might not be immediately apparent how to preview the final article as it will appear on the website.

On the other hand, when I create an article for CSS-Tricks, I use Dropbox Paper to create my initial draft, then send it to Geoff Graham, who makes edits, for which I get notifications. Once we have confirmed via email that we’re happy with the article, he manually ports it to Markdown in WordPress, then sends me a link to a pre-live version on the site to check before the article is scheduled for publication. It’s a manual process, so I sometimes find problems even in this “release” of static content collaborated by only two people — but you gotta weigh how much risk there is of mistakes against how much value there would be in fully automating the process. With anything you have to publish on the web, keep searching for that sweet spot of elegance, risk, and the reward-to-effort ratio.


Feeling Like I Have No Release: A Journey Towards Sane Deployments originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Juan Diego Rodríguez
Fri, 04 Apr 2025 13:05:22 +0000


The beauty of research is finding yourself on a completely unrelated topic mere minutes from opening your browser. It happened to me while writing an Almanac entry on @namespace, an at-rule that we probably won’t ever use and is often regarded as a legacy piece of CSS. Maybe that’s why there wasn’t a lot of info about it until I found a 2010s post on @namespace by Divya Manian. The post was incredibly enlightening, but that’s beside the point; what’s important is that in Divya’s blog, there were arrows on the sides to read the previous and next posts:

Don’t ask me why, but without noticing, I somehow clicked the left arrow twice, which led me to a post on “Notes from HTML5 Readiness Hacking.”

What’s HTML 5 Readiness?!

HTML 5 Readiness was a site created by Paul Irish and Divya Manian that showed the browser support for several web features through the lens of a rainbow of colors. The features were considered (at the time) state-of-the-art or bleeding-edge stuff, such as media queries, transitions, video and audio tags, etc. As each browser supported a feature, a section of the rainbow would be added.

I think it worked from 2010 to 2013, although it showed browser support data from 2008. I can’t describe how nostalgic it made me feel; it reminded me of simpler times when even SVGs weren’t fully supported. What almost made me shed a tear was thinking that, if this tool was updated today, all of the features would be colored in a full rainbow.

A new web readiness

It got me thinking: there are so many new features coming to CSS (many that haven’t shipped to any browser) that there could be a new HTML5 Readiness with all of them. That’s why I set myself to do exactly that last weekend, a Web Readiness 2025 that holds each of the features coming to HTML and CSS I am most excited about.

You can visit it at webreadiness.com!

Right now, it looks kinda empty, but as time goes we will hopefully see how the rainbow grows:

Even though it was a weekend project, I took the opportunity to dip my toes into a couple of things I wanted to learn. Below are also some snippets I think are worth sharing.

The data is sourced from Baseline

My first thought was to mod the <baseline-status> web component made by the Chrome team because I have been wanting to use it since it came out. In short, it lets you embed the support data for a web feature directly into your blog. Not long ago, in fact, Geoff added it as a WordPress block in CSS-Tricks, which has been super useful while writing the Almanac:

However, I immediately realized that using the <baseline-status> would be needlessly laborious, so I instead pulled the data from the Web Features API — https://api.webstatus.dev/v1/features/ — and displayed it myself. You can find all the available features in the GitHub repo.

Each ray is a web component

Another feature I have been wanting to learn more about was Web Components, and since Geoff recently published his notes on Scott Jehl’s course Web Components Demystified, I thought it was the perfect chance. In this case, each ray would be a web component with a simple live cycle:

  1. Get instantiated.
  2. Read the feature ID from a data-feature attribute.
  3. Fetch its data from the Web Features API.
  4. Display its support as a list.

Said and done! The simplified version of that code looks something like the following:

class BaselineRay extends HTMLElement {
  constructor() {
    super();
  }

  static get observedAttributes() {
    return ["data-feature"];
  }

  attributeChangedCallback(property, oldValue, newValue) {
    if (oldValue !== newValue) {
      this[property] = newValue;
    }
  }

  async #fetchFeature(endpoint, featureID) {
    // Fetch Feature Function
  }

  async connectedCallback() {
    // Call fetchFeature and Output List
  }
}

customElements.define("baseline-ray", BaselineRay);

Animations with the Web Animation API

I must admit, I am not too design-savvy (I hope it isn’t that obvious), so what I lacked in design, I made up with some animations. When the page initially loads, a welcome animation is easily achieved with a couple of timed keyframes. However, the animation between the rainbow and list layouts is a little more involved since it depends on the user’s input, so we have to trigger them with JavaScript.

At first, I thought it would be easier to do them with Same-Document View Transitions, but I found myself battling with the browser’s default transitions and the lack of good documentation beyond Chrome’s posts. That’s why I decided on the Web Animation API, which lets you trigger transitions in a declarative manner.

sibling-index() and sibling-count()

A while ago, I wrote about the sibling-index() and sibling-count() functions. As their names imply, they return the current index of an element among its sibling, and the total amount of siblings, respectively. While Chrome announced its intent to ship both functions, I know it will be a while until they reach baseline support, but I still needed them to rotate and move each ray.

In that same post, I talked about three options to polyfill each function. The first two were CSS-only, but this time I took the simplest JavaScript way which observes the number of rays and adds custom properties with its index and total count. Sure, it’s a bit overkill since the amount of rays doesn’t change, but pretty easy to implement:

const elements = document.querySelector(".rays");

const updateCustomProperties = () => {
  let index = 0;

  for (let element of elements.children) {
    element.style.setProperty("--sibling-index", index);
    index++;
  }

  elements.style.setProperty("--sibling-count", elements.children.length - 1);
};

updateCustomProperties();

const observer = new MutationObserver(updateCustomProperties);
const config = {attributes: false, childList: true, subtree: false};
observer.observe(elements, config);

With this, I could position each ray in a 180-degree range:

baseline-ray ul{
  --position: calc(180 / var(--sibling-count) * var(--sibling-index) - 90);
  --rotation: calc(var(--position) * 1deg);
     
  transform: translateX(-50%) rotate(var(--rotation)) translateY(var(--ray-separation));
  transform-origin: bottom center;
}

The selection is JavaScript-less

In the browser captions, if you hover over a specific browser, that browser’s color will pop out more in the rainbow while the rest becomes a little transparent. Since in my HTML, the caption element isn’t anyway near the rainbow (as a parent or a sibling), I thought I would need JavaScript for the task, but then I remembered I could simply use the :has() selector.

It works by detecting whenever the closest parent of both elements (it could be <section>, <main>, or the whole <body>) has a .caption item with a :hover pseudo-class. Once detected, we increase the size of each ray section of the same browser, while decreasing the opacity of the rest of the ray sections.

What’s next?!

What’s left now is to wait! I hope people can visit the page from time to time and see how the rainbow grows. Like the original HTML 5 Readiness page, I also want to take a snapshot at the end of the year to see how it looks until each feature is fully supported. Hopefully, it won’t take long, especially seeing the browser’s effort to ship things faster and improve interoperability.

Also, let me know if you think a feature is missing! I tried my best to pick exciting features without baseline support.


A New “Web” Readiness Report originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

SMIL on?

by: Geoff Graham
Wed, 02 Apr 2025 12:37:19 +0000


I was chatting with Andy Clarke the other day about a new article he wants to write about SVG animations.

“I’ve read some things that said that SMIL might be a dead end.” He said. “Whaddya think?”

That was my impression, too. Sarah Drasner summed up the situation nicely way back in 2017:

Unfortunately, support for SMIL is waning in WebKit, and has never (nor will likely ever) exist for Microsoft’s IE or Edge browsers. 

Chrome was also in on the party and published an intent to deprecate SMIL, citing work in other browsers to support SVG animations in CSS. MDN linked to that same thread in its SMIL documentation when it published a deprecation warning.

Well, Chrome never deprecated SMIL. At least according to this reply in the thread dated 2023. And since then, we’ve also seen Microsoft’s Edge adopt a Chromium engine, effectively making it a Chrome clone. Also, last I checked, Caniuse reports full support in WebKit browsers.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

ChromeFirefoxIEEdgeSafari
5411796

Mobile / Tablet

Android ChromeAndroid FirefoxAndroidiOS Safari
13413636.0-6.1

Now, I’m not saying that SMIL is perfectly alive and well. It could still very well be in the doldrums, especially when there are robust alternatives in CSS and JavaScript. But it’s also not dead in the water.


SMIL on? originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Bryan Robinson
Tue, 01 Apr 2025 13:50:58 +0000


I’m a big fan of Astro’s focus on developer experience (DX) and the onboarding of new developers. While the basic DX is strong, I can easily make a convoluted system that is hard to onboard my own developers to. I don’t want that to happen.

If I have multiple developers working on a project, I want them to know exactly what to expect from every component that they have at their disposal. This goes double for myself in the future when I’ve forgotten how to work with my own system!

To do that, a developer could go read each component and get a strong grasp of it before using one, but that feels like the onboarding would be incredibly slow. A better way would be to set up the interface so that as the developer is using the component, they have the right knowledge immediately available. Beyond that, it would bake in some defaults that don’t allow developers to make costly mistakes and alerts them to what those mistakes are before pushing code!

Enter, of course, TypeScript. Astro comes with TypeScript set up out of the box. You don’t have to use it, but since it’s there, let’s talk about how to use it to craft a stronger DX for our development teams.

Watch

I’ve also recorded a video version of this article that you can watch if that’s your jam. Check it out on YouTube for chapters and closed captioning.

Setup

In this demo, we’re going to use a basic Astro project. To get this started, run the following command in your terminal and choose the “Minimal” template.

npm create astro@latest

This will create a project with an index route and a very simple “Welcome” component. For clarity, I recommend removing the <Welcome /> component from the route to have a clean starting point for your project.

To add a bit of design, I’d recommend setting up Tailwind for Astro (though, you’re welcome to style your component however you would like including a style block in the component).

npx astro add tailwind

Once this is complete, you’re ready to write your first component.

Creating the basic Heading component

Let’s start by defining exactly what options we want to provide in our developer experience.

For this component, we want to let developers choose from any HTML heading level (H1-H6). We also want them to be able to choose a specific font size and font weight — it may seem obvious now, but we don’t want people choosing a specific heading level for the weight and font size, so we separate those concerns.

Finally, we want to make sure that any additional HTML attributes can be passed through to our component. There are few things worse than having a component and then not being able to do basic functionality later.

Using Dynamic tags to create the HTML element

Let’s start by creating a simple component that allows the user to dynamically choose the HTML element they want to use. Create a new component at ./src/components/Heading.astro.

---
// ./src/component/Heading.astro
const { as } = Astro.props;
const As = as;
---

<As>
  <slot />
</As>

To use a prop as a dynamic element name, we need the variable to start with a capital letter. We can define this as part of our naming convention and make the developer always capitalize this prop in their use, but that feels inconsistent with how most naming works within props. Instead, let’s keep our focus on the DX, and take that burden on for ourselves.

In order to dynamically register an HTML element in our component, the variable must start with a capital letter. We can convert that in the frontmatter of our component. We then wrap all the children of our component in the <As> component by using Astro’s built-in <slot /> component.

Now, we can use this component in our index route and render any HTML element we want. Import the component at the top of the file, and then add <h1> and <h2> elements to the route.

---
// ./src/pages/index.astro
import Layout from '../layouts/Layout.astro';
import Heading from '../components/Heading.astro';

---

<Layout>
  <Heading as="h1">Hello!</Heading>
  <Heading as="h2">Hello world</Heading>
</Layout>
Showing the h1 and h3 elements inspected in DevTools.

This will render them correctly on the page and is a great start.

Adding more custom props as a developer interface

Let’s clean up the element choosing by bringing it inline to our props destructuring, and then add in additional props for weight, size, and any additional HTML attributes.

To start, let’s bring the custom element selector into the destructuring of the Astro.props object. At the same time, let’s set a sensible default so that if a developer forgets to pass this prop, they still will get a heading.

---
// ./src/component/Heading.astro
const { as: As="h2" } = Astro.props;
---

<As>
  <slot />
</As>

Next, we’ll get weight and size. Here’s our next design choice for our component system: do we make our developers know the class names they need to use or do we provide a generic set of sizes and do the mapping ourselves? Since we’re building a system, I think it’s important to move away from class names and into a more declarative setup. This will also future-proof our system by allowing us to change out the underlying styling and class system without affecting the DX.

Not only do we future proof it, but we also are able to get around a limitation of Tailwind by doing this. Tailwind, as it turns out can’t handle dynamically-created class strings, so by mapping them, we solve an immediate issue as well.

In this case, our sizes will go from small (sm) to six times the size (6xl) and our weights will go from “light” to “bold”.

Let’s start by adjusting our frontmatter. We need to get these props off the Astro.props object and create a couple objects that we can use to map our interface to the proper class structure.

---
// ./src/component/Heading.astro

const weights = {
    "bold": "font-bold",
    "semibold": "font-semibold",
    "medium": "font-medium",
    "light": "font-light"
}
const sizes= {
    "6xl": "text-6xl",
    "5xl": "text-5xl",
    "4xl": "text-4xl",
    "3xl": "text-3xl",
    "2xl": "text-2xl",
    "xl": "text-xl",
    "lg": "text-lg",
    "md": "text-md",
    "sm": "text-sm"
}

const { as: As="h2", weight="medium", size="2xl" } = Astro.props;
---

Depending on your use case, this amount of sizes and weights might be overkill. The great thing about crafting your own component system is that you get to choose and the only limitations are the ones you set for yourself.

From here, we can then set the classes on our component. While we could add them in a standard class attribute, I find using Astro’s built-in class:list directive to be the cleaner way to programmatically set classes in a component like this. The directive takes an array of classes that can be strings, arrays themselves, objects, or variables. In this case, we’ll select the correct size and weight from our map objects in the frontmatter.

---
// ./src/component/Heading.astro

const weights = {
  bold: "font-bold",
  semibold: "font-semibold",
  medium: "font-medium",
  light: "font-light",
};
const sizes = {
  "6xl": "text-6xl",
  "5xl": "text-5xl",
  "4xl": "text-4xl",
  "3xl": "text-3xl",
  "2xl": "text-2xl",
  xl: "text-xl",
  lg: "text-lg",
  md: "text-md",
  sm: "text-sm",
};

const { as: As = "h2", weight = "medium", size = "2xl" } = Astro.props;
---

<As class:list={[
  sizes[size], 
  weights[weight]
]}
>
  <slot />
</As>

Your front-end should automatically shift a little in this update. Now your font weight will be slightly thicker and the classes should be applied in your developer tools.

Showing the h1 and h3 elements inspected in DevTools with the relevant classnames applied.

From here, add the props to your index route, and find the right configuration for your app.

---
// ./src/pages/index.astro
import Layout from '../layouts/Layout.astro';
import Heading from '../components/Heading.astro';
---

<Layout>
  <Heading as="h1" size="6xl" weight="light">Hello!</Heading>
  <Heading as="h3" size="xl" weight="bold">Hello world</Heading>
</Layout>
Showing the h1 and h3 elements inspected in DevTools revealing the applied classes.

Our custom props are finished, but currently, we can’t use any default HTML attributes, so let’s fix that.

Adding HTML attributes to the component

We don’t know what sorts of attributes our developers will want to add, so let’s make sure they can add any additional ones they need.

To do that, we can spread any other prop being passed to our component, and then add them to the rendered component.

---
// ./src/component/Heading.astro

const weights = {
  // etc.
};
const sizes = {
  // etc.
};

const { as: As = "h2", weight = "medium", size = "md", ...attrs } = Astro.props;
---

<As class:list={[
  sizes[size], 
  weights[weight]
]}
{...attrs}
>
  <slot />
</As>

From here, we can add any arbitrary attributes to our element.

---
// ./src/pages/index.astro
import Layout from '../layouts/Layout.astro';
import Heading from '../components/Heading.astro';

---

<Layout>
  <Heading id="my-id" as="h1" size="6xl" weight="light">Hello!</Heading>
  <Heading class="text-blue-500" as="h3" size="xl" weight="bold">Hello world</Heading>
</Layout>

I’d like to take a moment to truly appreciate one aspect of this code. Our <h1>, we add an id attribute. No big deal. Our <h3>, though, we’re adding an additional class. My original assumption when creating this was that this would conflict with the class:list set in our component. Astro takes that worry away. When the class is passed and added to the component, Astro knows to merge the class prop with the class:list directive and automatically makes it work. One less line of code!

Showing the h1 and h3 elements inspected in DevTools.

In many ways, I like to consider these additional attributes as “escape hatches” in our component library. Sure, we want our developers to use our tools exactly as intended, but sometimes, it’s important to add new attributes or push our design system’s boundaries. For this, we allow them to add their own attributes, and it can create a powerful mix.

It looks done, but are we?

At this point, if you’re following along, it might feel like we’re done, but we have two issues with our code right now: (1) our component has “red squiggles” in our code editor and (2) our developers can make a BIG mistake if they choose.

The red squiggles come from type errors in our component. Astro gives us TypeScript and linting by default, and sizes and weights can’t be of type: any. Not a big deal, but concerning depending on your deployment settings.

The other issue is that our developers don’t have to choose a heading element for their heading. I’m all for escape hatches, but only if they don’t break the accessibility and SEO of my site.

Imagine, if a developer used this with a div instead of an h1 on the page. What would happen?We don’t have to imagine, make the change and see.

Showing the div and h3 elements inspected in DevTools.

It looks identical, but now there’s no <h1> element on the page. Our semantic structure is broken, and that’s bad news for many reasons. Let’s use typing to help our developers make the best decisions and know what options are available for each prop.

Adding types to the component

To set up our types, first we want to make sure we handle any HTML attributes that come through. Astro, again, has our backs and has the typing we need to make this work. We can import the right HTML attribute types from Astro’s typing package. Import the type and then we can extend that type for our own props. In our example, we’ll select the h1 types, since that should cover most anything we need for our headings.

Inside the Props interface, we’ll also add our first custom type. We’ll specify that the as prop must be one of a set of strings, instead of just a basic string type. In this case, we want it to be h1h6 and nothing else.

---
// ./src/component/Heading.astro
import type { HTMLAttributes } from 'astro/types';

interface Props extends HTMLAttributes<'h1'> {
  as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
}

//... The rest of the file
---

After adding this, you’ll note that in your index route, the <h1> component should now have a red underline for the as="div" property. When you hover over it, it will let you know that the as type does not allow for div and it will show you a list of acceptable strings.

If you delete the div, you should also now have the ability to see a list of what’s available as you try to add the string.

Showing a contextual menu that displays all of heading level options for the heading component while the code is being typed.

While it’s not a big deal for the element selection, knowing what’s available is a much bigger deal to the rest of the props, since those are much more custom.

Let’s extend the custom typing to show all the available options. We also denote these items as optional by using the ?:before defining the type.

While we could define each of these with the same type functionality as our as type, that doesn’t keep this future proofed. If we add a new size or weight, we’d have to make sure to update our type. To solve this, we can use a fun trick in TypeScript: keyof typeof.

There are two helper functions in TypeScript that will help us convert our weights and sizes object maps into string literal types:

  • typeof: This helper takes an object and converts it to a type. For instance typeof weights would return type { bold: string, semibold: string, ...etc}
  • keyof: This helper function takes a type and returns a list of string literals from that type’s keys. For instance keyof type { bold: string, semibold: string, ...etc} would return "bold" | "semibold" | ...etc which is exactly what we want for both weights and sizes.
---
// ./src/component/Heading.astro
import type { HTMLAttributes } from 'astro/types';

interface Props extends HTMLAttributes<'h1'> {
  as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
  weight?: keyof typeof weights;
  size?: keyof typeof sizes;
}

// ... The rest of the file

Now, when we want to add a size or weight, we get a dropdown list in our code editor showing exactly what’s available on the type. If something is selected, outside the list, it will show an error in the code editor helping the developer know what they missed.

Showing a contextual menu that displays all of the size options for the heading component while the code is being typed.

While none of this is necessary in the creation of Astro components, the fact that it’s built in and there’s no additional tooling to set up means that using it is very easy to opt into.

I’m by no means a TypeScript expert, but getting this set up for each component takes only a few additional minutes and can save a lot of time for developers down the line (not to mention, it makes onboarding developers to your system much easier).


Crafting Strong DX With Astro Components and TypeScript originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Chris Coyier
Mon, 31 Mar 2025 15:25:36 +0000


New CSS features help us in all sorts of different ways, but here we’re going to look at them when they power a specific type of component, or make a type of component newly possible with less or no JavaScript.

  • A single element CSS donut timer/countdown timer by Ben Frain — The surely least-used gradient type, conic-gradient() is used here to make donut (I’d call them charts) which when animated behave like a timer. This kind of thing changes the web in that we don’t need to reach for weightier or more complex technology to do something like this, which is actually visually pretty simple.
  • Sliding 3D Image Frames In CSS by Temani Afif — This one isn’t rife with new CSS features, but that almost makes it more mind blowing to me. In the HTML is only an <img> but the end result is a sliding-door on a 3D box that slides up to reveal the photo. This requires multiple backgrounds including a conic-gradient, a box-shadow and very exotic clip-path, not to mention a transition for the movement.
  • ⭐️ Carousel Configurator by the Chrome Gang — This one is wild. It only works in Google Chrome Canary because of experimental features. Scrolling snapping is there of course, and that’s neat and fundamental to carousels, but the other three features are, as I said, wild. (1) a ::scroll-button which appends, apparently, a fully interactive button that advances scroll by one page. (2) a ::scroll-marker and group pseudo element which are apparently a replacement for a scrollbar and are instead fully interactive stated buttons that represent how many pages a scrolling container has. (3) an interactivity: inert; declaration which you can apply within an animation-timeline such that off-screen parts of the carousel are not interactive. All this seems extremely experimental but I’m here for it.
  • Hide a header when scrolling down, show it again when scrolling up by Bramus Van Damme — With scroll-driven animations, you can “detect” if a page is being scrolled up or down, and in this case set the value of custom properties based on that information. Then with style() queries, set other styles, like hiding or showing a header. The big trick here is persisting the styles even when not scrolling, which involves an infinite transition-delay. This is the magic that keeps the header hidden until you scroll back up.
  • Center Items in First Row with CSS Grid by Ryan Mulligan — When you’re using CSS Grid, for the most part, you set up grid lines and place items exactly along those grid lines. That’s why it’s weird to see “staggered” looking layouts, which is what it looks like when one row of items doesn’t line up exactly with the one below it. But if you just make twice as many columns as you need and offset by one when you need to, you’ve got this kind of control. The trick is figuring out when.
by: Lee Meyer
Mon, 31 Mar 2025 14:59:47 +0000


A friend DMs Lee Meyer a CodePen by Manuel Schaller containing a pure CSS simulation of one of the world’s earliest arcade games, Pong, with both paddles participating automatically, in an endless loop. The demo reminds Lee of an arcade machine in attract mode awaiting a coin, and the iconic imagery awakens muscle memory from his misspent childhood, causing him to search his pocket in which he finds the token a spooky shopkeeper gave him last year at the CSS tricks stall in the haunted carnival. The token gleams like a power-up in the light of his laptop, which has a slot he never noticed. He feeds the token into the slot, and the CodePen reloads itself. A vertical range input and a life counter appear, allowing him to control the left paddle and play the game in Chrome using a cocktail of modern and experimental CSS features to implement collision detection in CSS animations. He recalls the spooky shopkeeper’s warning that playing with these features has driven some developers to madness, but the shopkeeper’s voice in Lee’s head whispers: “Too late, we are already playing.”

CSS collision detection: Past and present

So, maybe the experience of using modern CSS to add collision detection and interactivity to an animation wasn’t as much like a screenplay sponsored by CSS as I depicted in the intro above — but it did feel like magic compared to what Alex Walker had to go through in 2013 to achieve a similar effect. Hilariously, he describes his implementation as “a glittering city of hacks built on the banks of the ol’ Hack River. On the Planet Hack.“ Alex’s version of CSS Pong cleverly combines checkbox hacks, sibling selectors, and :hover, whereas the CodePen below uses style queries to detect collisions. I feel it’s a nice illustration of how far CSS has come, and a testament to increased power and expressiveness of CSS more than a decade later. It shows how much power we get when combining new CSS features — in this case, that includes style queries, animatable custom properties, and animation timelines. The future CSS features of inline conditionals and custom functions might be able to simplify this code more.

Collision detection with style queries

Interactive CSS animations with elements ricocheting off each other seems more plausible in 2025 and the code is somewhat sensible. While it’s unnecessary to implement Pong in CSS, and the CSS Working Group probably hasn’t been contemplating how to make that particular niche task easier, the increasing flexibility and power of CSS reinforce my suspicion that one day it will be a lifestyle choice whether to achieve any given effect with scripting or CSS.

The demo is a similar number of lines of CSS to Alex’s 2013 implementation, but it didn’t feel much like a hack. It’s a demo of modern CSS features working together in the way I expected after reading the instruction booklet. Sometimes when reading introductory articles about the new features we are getting in CSS, it’s hard to appreciate how game-changing they are till you see several features working together. As often happens when pushing the boundaries of a technology, we are going to bump up against the current limitations of style queries and animations. But it’s all in good fun, and we’ll learn about these CSS features in more detail than if we had not attempted this crazy experiment.

It does seem to work, and my 12-year-old and 7-year-old have both playtested it on my phone and laptop, so it gets the “works on Lee’s devices” seal of quality. Also, since Chrome now supports controlling animations using range inputs, we can make our game playable on mobile, unlike the 2013 version, which relied on :hover. Temani Afif provides a great explanation of how and why view progress timelines can be used to style anything based on the value of a range input.

Using style queries to detect if the paddle hit the ball

The ball follows a fixed path, and whether the player’s paddle intersects with the ball when it reaches our side is the only input we have into whether it continues its predetermined bouncy loop or the screen flashes red as the life counter goes down till we see the “Game Over” screen with the option to play again.

This type of interactivity is what game designers call a quick time event. It’s still a game for sure, but five months ago, when I was young and naive, I mused in my article on animation timelines that the animation timeline feature could open the door for advanced games and interactive experiences in CSS. I wrote that a video game is just a “hyper-interactive animation.” Indeed, the above experiment shows that the new features in CSS allow us to respond to user input in sophisticated ways, but the demo also clarifies the difference between the kind of interactivity we can expect from the current incarnation of CSS versus scripting. The above experiment is more like if Pong were a game inside the old-school arcade game Dragon’s Lair, which was one giant quick time event. It only works because there are limited possible outcomes, but they are certainly less limited than what we used to be able to achieve in CSS.

Since we know collision detection with the paddle is the only opportunity for the user to have a say in what happens next, let’s focus on that implementation. It will require more mental gymnastics than I would like, since container style queries only allow for name-value pairs with the same syntax as feature queries, meaning we can’t use “greater than” or “less than” operators when comparing numeric values like we do with container size queries which follow the same syntax as @media size queries.

The workaround below allows us to create style queries based on the ball position being in or out of the range of the paddle. If the ball hits our side, then by default, the play field will flash red and temporarily unpause the animation that decrements the life counter (more on that later). But if the ball hits our side and is within range of the paddle, we leave the life-decrementing animation paused, and make the field background green while the ball hits the paddle. Since we don’t have “greater than” or “less than” operators in style queries, we (ab)use the min() function. If the result equals the first argument then that argument is less than or equal to the second; otherwise it’s greater than the second argument. It’s logical but made me wish for better comparison operators in style queries. Nevertheless, I was impressed that style queries allow the collision detection to be fairly readable, if a little more verbose than I would like.

body {
  --int-ball-position-x: round(down, var(--ball-position-x));
  --min-ball-position-y-and-top-of-paddle: min(var(--ball-position-y) + var(--ball-height), var(--ping-position));
  --min-ball-position-y-and-bottom-of-paddle: min(var(--ball-position-y), var(--ping-position) + var(--paddle-height));
}

@container style(--int-ball-position-x: var(--ball-left-boundary)) {
  .screen {
    --lives-decrement: running;
      
    .field {
      background: red;
    }
  }
}

@container style(--min-ball-position-y-and-top-of-paddle: var(--ping-position)) and style(--min-ball-position-y-and-bottom-of-paddle: var(--ball-position-y)) and style(--int-ball-position-x: var(--ball-left-boundary)) {
  .screen {
    --lives-decrement: paused;

    .field {
      background: green;
    }
  }
}

Responding to collisions

Now that we can style our playing field based on whether the paddle hits the ball, we want to decrement the life counter if our paddle misses the ball, and display “Game Over” when we run out of lives. One way to achieve side effects in CSS is by pausing and unpausing keyframe animations that run forwards. These days, we can style things based on custom properties, which we can set in animations. Using this fact, we can take the power of paused animations to another level.


body {
  animation: ball 8s infinite linear, lives 80ms forwards steps(4) var(--lives-decrement);
  --lives-decrement: paused;        
}

.lives::after {
   content: var(--lives);
}

@keyframes lives {
  0% {
    --lives: "3";
  }
  25% {
    --lives: "2";
  }
  75% {
    --lives: "1";
  }
  100% {
    --lives: "0";
  }
}

@container style(--int-ball-position-x: var(--ball-left-boundary)) {
  .screen {
    --lives-decrement: running;
      
    .field {
      background: red;
    }
  }
}

@container style(--min-ball-position-y-and-top-of-paddle: var(--ping-position)) and style(--min-ball-position-y-and-bottom-of-paddle: var(--ball-position-y)) and style(--int-ball-position-x: 8) {
  .screen {
    --lives-decrement: paused;
    
    .field {
      background: green;
    }
  }
}

@container style(--lives: '0') {
  .field {
     display: none;
  }
  
  .game-over {
     display: flex;
  }
}

So when the ball hits the wall and isn’t in range of the paddle, the lives-decrementing animation is unpaused long enough to let it complete one step. Once it reaches zero we hide the play field and display the “Game Over” screen. What’s fascinating about this part of the experiment is that it shows that, using style queries, all properties become indirectly possible to control via animations, even when working with non-animatable properties. And this applies to properties that control whether other animations play. This article touches on why play state deliberately isn’t animatable and could be dangerous to animate, but we know what we are doing, right?

Full disclosure: The play state approach did lead to hidden complexity in the choice of duration of the animations. I knew that if I chose too long a duration for the life-decrementing counter, it might not have time to proceed to the next step while the ball was hitting the wall, but if I chose too short a duration, missing the ball once might cause the player to lose more than one life.

I made educated guesses of suitable durations for the ball bouncing and life decrementing, and I expected that when working with fixed-duration predictable animations, the life counter would either always work or always fail. I didn’t expect that my first attempt at the implementation intermittently failed to decrement the life counter at the same point in the animation loop. Setting the durations of both these related animations to multiples of eight seems to fix the problem, but why would predetermined animations exhibit unpredictable behavior?

Forefeit the game before somebody else takes you out of the frame

I have theories as to why the unpredictability of the collision detection seemed to be fixed by setting the ball animation to eight seconds and the lives animation to 80 milliseconds. Again, pushing CSS to its limits forces us to think deeper about how it’s working.

  1. CSS appears to suffer from timer drift, meaning if you set a keyframes animation to last for one second, it will sometimes take slightly under or over one second. When there is a different rate of change between the ball-bouncing and life-losing, it would make sense that the potential discrepancy between the two would be pronounced and lead to unpredictable collision detection. When the rate of change in both animations is the same, they would suffer about equally from timer drift, meaning the frames still synchronize predictably. Or at least I’m hoping the chance they don’t becomes negligible.
  2. Alex’s 2013 version of Pong uses translate3d() to move the ball even though it only moves in 2D. Alex recommends this whenever possible “for efficient animation rendering, offloading processing to the GPU for smoother visual effects.” Doing this may have been an alternative fix if it leads to more precise animation timing. There are tradeoffs so I wasn’t willing to go down that rabbit hole of trying to tune the animation performance in this article — but it could be an interesting focus for future research into CSS collision detection.
  3. Maybe style queries take a varying amount of time to kick in, leading to some form of a race condition. It is possible that making the ball-bouncing animation slower made this problem less likely.
  4. Maybe the bug remains lurking in the shadows somewhere. What did I expect from a hack I achieved using a magic token from a spooky shopkeeper? Haven’t I seen any eighties movie ever?

Outro

You finish reading the article, and feel sure that the author’s rationale for his supposed fix for the bug is hogwash. Clearly, Lee has been driven insane by the allure of overpowering new CSS features, whereas you respect the power of CSS, but you also respect its limitations. You sit down to spend a few minutes with the collision detection CodePen to prove it is still broken, but then find other flaws in the collision detection, and you commence work on a fork that will be superior. Hey, speaking of timer drift, how is it suddenly 1 a.m.? Only a crazy person would stay up that late playing with CSS when they have to work the next day. “Madness,” repeats the spooky shopkeeper inside your head, and his laughter echoes somewhere in the night.

Roll the credits

This looping Pong CSS animation by Manuel Schaller gave me an amazing basis for adding the collision detection. His twitching paddle animations help give the illusion of playing against a computer opponent, so forking his CodePen let me focus on implementing the collision detection rather than reinventing Pong.

This author is grateful to the junior testing team, comprised of his seven-year-old and twelve-year-old, who declared the CSS Pong implementation “pretty cool.” They also suggested the green and red flashes to signal collisions and misses.

The intro and outro for this article were sponsored by the spooky shopkeeper who sells dangerous CSS tricks. He also sells frozen yoghurt, which he calls froghurt.


Worlds Collide: Keyframe Collision Detection Using Style Queries originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

ChatPDF

by: aiparabellum.com
Mon, 31 Mar 2025 09:26:18 +0000


Welcome to the revolutionary world of ChatPDF, a cutting-edge tool that transforms the way you interact with any PDF document. Designed to cater to students, researchers, and professionals alike, ChatPDF leverages powerful AI technology to make understanding and navigating through complex PDFs as easy as having a conversation. Whether it’s a challenging academic paper, a detailed legal contract, or a technical manual, ChatPDF allows you to ask questions directly and get answers instantly.

Features

ChatPDF boasts a range of features that make it an indispensable tool for anyone dealing with PDF documents:

  1. AI-Powered Understanding: Simply upload your PDF and start chatting with it as you would with a human expert.
  2. Multi-File Chats: Organize your PDFs into folders and interact with multiple documents in a single conversation for comparative analysis and more comprehensive insights.
  3. Cited Sources: Every answer provided by ChatPDF includes references to the source location in the original document, ensuring you can verify and explore the context further.
  4. Any Language Capability: ChatPDF supports PDFs in any language, making it a globally accessible tool that breaks down language barriers.
  5. User-Friendly Interface: Easy to navigate interface allows for straightforward uploading and interaction with documents.

How It Works

Engaging with ChatPDF is a straightforward process:

  1. Upload Your PDF: Drag and drop your PDF file into the ChatPDF platform.
  2. Ask Questions: Once your PDF is uploaded, simply type in your questions to start the conversation.
  3. Receive Answers: ChatPDF quickly analyzes the content and provides you with answers and summaries directly from the text.

Benefits

Using ChatPDF provides numerous advantages:

  1. Enhanced Productivity: Saves time by providing quick answers to specific questions without the need for manual searching.
  2. Improved Research Efficiency: Ideal for researchers and students who need to extract information and gather insights from lengthy documents.
  3. Accessibility: Makes information more accessible for non-native speakers and professionals dealing with foreign language documents.
  4. Educational Support: Assists students in studying for exams and understanding complex topics effortlessly.
  5. Professional Aid: Helps professionals in understanding and navigating through dense and intricate documents like contracts and reports.

Pricing

ChatPDF offers its services under a freemium model:

  • Free Version: Users can enjoy basic features without any cost, suitable for casual or light users.
  • Premium Version: Advanced features and capabilities are available for a subscription fee, details of which can be found directly on the ChatPDF website.

Review

ChatPDF has received widespread acclaim for its innovative approach to handling PDF documents. Users around the globe praise the tool for its ability to simplify complex information and make educational and professional materials more accessible. The ease of use and the ability to interact with documents in any language are frequently highlighted as some of the app’s strongest points.

Conclusion

In conclusion, ChatPDF represents a significant advancement in how individuals interact with PDF documents. By combining AI technology with a user-friendly interface, it offers a unique solution that enhances learning, research, and professional activities. Whether you are a student, a researcher, or a professional, ChatPDF provides a powerful tool to streamline your workflow and improve your understanding of complex documents.

The post ChatPDF appeared first on AI Parabellum • Your Go-To AI Tools Directory for Success.

by: aiparabellum.com
Sat, 29 Mar 2025 15:52:47 +0000


The last few decades have witnessed a remarkable evolution in the field of computing power. From the early days of room-sized computers with minimal processing capabilities to the modern era of pocket-sized devices with immense computational power, the progress has been exponential. This exponential growth in computing power is often attributed to Moore’s Law, a principle that has shaped the technology industry for over five decades. Understanding Moore’s Law is crucial in comprehending the rapid advancements in computing and predicting the future of this ever-evolving field.

Understanding Moore’s Law: Definition and Origin

Moore’s Law, formulated by Gordon Moore, one of the founders of Intel, is a principle that states the number of transistors on a microchip doubles approximately every two years, while the cost is halved. This law has been a driving force behind the rapid advancement of technology, as it sets the pace for the development of faster, smaller, and more efficient electronic devices. Moore initially observed this trend in 1965, and his prediction has held remarkably true for several decades, guiding the industry in its pursuit of ever-increasing computing power.

The Mathematical Equation Behind Moore’s Law

While Moore’s Law is often discussed in terms of its observations and implications, there is also a mathematical equation that underlies this phenomenon. The equation that describes Moore’s Law can be expressed as follows: N = N₀ * 2^(t/T), where N represents the number of transistors on a microchip at a given time, N₀ is the initial number of transistors, t is the time elapsed, and T is the doubling time. This equation demonstrates the exponential growth of transistors on a chip, as the number of transistors doubles every T years. It provides a quantitative understanding of the rapid advancement of computing power and allows for predictions about future technological developments.

An Exploration of Technology Scaling and Transistors

To comprehend the implications of Moore’s Law, it is essential to delve into the concepts of technology scaling and transistors. Technology scaling refers to the process of shrinking the size of transistors on a microchip, allowing for more transistors to be packed into the same space. This scaling leads to increased computational power and improved performance, as smaller transistors enable faster switching speeds and reduced power consumption. Transistors, the fundamental building blocks of electronic devices, are responsible for controlling the flow of electrical current within a circuit. As the number of transistors increases, more complex computations can be performed, leading to enhanced processing capabilities and the ability to handle more data. The continuous advancement in the scaling of transistors has been a crucial factor in the exponential growth of computing power.

Implications of Moore’s Law on Computing Industry

The impact of Moore’s Law on the computing industry cannot be overstated. It has provided a roadmap for technological progress, shaping the strategies and investments of companies in the development of new products. The doubling of transistors every two years has led to the creation of smaller and more powerful electronic devices, such as smartphones, laptops, and high-performance computing systems. This increased computing power has revolutionized various sectors, including healthcare, finance, education, and entertainment, enabling the development of innovative applications and solutions. Moore’s Law has also driven competition among technology companies, as they strive to stay ahead by constantly improving their products and pushing the boundaries of computing power.

Challenges to the Continuation of Moore’s Law

Despite its remarkable track record, Moore’s Law is facing challenges that threaten its continuation. One of the major obstacles is the physical limitations of semiconductor technology. As transistors become increasingly small, quantum effects and other physical phenomena start to affect their performance. Additionally, the cost of research and development required to keep up with Moore’s Law is escalating, making it more difficult for companies to invest in new technologies. The limitations of traditional silicon-based technology and the increasing complexity of chip manufacturing pose significant hurdles to sustaining the historical rate of progress. Overcoming these challenges will require innovations in materials, manufacturing techniques, and alternative computing architectures.

Alternatives to Moore’s Law: Post-Moore Computing

As the limitations of Moore’s Law become more apparent, researchers are exploring alternative approaches to continue the trend of increasing computing power. Post-Moore Computing encompasses a range of technologies and concepts that aim to overcome the physical limitations of traditional transistor scaling. This includes innovations such as new materials like graphene and carbon nanotubes, novel computing architectures like neuromorphic and quantum computing, and advancements in software optimization techniques. These alternative paths offer the potential for continued progress in computing power beyond the limitations of Moore’s Law. While these technologies are still in their early stages, they hold the promise of ushering in a new era of computing and enabling further advancements in various fields.

The Future of Computing Power

The future of computing power is both exciting and uncertain. While the challenges to sustaining Moore’s Law are significant, the industry is continuously pushing the boundaries of technology to find new solutions. Whether through advancements in traditional semiconductor technology or the adoption of post-Moore computing paradigms, the quest for greater computing power will likely persist. The evolution of computing power has transformed the world we live in, and it will continue to shape our lives in ways we cannot yet fully comprehend. As we embark on this journey into the future, one thing is certain: the law of computing power will remain a driving force behind technological progress for years to come.

The post The Law of Computing Power: Moore’s Law appeared first on AI Parabellum • Your Go-To AI Tools Directory for Success.

by: Frederik Dohr
Fri, 28 Mar 2025 15:04:24 +0000


Comparing visual artifacts can be a powerful, if fickle, approach to automated testing. Playwright makes this seem simple for websites, but the details might take a little finessing.

Recent downtime prompted me to scratch an itch that had been plaguing me for a while: The style sheet of a website I maintain has grown just a little unwieldy as we’ve been adding code while exploring new features. Now that we have a better idea of the requirements, it’s time for internal CSS refactoring to pay down some of our technical debt, taking advantage of modern CSS features (like using CSS nesting for more obvious structure). More importantly, a cleaner foundation should make it easier to introduce that dark mode feature we’re sorely lacking so we can finally respect users’ preferred color scheme.

However, being of the apprehensive persuasion, I was reluctant to make large changes for fear of unwittingly introducing bugs. I needed something to guard against visual regressions while refactoring — except that means snapshot testing, which is notoriously slow and brittle.

In this context, snapshot testing means taking screenshots to establish a reliable baseline against which we can compare future results. As we’ll see, those artifacts are influenced by a multitude of factors that might not always be fully controllable (e.g. timing, variable hardware resources, or randomized content). We also have to maintain state between test runs, i.e. save those screenshots, which complicates the setup and means our test code alone doesn’t fully describe expectations.

Having procrastinated without a more agreeable solution revealing itself, I finally set out to create what I assumed would be a quick spike. After all, this wouldn’t be part of the regular test suite; just a one-off utility for this particular refactoring task.

Fortunately, I had vague recollections of past research and quickly rediscovered Playwright’s built-in visual comparison feature. Because I try to select dependencies carefully, I was glad to see that Playwright seems not to rely on many external packages.

Setup

The recommended setup with npm init playwright@latest does a decent job, but my minimalist taste had me set everything up from scratch instead. This do-it-yourself approach also helped me understand how the different pieces fit together.

Given that I expect snapshot testing to only be used on rare occasions, I wanted to isolate everything in a dedicated subdirectory, called test/visual; that will be our working directory from here on out. We’ll start with package.json to declare our dependencies, adding a few helper scripts (spoiler!) while we’re at it:

{
  "scripts": {
    "test": "playwright test",
    "report": "playwright show-report",
    "update": "playwright test --update-snapshots",
    "reset": "rm -r ./playwright-report ./test-results ./viz.test.js-snapshots || true"
  },
  "devDependencies": {
    "@playwright/test": "^1.49.1"
  }
}

If you don’t want node_modules hidden in some subdirectory but also don’t want to burden the root project with this rarely-used dependency, you might resort to manually invoking npm install --no-save @playwright/test in the root directory when needed.

With that in place, npm install downloads Playwright. Afterwards, npx playwright install downloads a range of headless browsers. (We’ll use npm here, but you might prefer a different package manager and task runner.)

We define our test environment via playwright.config.js with about a dozen basic Playwright settings:

import { defineConfig, devices } from "@playwright/test";

let BROWSERS = ["Desktop Firefox", "Desktop Chrome", "Desktop Safari"];
let BASE_URL = "http://localhost:8000";
let SERVER = "cd ../../dist && python3 -m http.server";

let IS_CI = !!process.env.CI;

export default defineConfig({
  testDir: "./",
  fullyParallel: true,
  forbidOnly: IS_CI,
  retries: 2,
  workers: IS_CI ? 1 : undefined,
  reporter: "html",
  webServer: {
    command: SERVER,
    url: BASE_URL,
    reuseExistingServer: !IS_CI
  },
  use: {
    baseURL: BASE_URL,
    trace: "on-first-retry"
  },
  projects: BROWSERS.map(ua => ({
    name: ua.toLowerCase().replaceAll(" ", "-"),
    use: { ...devices[ua] }
  }))
});

Here we expect our static website to already reside within the root directory’s dist folder and to be served at localhost:8000 (see SERVER; I prefer Python there because it’s widely available). I’ve included multiple browsers for illustration purposes. Still, we might reduce that number to speed things up (thus our simple BROWSERS list, which we then map to Playwright’s more elaborate projects data structure). Similarly, continuous integration is YAGNI for my particular scenario, so that whole IS_CI dance could be discarded.

Capture and compare

Let’s turn to the actual tests, starting with a minimal sample.test.js file:

import { test, expect } from "@playwright/test";

test("home page", async ({ page }) => {
  await page.goto("/");
  await expect(page).toHaveScreenshot();
});

npm test executes this little test suite (based on file-name conventions). The initial run always fails because it first needs to create baseline snapshots against which subsequent runs compare their results. Invoking npm test once more should report a passing test.

Changing our site, e.g. by recklessly messing with build artifacts in dist, should make the test fail again. Such failures will offer various options to compare expected and actual visuals:

Failing test with slightly different screenshots side by side

We can also inspect those baseline snapshots directly: Playwright creates a folder for screenshots named after the test file (sample.test.js-snapshots in this case), with file names derived from the respective test’s title (e.g. home-page-desktop-firefox.png).

Generating tests

Getting back to our original motivation, what we want is a test for every page. Instead of arduously writing and maintaining repetitive tests, we’ll create a simple web crawler for our website and have tests generated automatically; one for each URL we’ve identified.

Playwright’s global setup enables us to perform preparatory work before test discovery begins: Determine those URLs and write them to a file. Afterward, we can dynamically generate our tests at runtime.

While there are other ways to pass data between the setup and test-discovery phases, having a file on disk makes it easy to modify the list of URLs before test runs (e.g. temporarily ignoring irrelevant pages).

Site map

The first step is to extend playwright.config.js by inserting globalSetup and exporting two of our configuration values:

export let BROWSERS = ["Desktop Firefox", "Desktop Chrome", "Desktop Safari"];
export let BASE_URL = "http://localhost:8000";

// etc.

export default defineConfig({
  // etc.
  globalSetup: require.resolve("./setup.js")
});

Although we’re using ES modules here, we can still rely on CommonJS-specific APIs like require.resolve and __dirname. It appears there’s some Babel transpilation happening in the background, so what’s actually being executed is probably CommonJS? Such nuances sometimes confuse me because it isn’t always obvious what’s being executed where.

We can now reuse those exported values within a newly created setup.js, which spins up a headless browser to crawl our site (just because that’s easier here than using a separate HTML parser):

import { BASE_URL, BROWSERS } from "./playwright.config.js";
import { createSiteMap, readSiteMap } from "./sitemap.js";
import playwright from "@playwright/test";

export default async function globalSetup(config) {
  // only create site map if it doesn't already exist
  try {
    readSiteMap();
    return;
  } catch(err) {}

  // launch browser and initiate crawler
  let browser = playwright.devices[BROWSERS[0]].defaultBrowserType;
  browser = await playwright[browser].launch();
  let page = await browser.newPage();
  await createSiteMap(BASE_URL, page);
  await browser.close();
}

This is fairly boring glue code; the actual crawling is happening within sitemap.js:

  • createSiteMap determines URLs and writes them to disk.
  • readSiteMap merely reads any previously created site map from disk. This will be our foundation for dynamically generating tests. (We’ll see later why this needs to be synchronous.)

Fortunately, the website in question provides a comprehensive index of all pages, so my crawler only needs to collect unique local URLs from that index page:

function extractLocalLinks(baseURL) {
  let urls = new Set();
  let offset = baseURL.length;
  for(let { href } of document.links) {
    if(href.startsWith(baseURL)) {
      let path = href.slice(offset);
      urls.add(path);
    }
  }
  return Array.from(urls);
}

Wrapping that in a more boring glue code gives us our sitemap.js:

import { readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";

let ENTRY_POINT = "/topics";
let SITEMAP = join(__dirname, "./sitemap.json");

export async function createSiteMap(baseURL, page) {
  await page.goto(baseURL + ENTRY_POINT);
  let urls = await page.evaluate(extractLocalLinks, baseURL);
  let data = JSON.stringify(urls, null, 4);
  writeFileSync(SITEMAP, data, { encoding: "utf-8" });
}

export function readSiteMap() {
  try {
    var data = readFileSync(SITEMAP, { encoding: "utf-8" });
  } catch(err) {
    if(err.code === "ENOENT") {
      throw new Error("missing site map");
    }
    throw err;
  }
  return JSON.parse(data);
}

function extractLocalLinks(baseURL) {
  // etc.
}

The interesting bit here is that extractLocalLinks is evaluated within the browser context — thus we can rely on DOM APIs, notably document.links — while the rest is executed within the Playwright environment (i.e. Node).

Tests

Now that we have our list of URLs, we basically just need a test file with a simple loop to dynamically generate corresponding tests:

for(let url of readSiteMap()) {
  test(`page at ${url}`, async ({ page }) => {
    await page.goto(url);
    await expect(page).toHaveScreenshot();
  });
}

This is why readSiteMap had to be synchronous above: Playwright doesn’t currently support top-level await within test files.

In practice, we’ll want better error reporting for when the site map doesn’t exist yet. Let’s call our actual test file viz.test.js:

import { readSiteMap } from "./sitemap.js";
import { test, expect } from "@playwright/test";

let sitemap = [];
try {
  sitemap = readSiteMap();
} catch(err) {
  test("site map", ({ page }) => {
    throw new Error("missing site map");
  });
}

for(let url of sitemap) {
  test(`page at ${url}`, async ({ page }) => {
    await page.goto(url);
    await expect(page).toHaveScreenshot();
  });
}

Getting here was a bit of a journey, but we’re pretty much done… unless we have to deal with reality, which typically takes a bit more tweaking.

Exceptions

Because visual testing is inherently flaky, we sometimes need to compensate via special casing. Playwright lets us inject custom CSS, which is often the easiest and most effective approach. Tweaking viz.test.js

// etc.
import { join } from "node:path";

let OPTIONS = {
  stylePath: join(__dirname, "./viz.tweaks.css")
};

// etc.
  await expect(page).toHaveScreenshot(OPTIONS);
// etc.

… allows us to define exceptions in viz.tweaks.css:

/* suppress state */
main a:visited {
  color: var(--color-link);
}

/* suppress randomness */
iframe[src$="/articles/signals-reactivity/demo.html"] {
  visibility: hidden;
}

/* suppress flakiness */
body:has(h1 a[href="/wip/unicode-symbols/"]) {
  main tbody > tr:last-child > td:first-child {
    font-size: 0;
    visibility: hidden;
  }
}

:has() strikes again!

Page vs. viewport

At this point, everything seemed hunky-dory to me, until I realized that my tests didn’t actually fail after I had changed some styling. That’s not good! What I hadn’t taken into account is that .toHaveScreenshot only captures the viewport rather than the entire page. We can rectify that by further extending playwright.config.js.

export let WIDTH = 800;
export let HEIGHT = WIDTH;

// etc.

  projects: BROWSERS.map(ua => ({
    name: ua.toLowerCase().replaceAll(" ", "-"),
    use: {
      ...devices[ua],
      viewport: {
        width: WIDTH,
        height: HEIGHT
      }
    }
  }))

…and then by adjusting viz.test.js‘s test-generating loop:

import { WIDTH, HEIGHT } from "./playwright.config.js";

// etc.

for(let url of sitemap) {
  test(`page at ${url}`, async ({ page }) => {
    checkSnapshot(url, page);
  });
}

async function checkSnapshot(url, page) {
  // determine page height with default viewport
  await page.setViewportSize({
    width: WIDTH,
    height: HEIGHT
  });
  await page.goto(url);
  await page.waitForLoadState("networkidle");
  let height = await page.evaluate(getFullHeight);

  // resize viewport for before snapshotting
  await page.setViewportSize({
    width: WIDTH,
    height: Math.ceil(height)
  });
  await page.waitForLoadState("networkidle");
  await expect(page).toHaveScreenshot(OPTIONS);
}

function getFullHeight() {
  return document.documentElement.getBoundingClientRect().height;
}

Note that we’ve also introduced a waiting condition, holding until there’s no network traffic for a while in a crude attempt to account for stuff like lazy-loading images.

Be aware that capturing the entire page is more resource-intensive and doesn’t always work reliably: You might have to deal with layout shifts or run into timeouts for long or asset-heavy pages. In other words: This risks exacerbating flakiness.

Conclusion

So much for that quick spike. While it took more effort than expected (I believe that’s called “software development”), this might actually solve my original problem now (not a common feature of software these days). Of course, shaving this yak still leaves me itchy, as I have yet to do the actual work of scratching CSS without breaking anything. Then comes the real challenge: Retrofitting dark mode to an existing website. I just might need more downtime.


Automated Visual Regression Testing With Playwright originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

GetImg

by: aiparabellum.com
Thu, 27 Mar 2025 15:20:44 +0000


Getimg.ai is an all-in-one AI creative toolkit designed to revolutionize the way you create and edit images. With the power of artificial intelligence, this platform allows users to generate images from text, edit photos with words, expand pictures beyond their borders, animate images, and even train custom AI models. Whether you are an artist, designer, or hobbyist, getimg.ai promises to unleash your imagination and bring your ideas to life with ease.

Features

Getimg.ai offers a suite of powerful AI tools aimed at enhancing creativity and simplifying the image creation process. Here are some of the key features:

  1. AI Generator:
    • Generate original images at scale from text prompts.
    • Utilize over 60 community-trained models or train your custom models.
  2. Image to Video:
    • Transform static images into 4-second video clips.
    • Enhance motion fluidity with AI technology.
  3. Image Editor:
    • Edit images quickly using various AI pipelines.
    • Use inpainting to modify details or remove unwanted objects.
  4. AI Canvas:
    • Create on an infinitely sized canvas.
    • Expand pictures beyond their original borders.
  5. Real-Time AI Generator:
    • Generate images instantly as you type prompts.
    • Switch between Photorealism, Art, and Anime styles.
  6. DreamBooth:
    • Create custom AI models with as few as 10 images.
    • Generate personalized avatars or product images.
  7. ControlNet:
    • Guide AI image generation using your source images.
    • Explore different ControlNet models for varied outputs.

How It Works

Using getimg.ai is simple and straightforward. Here’s how it works:

  1. Sign Up:
    • Create a free account on the getimg.ai platform.
  2. Select a Tool:
    • Choose from various tools like AI Generator, Image to Video, or AI Canvas.
  3. Input Prompt:
    • Type a text prompt or upload an image to start the creation process.
  4. Customize:
    • Use different models or styles to refine your output.
    • Edit images using inpainting or expand them with outpainting.
  5. Generate and Save:
    • Generate your final image or video.
    • Save it to your device or share it directly from the platform.

Benefits

Getimg.ai provides numerous benefits for users looking to enhance their creative workflows:

  • Ease of Use: The platform is designed for both beginners and professionals, making it easy to create stunning visuals.
  • Versatility: Supports a wide range of creative tasks, from image generation to video creation.
  • Speed: Real-time generation allows for instant visualization of ideas.
  • Customization: Train custom AI models tailored to your unique style or requirements.
  • Community Support: Leverage community-trained models and resources for enhanced creativity.

Pricing

Getimg.ai offers flexible pricing plans to suit different needs:

  • Free Plan: Access basic features with limited credits.
  • Pro Plan: Enhanced features with increased credit limits for frequent users.
  • Enterprise Plan: Custom solutions and unlimited access tailored for businesses.

Review

Users of getimg.ai have praised the platform for its intuitive interface and powerful AI capabilities. Many appreciate the seamless integration of various tools that allow for diverse creative outputs. The ability to generate images and videos quickly has been highlighted as a significant advantage. However, some users have noted that mastering the more advanced features may require some learning and experimentation.

Conclusion

Getimg.ai stands out as a comprehensive AI toolkit for anyone looking to elevate their image creation and editing capabilities. With its wide range of features, user-friendly interface, and the ability to generate high-quality visuals in seconds, it is a valuable resource for creatives of all levels. Whether you are looking to create art, design products, or simply experiment with new ideas, getimg.ai provides the tools and flexibility you need to bring your visions to life.

The post GetImg appeared first on AI Parabellum • Your Go-To AI Tools Directory for Success.

by: aiparabellum.com
Wed, 26 Mar 2025 09:03:39 +0000


The intersection of AI and micro SaaS (Software as a Service) presents countless opportunities for entrepreneurs. This collection features over 600 AI-powered micro SaaS ideas across 30+ categories, each with potential for focused, profitable businesses with low overhead and high scalability.

Whether you’re a solo developer, a small team, or an entrepreneur looking for your next venture, these ideas can serve as inspiration or direct blueprints for building valuable AI-powered services.

Explore 600+ AI Micro SaaS Ideas

Content Creation

AI-powered tools that help create, optimize, and manage various types of content.

AI Blog Post Generator
A tool that generates complete, SEO-optimized blog posts from a simple topic or outline. Includes title suggestions, headings, and calls to action.
Personalized Newsletter Creator
Automatically creates personalized newsletters based on user interests, engagement history, and trending topics in their industry.
Product Description Writer
Generates compelling product descriptions for e-commerce sites based on basic product information, features, and target audience.
AI Scriptwriter
Creates scripts for videos, podcasts, or presentations based on topic outlines, target audience, and desired tone.
Content Repurposer
Transforms existing content (blog posts, videos, podcasts) into multiple formats for different platforms automatically.
AI Press Release Generator
Creates professional press releases from key information about company announcements, product launches, or events.
Technical Documentation Assistant
Generates clear technical documentation from code, APIs, or product specifications with proper formatting and examples.
Case Study Builder
Transforms raw data and testimonials into structured, compelling case studies highlighting customer success stories.
AI Copywriting Assistant
Generates marketing copy for ads, landing pages, and emails based on product information and target audience.
Content Calendar Generator
Creates optimized content calendars based on industry trends, keyword research, and business goals.
Headline Optimizer
Generates and tests multiple headline variations to maximize click-through rates and engagement.
AI Storytelling Platform
Creates engaging stories for brands based on their values, history, and target audience.
FAQ Generator
Automatically creates comprehensive FAQ sections for websites based on product information and common customer questions.
Content Readability Enhancer
Analyzes and improves content readability, simplifying complex language while maintaining key information.
AI Whitepaper Creator
Generates professional whitepapers from research data, industry insights, and company expertise.
Personalized Content Recommender
Suggests personalized content topics based on audience interests, engagement patterns, and trending topics.
AI Proposal Writer
Creates customized business proposals based on client requirements, company services, and past successful proposals.
Content Localization Tool
Automatically adapts content for different regions, considering cultural nuances, local references, and language preferences.
AI Resume Builder
Creates tailored, ATS-optimized resumes based on job descriptions, user experience, and industry best practices.
Podcast Summary Generator
Automatically creates detailed show notes, summaries, and key takeaways from podcast episodes.

Marketing

AI solutions for marketing strategy, campaign management, and audience targeting.

AI Campaign Planner
Creates comprehensive marketing campaign plans based on business goals, target audience, and budget constraints.
Competitor Analysis Tool
Automatically analyzes competitors’ marketing strategies, content, and positioning to identify opportunities and threats.
AI Ad Copy Generator
Creates high-converting ad copy for different platforms (Google, Facebook, Instagram) based on product features and audience demographics.
Marketing ROI Predictor
Predicts potential ROI for different marketing channels and campaigns based on historical data and industry benchmarks.
Personalized Marketing Sequence Builder
Creates customized marketing sequences across multiple channels based on customer behavior and preferences.
AI Landing Page Optimizer
Analyzes and suggests improvements for landing pages to increase conversion rates based on best practices and A/B testing data.
Customer Persona Generator
Creates detailed customer personas from existing customer data, market research, and social media insights.
Marketing Calendar Automation
Generates and manages marketing calendars across channels, considering seasonal trends, events, and business goals.
AI Influencer Matcher
Identifies and ranks potential influencers based on brand alignment, audience demographics, and engagement metrics.
Marketing Trend Predictor
Analyzes industry data to predict upcoming marketing trends and opportunities before they become mainstream.
Automated A/B Test Designer
Creates and manages A/B tests for marketing materials, suggesting variables to test based on potential impact.
Customer Journey Mapper
Maps and visualizes customer journeys based on touchpoint data, identifying optimization opportunities and pain points.
Brand Voice Consistency Checker
Analyzes marketing content across channels to ensure consistent brand voice, tone, and messaging.
Marketing Budget Optimizer
Recommends optimal budget allocation across marketing channels based on performance data and business objectives.
Competitive Pricing Analyzer
Monitors competitor pricing and suggests optimal pricing strategies based on market positioning and value proposition.
AI Marketing Report Generator
Creates comprehensive marketing performance reports with insights, recommendations, and visualizations from raw data.
Seasonal Campaign Generator
Creates tailored marketing campaigns for holidays and seasonal events based on business type and target audience.
Customer Feedback Analyzer
Processes and categorizes customer feedback from multiple sources to identify trends and actionable insights for marketing.
Marketing Compliance Checker
Reviews marketing materials for compliance with regulations like GDPR, CCPA, and industry-specific requirements.
Cross-Promotion Opportunity Finder
Identifies potential cross-promotion and partnership opportunities with complementary brands and products.

SEO

Tools that help optimize website content and structure for better search engine rankings.

AI Keyword Research Tool
Identifies high-value keywords with optimal competition levels based on website authority and industry.
Content Gap Analyzer
Identifies content gaps by comparing your site with competitors and suggesting topics to cover.
SEO Content Optimizer
Analyzes and suggests improvements for existing content to better match search intent and ranking factors.
Automated Meta Description Generator
Creates optimized meta descriptions that improve click-through rates while maintaining keyword relevance.
Internal Linking Optimizer
Analyzes site structure and suggests optimal internal linking strategies to improve SEO and user experience.
SERP Feature Opportunity Finder
Identifies opportunities to capture featured snippets, knowledge panels, and other SERP features for target keywords.
AI Title Tag Optimizer
Generates and tests multiple title tag variations to maximize CTR and keyword relevance.
Schema Markup Generator
Automatically creates and implements appropriate schema markup based on page content and type.
Local SEO Automation Tool
Manages and optimizes local business listings, citations, and location-specific content across platforms.
SEO Competitor Benchmarking
Tracks competitor SEO performance and strategies, identifying opportunities to outrank them.
Content Freshness Analyzer
Identifies content that needs updating based on age, performance decline, and changing search trends.
AI-Powered SEO Audit Tool
Performs comprehensive SEO audits with prioritized recommendations based on potential impact.
Search Intent Analyzer
Analyzes search intent for target keywords and suggests content formats and structures to match.
E-A-T Signal Enhancer
Identifies opportunities to improve Expertise, Authoritativeness, and Trustworthiness signals on your website.
AI FAQ Generator for SEO
Creates SEO-optimized FAQ sections based on common questions and search queries related to your content.
Semantic SEO Content Enhancer
Suggests related concepts, entities, and terms to include in content for better semantic relevance.
Mobile SEO Optimizer
Analyzes and improves mobile-specific SEO factors like page speed, usability, and mobile-first indexing compliance.
Voice Search Optimizer
Optimizes content for voice search queries by identifying conversational keywords and question formats.
International SEO Manager
Manages hreflang tags, localized content, and international targeting for global websites.
AI SEO Forecasting Tool
Predicts potential traffic and ranking improvements from specific SEO changes based on historical data.

Social Media

AI tools for managing, optimizing, and analyzing social media presence and campaigns.

AI Social Media Content Generator
Creates platform-specific social media posts based on brand voice, target audience, and content strategy.
Hashtag Strategy Optimizer
Analyzes and suggests optimal hashtags for different platforms based on reach potential and relevance.
Social Media Sentiment Analyzer
Monitors brand mentions across platforms and analyzes sentiment trends and potential PR issues.
AI Caption Generator
Creates engaging captions for social media posts based on image content, brand voice, and platform best practices.
Optimal Posting Time Predictor
Analyzes audience activity patterns to recommend optimal posting times for maximum engagement.
Social Media Response Assistant
Generates appropriate responses to comments and messages based on sentiment and common questions.
Content Repurposing for Social
Automatically transforms long-form content into platform-optimized social media posts and graphics.
Social Media Contest Generator
Creates engaging social media contests and giveaways based on business goals and audience preferences.
Trending Topic Alerter
Identifies trending topics relevant to your industry and suggests ways to join the conversation.
Social Media Ad Copy Generator
Creates platform-specific ad copy variations optimized for different campaign objectives.
Competitor Social Analysis
Analyzes competitors’ social media strategies, identifying successful tactics and content gaps.
Social Media Calendar Generator
Creates balanced content calendars across platforms based on content pillars and business goals.
Engagement Rate Optimizer
Analyzes past post performance and suggests content adjustments to improve engagement rates.
Social Media Bio Optimizer
Creates and tests optimized social media bios that improve discoverability and conversions.
Social Media Crisis Manager
Detects potential PR issues on social media and suggests appropriate response strategies.
UGC Content Curator
Identifies and organizes high-quality user-generated content for repurposing on brand channels.
Social Media Audience Analyzer
Creates detailed audience insights reports from social media data, identifying key demographics and interests.
Social Media Story Generator
Creates engaging story content for Instagram, Facebook, and other platforms with interactive elements.
Social Media ROI Calculator
Tracks and attributes conversions and revenue to specific social media campaigns and content.
Social Media Compliance Checker
Reviews social media content for compliance with platform policies, regulations, and brand guidelines.

Email

AI-powered solutions for email marketing, automation, and personalization.

AI Email Subject Line Generator
Creates high-converting email subject lines based on campaign goals, audience, and content.
Personalized Email Content Generator
Creates dynamically personalized email content based on recipient behavior, preferences, and segment.
Email Sequence Builder
Designs optimized email sequences for different goals (onboarding, nurturing, re-engagement) based on best practices.
Send Time Optimizer
Predicts the optimal send time for each recipient based on their past open and engagement patterns.
Email A/B Test Generator
Creates and manages A/B tests for email campaigns, suggesting variables with highest potential impact.
Email Deliverability Optimizer
Analyzes and improves email content to avoid spam filters and improve inbox placement.
AI Email Response Generator
Creates personalized responses to common customer emails based on query type and customer history.
Email List Segmentation Tool
Automatically segments email lists based on behavior patterns, engagement levels, and demographic data.
Email Content Readability Optimizer
Analyzes and improves email content readability, ensuring it’s optimized for different devices and audiences.
Abandoned Cart Email Generator
Creates personalized abandoned cart recovery emails based on products, customer history, and effective incentives.
Email Newsletter Curator
Automatically curates personalized newsletter content based on recipient interests and engagement history.
Email Campaign ROI Predictor
Predicts potential ROI for email campaigns based on historical performance and industry benchmarks.
Email Tone and Voice Analyzer
Ensures email content matches brand voice and appropriate tone for different types of communications.
Re-engagement Campaign Generator
Creates targeted re-engagement campaigns for inactive subscribers based on their past behavior.
Email Preheader Optimizer
Generates effective preheader text that complements subject lines and improves open rates.
Email CTA Optimizer
Tests and suggests optimal call-to-action text, placement, and design for different email types.
Email Performance Analyzer
Creates detailed performance reports with actionable insights to improve future campaigns.
Email Compliance Checker
Ensures email campaigns comply with regulations like GDPR, CAN-SPAM, and CCPA before sending.
Predictive Email Churn Analyzer
Identifies subscribers at risk of unsubscribing and suggests retention strategies.
Email Design Template Generator
Creates responsive email templates optimized for different campaign types and objectives.

Customer Support

AI tools that enhance customer service operations and improve support experiences.

AI Customer Support Chatbot
Handles common customer inquiries and troubleshooting, escalating complex issues to human agents.
Support Ticket Categorizer
Automatically categorizes and prioritizes support tickets based on content, urgency, and customer tier.
Customer Sentiment Analyzer
Analyzes customer communications to identify sentiment and potential escalation needs in real-time.
AI Response Suggestion Tool
Suggests appropriate responses to customer inquiries based on past successful interactions.
Support Knowledge Base Generator
Creates and maintains comprehensive knowledge base articles from support interactions and product documentation.
Customer Satisfaction Predictor
Predicts customer satisfaction outcomes based on interaction patterns and suggests improvement strategies.
Support Agent Coaching Tool
Analyzes support interactions and provides real-time coaching suggestions to improve agent performance.
Customer Issue Predictor
Identifies potential customer issues before they occur based on usage patterns and proactively suggests solutions.
Support Conversation Summarizer
Creates concise summaries of customer support interactions for internal documentation and handoffs.
Multilingual Support Assistant
Provides real-time translation and cultural context for support agents handling international customers.
Support Quality Assurance Tool
Automatically reviews support interactions for compliance with quality standards and company policies.
Customer Effort Score Optimizer
Analyzes customer journeys to identify high-effort touchpoints and suggests ways to reduce friction.
Support Ticket Routing Optimizer
Routes tickets to the most appropriate agent based on expertise, workload, and customer history.
Voice of Customer Analyzer
Aggregates and analyzes customer feedback across channels to identify trends and improvement opportunities.
Support Macros Generator
Creates personalized response templates for common support scenarios that agents can quickly customize.
Customer Churn Risk Detector
Identifies customers at risk of churning based on support interactions and suggests retention strategies.
Support Performance Dashboard
Creates real-time visualizations of support metrics with AI-powered insights and recommendations.
Customer Feedback Categorizer
Automatically categorizes and prioritizes customer feedback for product and service improvements.
Support SLA Compliance Monitor
Tracks support SLAs in real-time and alerts teams when tickets are at risk of breaching agreements.
Customer Support Chatbot Builder
Allows non-technical users to build and deploy custom support chatbots without coding knowledge.

Education

AI tools for learning, teaching, and educational content creation.

Personalized Learning Path Generator
Creates customized learning paths based on student knowledge gaps, learning style, and educational goals.
AI Essay Grader
Automatically evaluates essays for structure, content, grammar, and provides detailed feedback for improvement.
Concept Explanation Generator
Creates multiple explanations of complex concepts tailored to different learning levels and styles.
Quiz and Assessment Creator
Generates customized quizzes and assessments based on learning materials with varying difficulty levels.
Study Note Generator
Creates comprehensive study notes from textbooks, lectures, or course materials with key points highlighted.
Language Learning Assistant
Provides personalized language learning exercises, conversation practice, and pronunciation feedback.
Math Problem Solver with Steps
Solves math problems and shows detailed step-by-step explanations to help students understand the process.
Curriculum Designer
Creates comprehensive curriculum plans aligned with educational standards for different subjects and grade levels.
Educational Video Script Generator
Creates engaging scripts for educational videos based on learning objectives and target audience.
Student Engagement Predictor
Analyzes student interaction patterns to predict engagement levels and suggest intervention strategies.
Research Paper Assistant
Helps with research paper structure, citations, and provides feedback on academic writing style.
Adaptive Flashcard Generator
Creates personalized flashcards that adapt to student performance, focusing on areas needing improvement.
Plagiarism Detection and Rewriting Assistant
Identifies potential plagiarism and suggests ways to properly cite or rephrase content.
Virtual Lab Simulation Creator
Generates interactive virtual lab simulations for science education with customizable parameters.
Parent-Teacher Communication Assistant
Helps teachers create personalized, constructive updates for parents about student progress.
Educational Game Generator
Creates educational games and activities based on curriculum content and learning objectives.
Student Progress Analyzer
Tracks and visualizes student progress over time, identifying patterns and suggesting interventions.
Lesson Plan Generator
Creates detailed lesson plans based on learning objectives, available resources, and teaching style.
Accessibility Adapter for Educational Content
Adapts educational materials for students with different accessibility needs and learning disabilities.
Peer Learning Matchmaker
Pairs students for peer learning based on complementary strengths, weaknesses, and learning styles.

Productivity

AI tools that enhance personal and team productivity and workflow efficiency.

AI Meeting Summarizer
Automatically creates concise summaries of meetings with action items, decisions, and key discussion points.
Smart Task Prioritizer
Analyzes tasks and automatically prioritizes them based on deadlines, importance, and dependencies.
AI Calendar Optimizer
Suggests optimal scheduling for meetings and tasks based on productivity patterns and preferences.
Document Summarization Tool
Creates concise summaries of long documents, highlighting key information and main points.
Email Triage Assistant
Automatically categorizes and prioritizes emails, suggesting which ones need immediate attention.
Focus Time Scheduler
Analyzes calendar and work patterns to suggest optimal times for deep work and focused sessions.
Project Timeline Generator
Creates realistic project timelines based on task complexity, team capacity, and historical data.
Meeting Agenda Creator
Generates structured meeting agendas based on participants, previous discussions, and project status.
Workflow Automation Builder
Helps non-technical users create custom workflow automations through a simple interface.
Decision Support System
Helps analyze options for complex decisions by weighing factors, risks, and potential outcomes.
Team Collaboration Analyzer
Analyzes team communication patterns and suggests improvements for more effective collaboration.
Smart Note-Taking Assistant
Enhances notes with related information, organizes them automatically, and makes them searchable.
Distraction Blocker and Focus Coach
Identifies distraction patterns and provides personalized strategies to maintain focus.
Knowledge Base Organizer
Automatically organizes and connects company knowledge for easier discovery and utilization.
Personal Development Planner
Creates personalized skill development plans based on career goals and current capabilities.
Team Capacity Planner
Analyzes team workload and suggests optimal task distribution to prevent burnout and bottlenecks.
Process Optimization Advisor
Analyzes business processes and suggests improvements to increase efficiency and reduce waste.
Smart Document Template Generator
Creates customized document templates based on company needs and industry best practices.
Habit Formation Assistant
Helps users build productive habits through personalized strategies, reminders, and progress tracking.
Information Overload Manager
Filters and prioritizes information from multiple sources to prevent overwhelm and highlight what matters.

Finance

AI tools for financial analysis, planning, and management.

AI Financial Advisor
Provides personalized financial advice based on user goals, risk tolerance, and financial situation.
Investment Portfolio Optimizer
Creates and manages optimized investment portfolios based on market conditions and user preferences.
Fraud Detection System
Detects fraudulent transactions and activities in real-time based on pattern analysis and anomaly detection.
Budgeting and Expense Tracker
Automatically tracks income and expenses, providing insights and recommendations for better budgeting.
Tax Optimization Assistant
Identifies potential tax deductions and credits, helping users minimize their tax liability.
Financial Forecasting Tool
Predicts future financial performance based on historical data, market trends, and business plans.
Credit Risk Assessor
Assesses credit risk for loan applications and other financial transactions based on applicant data.
Automated Invoice Generator
Creates and sends professional invoices automatically, tracking payments and sending reminders.
Financial Report Generator
Creates comprehensive financial reports with visualizations and insights from raw data.
Personal Loan Advisor
Provides personalized recommendations for personal loans based on user needs and creditworthiness.
Stock Market Analyzer
Analyzes stock market data to identify potential investment opportunities and risks.
Cryptocurrency Trading Assistant
Provides automated trading signals and portfolio management for cryptocurrency investments.
Financial Document Classifier
Automatically categorizes and organizes financial documents for easier management and analysis.
Insurance Policy Advisor
Provides personalized recommendations for insurance policies based on user needs and risk profile.
Retirement Planning Assistant
Creates personalized retirement plans based on user goals, savings, and investment strategies.
Financial Goal Tracker
Tracks progress towards financial goals, providing insights and recommendations for improvement.
Automated Bookkeeping System
Automates bookkeeping tasks, tracking transactions and generating financial statements.
Financial Risk Manager
Identifies and manages financial risks, providing recommendations for mitigation and hedging.
Investment Research Tool
Provides in-depth research and analysis on potential investment opportunities.
Financial Literacy Tutor
Provides personalized financial literacy education and guidance.

HR & Recruitment

AI tools for human resources management and recruitment processes.

AI Resume Screener
Automatically screens resumes based on job requirements, identifying qualified candidates.
Candidate Sourcing Tool
Identifies potential candidates from various sources based on job requirements and skills.
Interview Scheduling Assistant
Automates the interview scheduling process, coordinating with candidates and interviewers.
Employee Onboarding Assistant
Automates the employee onboarding process, providing new hires with necessary information and resources.
Performance Management System
Tracks employee performance, providing feedback and recommendations for improvement.
Employee Engagement Analyzer
Analyzes employee engagement levels, identifying potential issues and recommending solutions.
HR Policy Generator
Creates customized HR policies based on company size, industry, and legal requirements.
Employee Training Recommender
Recommends personalized training programs based on employee skills and career goals.
Compensation Benchmarking Tool
Compares employee compensation with industry benchmarks, identifying potential pay gaps.
Employee Turnover Predictor
Predicts employee turnover risk, identifying potential issues and recommending retention strategies.
Automated Job Description Writer
Creates compelling job descriptions based on job requirements and company culture.
Background Check Automation
Automates the background check process, verifying candidate information and identifying potential risks.
Employee Benefits Advisor
Provides personalized recommendations for employee benefits based on individual needs and preferences.
HR Compliance Checker
Ensures HR practices comply with relevant laws and regulations.
Employee Survey Analyzer
Analyzes employee survey data, identifying trends and recommending improvements.
Automated Reference Checker
Automates the reference checking process, verifying candidate information and gathering feedback.
HR Data Visualization Tool
Creates visualizations of HR data, providing insights and recommendations for improvement.
Employee Grievance Analyzer
Analyzes employee grievances, identifying potential issues and recommending solutions.
Automated Exit Interview System
Automates the exit interview process, gathering feedback from departing employees.
HR Chatbot for Employee Inquiries
Provides answers to common employee inquiries, freeing up HR staff for more complex tasks.

Healthcare

AI tools for healthcare diagnostics, treatment, and patient management.

AI Medical Image Analyzer
Analyzes medical images (X-rays, MRIs, CT scans) to detect anomalies and assist in diagnosis.
Personalized Treatment Planner
Creates personalized treatment plans based on patient data, medical history, and genetic information.
Drug Discovery Assistant
Accelerates the drug discovery process by identifying potential drug candidates and predicting their effectiveness.
Remote Patient Monitoring System
Monitors patient vital signs remotely, alerting healthcare providers to potential issues.
Medical Diagnosis Chatbot
Provides preliminary medical diagnoses based on patient symptoms and medical history.
Predictive Healthcare Analytics
Predicts patient health outcomes based on historical data, identifying potential risks and recommending preventative measures.
Medical Transcription Assistant
Transcribes medical dictation automatically, reducing the workload for medical transcriptionists.
Healthcare Fraud Detection System
Detects fraudulent claims and activities in healthcare billing and insurance.
Personalized Medication Reminder
Provides personalized medication reminders to patients, improving medication adherence.
Clinical Trial Matching Tool
Matches patients with relevant clinical trials based on their medical condition and eligibility criteria.
Medical Literature Summarizer
Summarizes medical literature automatically, providing healthcare providers with concise information.
Healthcare Workflow Optimizer
Optimizes healthcare workflows, improving efficiency and reducing costs.
Medical Device Maintenance Predictor
Predicts medical device maintenance needs, preventing downtime and improving reliability.
Healthcare Supply Chain Optimizer
Optimizes healthcare supply chains, reducing costs and improving efficiency.
Personalized Health Coach
Provides personalized health coaching based on user goals, lifestyle, and medical conditions.
Medical Record Analyzer
Analyzes medical records to identify potential issues and improve patient care.
Healthcare Cybersecurity Monitor
Monitors healthcare systems for cybersecurity threats, protecting patient data and preventing breaches.
Automated Medical Billing System
Automates medical billing processes, reducing errors and improving efficiency.
Healthcare Language Translator
Provides real-time translation for healthcare providers and patients who speak different languages.
AI-Powered Triage System
Prioritizes patients in emergency rooms based on the severity of their condition.

Real Estate

AI tools for real estate valuation, property management, and investment analysis.

AI Property Valuation Tool
Estimates property values based on market data, property features, and comparable sales.
Real Estate Investment Analyzer
Analyzes real estate investment opportunities, providing insights and recommendations.
Property Management Automation
Automates property management tasks, such as rent collection, maintenance requests, and tenant screening.
Real Estate Lead Generator
Generates real estate leads based on user preferences and market data.
Virtual Property Tour Creator
Creates virtual property tours from photos and videos, allowing potential buyers to view properties remotely.
Real Estate Market Trend Forecaster
Forecasts real estate market trends based on historical data, economic indicators, and demographic information.
Property Listing Optimizer
Optimizes property listings for search engines and real estate portals, improving visibility and attracting potential buyers.
Real Estate Chatbot for Customer Inquiries
Provides answers to common customer inquiries about real estate properties and services.
Automated Lease Agreement
Creates customized lease agreements based on property type, location, and tenant requirements.
Real Estate Due Diligence Assistant
Automates real estate due diligence processes, identifying potential risks and issues.
Property Tax Assessment Analyzer
Analyzes property tax assessments, identifying potential overvaluations and opportunities for appeals.
Real Estate Portfolio Manager
Manages real estate portfolios, providing insights and recommendations for optimizing performance.
Real Estate Renovation Planner
Creates renovation plans based on property features, market trends, and budget constraints.
Real Estate Staging Advisor
Provides recommendations for staging properties to attract potential buyers.
Real Estate Insurance Advisor
Provides personalized recommendations for real estate insurance policies.
Real Estate Contract Analyzer
Analyzes real estate contracts, identifying potential risks and issues.
Real Estate Investment Risk Assessor
Assesses the risk of real estate investments, providing insights and recommendations.
Real Estate Property Search Assistant
Helps users find properties that meet their specific needs and preferences.
Real Estate Negotiation Assistant
Provides guidance and support during real estate negotiations.

E-commerce

AI tools for e-commerce product recommendations, marketing, and customer service.

AI Product Recommendation Engine
Recommends products to customers based on their browsing history, purchase history, and preferences.
E-commerce Marketing Automation
Automates e-commerce marketing tasks, such as email marketing, social media marketing, and advertising.
E-commerce Customer Service Chatbot
Provides answers to common customer inquiries about e-commerce products and services.
E-commerce Fraud Detection System
Detects fraudulent transactions and activities in e-commerce.
E-commerce Product Description Generator
Generates compelling product descriptions for e-commerce sites.
E-commerce Pricing Optimizer
Optimizes product pricing based on market data, competitor pricing, and customer demand.
E-commerce Inventory Management System
Manages e-commerce inventory, tracking stock levels and predicting demand.
E-commerce Shipping Optimizer
Optimizes e-commerce shipping processes, reducing costs and improving delivery times.
E-commerce Customer Review Analyzer
Analyzes customer reviews, identifying trends and recommending improvements.
E-commerce Product Image Optimizer
Optimizes product images for e-commerce sites, improving visual appeal and conversion rates.
E-commerce Return Prediction
Predicts product returns, identifying potential issues and recommending solutions.
E-commerce Personalization Engine
Personalizes the e-commerce experience for each customer, improving engagement and conversion rates.
E-commerce Search Optimizer
Optimizes e-commerce search results, improving product discoverability.
E-commerce Customer Segmentation Tool
Segments e-commerce customers based on their behavior, demographics, and preferences.
E-commerce A/B Testing Assistant
Helps run A/B tests on e-commerce sites, identifying improvements and optimizing performance.
E-commerce Competitor Price Tracker
Tracks competitor pricing, providing insights and recommendations for pricing strategies.
E-commerce Social Media Ad Generator
Generates social media ads for e-commerce products.
E-commerce Email Marketing Assistant
Helps create and manage e-commerce email marketing campaigns.
E-commerce Loyalty Program Manager
Manages e-commerce loyalty programs, rewarding customers and improving retention.
E-commerce Product Trend Analyzer
Analyzes product trends, identifying popular products and recommending new product opportunities.

Sales

AI tools for sales lead generation, qualification, and closing.

AI Sales Lead Generator
Generates sales leads based on user preferences and market data.
Sales Lead Qualifier
Qualifies sales leads, identifying potential customers and prioritizing outreach.
Sales Email Assistant
Helps create and manage sales email campaigns.
Sales Call Script Generator
Generates sales call scripts based on product information and customer needs.
Sales Presentation Creator
Creates sales presentations based on product information and customer needs.
Sales Forecasting Tool
Forecasts sales performance based on historical data, market trends, and sales activities.
Sales CRM Automation
Automates sales CRM tasks, such as lead tracking, contact management, and opportunity management.
Sales Performance Analyzer
Analyzes sales performance, identifying trends and recommending improvements.
Sales Training Recommender
Recommends sales training programs based on sales team skills and performance.
Sales Territory Optimizer
Optimizes sales territories, improving sales coverage and efficiency.
Sales Compensation Planner
Creates sales compensation plans based on sales goals and performance.
Sales Meeting Summarizer
Summarizes sales meetings, identifying key takeaways and action items.
Sales Document Generator
Generates sales documents, such as proposals, contracts, and quotes.
Sales Customer Sentiment Analyzer
Analyzes customer sentiment from sales interactions, identifying potential issues and opportunities.
Sales Competitive Intelligence Tool
Provides competitive intelligence, tracking competitor activities and strategies.
Sales Pricing Optimizer
Optimizes product pricing based on market data, competitor pricing, and customer demand.
Sales Customer Churn Predictor
Predicts customer churn, identifying potential issues and recommending retention strategies.
Sales Opportunity Prioritizer
Prioritizes sales opportunities based on potential value and likelihood of closing.
Sales Team Collaboration Tool
Facilitates sales team collaboration, improving communication and coordination.
Sales Presentation Skill Trainer
Provides feedback and guidance on sales presentation skills.

Data Analysis

AI tools for data cleaning, visualization, and insight generation.

AI Data Cleaning Tool
Cleans data automatically, removing errors, inconsistencies, and duplicates.
Data Visualization Generator
Generates data visualizations automatically, providing insights and recommendations.
Data Insight Generator
Generates data insights automatically, identifying trends, patterns, and anomalies.
Data Storytelling Assistant
Helps create data stories, communicating insights and recommendations effectively.
Data Anomaly Detector
Detects data anomalies automatically, identifying potential errors and issues.
Data Trend Analyzer
Analyzes data trends, identifying patterns and predicting future performance.
Data Correlation Finder
Finds data correlations automatically, identifying relationships between variables.
Data Prediction Tool
Predicts future outcomes based on historical data and market trends.
Data Segmentation Tool
Segments data based on user-defined criteria, identifying distinct groups and patterns.
Data Integration Tool
Integrates data from multiple sources, creating a unified view and improving analysis.
Data Quality Assessor
Assesses data quality, identifying potential issues and recommending improvements.
Data Security Monitor
Monitors data security, detecting potential breaches and protecting sensitive information.
Data Governance Assistant
Helps implement data governance policies, ensuring data quality, security, and compliance.
Data Compliance Checker
Checks data for compliance with relevant regulations, such as GDPR and CCPA.
Data Metadata Generator
Generates data metadata automatically, improving data discoverability and understanding.
Data Dictionary Creator
Creates data dictionaries automatically, documenting data elements and relationships.
Data Lineage Tracker
Tracks data lineage, identifying the origin and transformation of data elements.
Data Catalog Builder
Builds data catalogs automatically, providing a central repository for data assets.
Data Privacy Enforcer
Enforces data privacy policies automatically, protecting sensitive information.
Data Sharing Assistant
Helps share data securely and compliantly, enabling collaboration and innovation.

Design

AI tools for graphic design, web design, and user interface design.

AI Logo Generator
Generates logos based on user preferences and brand guidelines.
Graphic Design Assistant
Helps create graphic designs, such as social media posts, advertisements, and presentations.
Web Design Assistant
Helps create web designs, generating layouts, color schemes, and typography.
UI Design Assistant
Helps create user interface designs, generating wireframes, mockups, and prototypes.
Image Enhancer
Enhances images automatically, improving resolution, sharpness, and color.
Image Background Remover
Removes image backgrounds automatically, creating transparent images for various purposes.
Color Palette Generator
Generates color palettes based on user preferences and design principles.
Typography Assistant
Helps choose typography, recommending fonts and styles based on design goals.
Layout Generator
Generates layouts automatically, creating visually appealing and functional designs.
Design Style Guide Creator
Creates design style guides automatically, documenting design principles and guidelines.
Design Accessibility Checker
Checks designs for accessibility, ensuring they are usable by people with disabilities.
Design Mockup Generator
Generates design mockups automatically, showcasing designs in realistic contexts.
Design Prototype Builder
Builds design prototypes automatically, allowing users to test and iterate on designs.
Design Feedback Analyzer
Analyzes design feedback, identifying potential issues and recommending improvements.
Design Trend Forecaster
Forecasts design trends, identifying emerging styles and technologies.
Design Inspiration Generator
Generates design inspiration, providing examples and ideas for various design projects.
Design Asset Organizer
Organizes design assets automatically, improving workflow and collaboration.
Design Version Control System
Manages design versions, tracking changes and allowing users to revert to previous versions.
Design Collaboration Tool
Facilitates design collaboration, improving communication and coordination.
Design Portfolio Builder
Builds design portfolios automatically, showcasing design skills and projects.

Development

AI tools for code generation, debugging, and testing.

AI Code Generator
Generates code automatically based on user requirements and specifications.
Code Debugger
Debugs code automatically, identifying errors and suggesting solutions.
Code Tester
Tests code automatically, ensuring functionality and performance.
Code Refactorer
Refactors code automatically, improving readability, maintainability, and performance.
Code Documentation Generator
Generates code documentation automatically, documenting code functionality and usage.
Code Style Checker
Checks code style automatically, ensuring consistency and adherence to coding standards.
Code Security Analyzer
Analyzes code security automatically, identifying potential vulnerabilities and recommending solutions.
Code Performance Profiler
Profiles code performance automatically, identifying bottlenecks and recommending optimizations.
Code Completion Assistant
Provides code completion suggestions, improving coding speed and accuracy.
Code Search Assistant
Helps search code, finding relevant code snippets and examples.
Code Collaboration Tool
Facilitates code collaboration, improving communication and coordination.
Code Version Control System
Manages code versions, tracking changes and allowing users to revert to previous versions.
Code Deployment Automation
Automates code deployment, streamlining the release process.
Code Monitoring System
Monitors code performance and stability, alerting developers to potential issues.
Code Migration Assistant
Helps migrate code from one platform to another, automating the conversion process.
Code Optimization Tool
Optimizes code automatically, improving performance and reducing resource consumption.
Code Vulnerability Scanner
Scans code for vulnerabilities, identifying potential security risks.
Code Complexity Analyzer
Analyzes code complexity, identifying potential maintainability issues.
Code Dependency Manager
Manages code dependencies, ensuring compatibility and preventing conflicts.
Code Review Assistant
Helps review code, identifying potential issues and recommending improvements.

Research

AI tools for literature review, data analysis, and report generation.

AI Literature Review Tool
Automates literature reviews, identifying relevant articles and summarizing key findings.
Research Data Analyzer
Analyzes research data automatically, identifying trends, patterns, and anomalies.
Research Report Generator
Generates research reports automatically, summarizing findings and providing recommendations.
Research Hypothesis Generator
Generates research hypotheses based on existing literature and data.
Research Experiment Designer
Helps design research experiments, optimizing methodology and data collection.
Research Grant Proposal Writer
Helps write research grant proposals, improving clarity and persuasiveness.
Research Citation Manager
Manages research citations, ensuring accuracy and consistency.
Research Plagiarism Checker
Checks research papers for plagiarism, ensuring originality and academic integrity.
Research Data Visualization Tool
Visualizes research data, improving understanding and communication.
Research Collaboration Platform
Facilitates research collaboration, improving communication and coordination.
Research Data Repository
Provides a repository for research data, improving accessibility and reproducibility.
Research Ethics Advisor
Provides guidance on research ethics, ensuring compliance with ethical guidelines.
Research Bias Detector
Detects bias in research data and methodology, improving objectivity and validity.
Research Impact Assessor
Assesses the impact of research, measuring its influence and significance.
Research Funding Finder
Helps find research funding opportunities, matching researchers with relevant grants and programs.
Research Conference Recommender
Recommends research conferences based on research interests and expertise.
Research Journal Recommender
Recommends research journals based on research topics and quality metrics.
Research Peer Review Assistant
Helps with peer review, providing feedback and suggestions for improvement.
Research Data Management Tool
Helps manage research data, ensuring quality, security, and accessibility.
Research Knowledge Graph Builder
Builds knowledge graphs from research data, visualizing relationships and improving understanding.

Translation

AI tools for language translation, localization, and interpretation.

AI Language Translator
Translates text and speech from one language to another automatically.
Localization Assistant
Helps localize content for different regions and cultures, adapting language, images, and formatting.
Interpretation Tool
Provides real-time interpretation for meetings, conferences, and other events.
Multilingual Chatbot
Provides customer service and support in multiple languages.
Document Translator
Translates documents automatically, preserving formatting and layout.
Website Translator
Translates websites automatically, making them accessible to a global audience.
Subtitle Generator
Generates subtitles for videos automatically, improving accessibility and engagement.
Transcription Service
Transcribes audio and video content automatically, converting speech to text.
Language Learning Assistant
Provides personalized language learning exercises and feedback.
Multilingual SEO Tool
Optimizes websites for search engines in multiple languages.
Translation Memory System
Stores and reuses translated content, improving efficiency and consistency.
Terminology Management Tool
Manages terminology across languages, ensuring accuracy and consistency.
Machine Translation Post-Editor
Helps human translators edit and improve machine-translated content.
Language Detection Tool
Detects the language of text automatically.
Dialect Translator
Translates between different dialects of the same language.
Sign Language Translator
Translates between spoken languages and sign language.
Braille Translator
Translates between spoken languages and Braille.
Multilingual Voice Assistant
Provides voice assistance in multiple languages.
Translation Quality Assessor
Assesses the quality of translations automatically.

Audio

AI tools for audio editing, generation, and analysis.

AI Audio Editor
Edits audio automatically, removing noise, improving clarity, and adjusting levels.
Audio Generator
Generates audio automatically, creating music, sound effects, and voiceovers.
Audio Analyzer
Analyzes audio automatically, identifying patterns, anomalies, and insights.
Speech Synthesizer
Synthesizes speech from text automatically, creating realistic and expressive voices.
Voice Changer
Changes voices automatically, modifying pitch, tone, and timbre.
Music Composer
Composes music automatically, creating original scores in various styles and genres.
Sound Effect Generator
Generates sound effects automatically, creating realistic and immersive audio experiences.
Audio Transcription Service
Transcribes audio content automatically, converting speech to text.
Podcast Editor
Edits podcasts automatically, removing silences, improving audio quality, and adding intros and outros.
Audio Mastering Tool
Masters audio automatically, optimizing levels, EQ, and dynamics for professional sound.
Noise Reduction Tool
Reduces noise in audio automatically, improving clarity and intelligibility.
Audio Restoration Tool
Restores damaged audio automatically, removing clicks, pops, and other artifacts.
Audio Fingerprinting Tool
Identifies audio automatically, matching songs, sound effects, and other audio content.
Audio Watermarking Tool
Watermarks audio automatically, protecting copyright and preventing unauthorized use.
Audio Format Converter
Converts audio formats automatically, ensuring compatibility across devices and platforms.
Audio Tag Editor
Edits audio tags automatically, adding metadata and improving organization.
Audio Visualizer
Visualizes audio automatically, creating dynamic and engaging displays.
Audio Search Engine
Searches audio content automatically, finding songs, sound effects, and other audio content.
Audio Recommendation Engine
Recommends audio content automatically, suggesting songs, podcasts, and other audio content based on user preferences.
Audio Learning Assistant
Provides audio-based learning experiences, creating audio lessons, quizzes, and exercises.

Video

AI tools for video editing, generation, and analysis.

AI Video Editor
Edits video automatically, removing unwanted footage, adding transitions, and improving quality.
Video Generator
Generates videos automatically, creating promotional videos, explainer videos, and social media videos.
Video Analyzer
Analyzes videos automatically, identifying objects, scenes, and events.
Video Summarizer
Summarizes videos automatically, creating short trailers and highlights.
Video Enhancer
Enhances videos automatically, improving resolution, sharpness, and color.
Video Stabilizer
Stabilizes videos automatically, removing camera shake and improving smoothness.
Video Translator
Translates videos automatically, adding subtitles and dubbing in multiple languages.
Video Transcriber
Transcribes videos automatically, converting speech to text.
Video Recommendation Engine
Recommends videos automatically, suggesting content based on user preferences.
Video Search Engine
Searches videos automatically, finding relevant content based on keywords and topics.
Video Monetization Tool
Monetizes videos automatically, adding ads and optimizing revenue.
Video Marketing Assistant
Helps market videos, optimizing titles, descriptions, and tags.
Video Analytics Tool
Analyzes video performance, tracking views, engagement, and audience demographics.
Video Compression Tool
Compresses videos automatically, reducing file size without sacrificing quality.
Video Format Converter
Converts video formats automatically, ensuring compatibility across devices and platforms.
Video Watermarking Tool
Watermarks videos automatically, protecting copyright and preventing unauthorized use.
Video Editing Collaboration Tool
Facilitates video editing collaboration, improving communication and coordination.
Video Learning Platform
Provides video-based learning experiences, creating video lessons, quizzes, and exercises.
Live Streaming Assistant
Helps manage live streams, adding graphics, transitions, and interactive elements.
Video Game AI Assistant
Provides AI assistance for video game development, creating intelligent characters and environments.

Image

AI tools for image editing, generation, and analysis.

AI Image Editor
Edits images automatically, removing blemishes, adjusting colors, and improving composition.
Image Generator
Generates images automatically, creating original artwork, illustrations, and photographs.
Image Analyzer
Analyzes images automatically, identifying objects, scenes, and emotions.
Image Enhancer
Enhances images automatically, improving resolution, sharpness, and color.
Image Upscaler
Upscales images automatically, increasing resolution without sacrificing quality.
Image Background Remover
Removes image backgrounds automatically, creating transparent images for various purposes.
Image Style Transfer Tool
Transfers styles from one image to another automatically, creating unique and artistic effects.
Image Object Detector
Detects objects in images automatically, identifying people, animals, and objects.
Image Caption Generator
Generates captions for images automatically, describing the content and context.
Image Search Engine
Searches images automatically, finding relevant content based on keywords and visual similarity.
Image Recommendation Engine
Recommends images automatically, suggesting content based on user preferences.
Image Compression Tool
Compresses images automatically, reducing file size without sacrificing quality.
Image Format Converter
Converts image formats automatically, ensuring compatibility across devices and platforms.
Image Watermarking Tool
Watermarks images automatically, protecting copyright and preventing unauthorized use.
Image Metadata Editor
Edits image metadata automatically, adding information about the image and improving organization.
Image Forensic Tool
Analyzes images for forensic purposes, detecting tampering and identifying sources.
Image Recognition System
Recognizes images automatically, identifying faces, objects, and scenes.
Image Security Monitor
Monitors images for security threats, detecting malicious content and preventing unauthorized access.
Image Accessibility Checker
Checks images for accessibility, ensuring they are usable by people with disabilities.
Image Learning Platform
Provides image-based learning experiences, creating image quizzes, and exercises.

Personal

AI tools for personal productivity, health, and well-being.

AI Personal Assistant
Provides personalized assistance with tasks, scheduling, and communication.
Personal Health Tracker
Tracks personal health data, providing insights and recommendations for improvement.
Personal Finance Manager
Manages personal finances, tracking income, expenses, and investments.
Personal Diet Planner
Creates personalized diet plans based on user preferences and health goals.
Personal Fitness Coach
Provides personalized fitness coaching, creating workout plans and tracking progress.
Personal Sleep Tracker
Tracks sleep patterns, providing insights and recommendations for improving sleep quality.
Personal Meditation Guide
Provides guided meditations, helping users relax and reduce stress.
Personal Learning Assistant
Provides personalized learning experiences, recommending courses and tracking progress.
Personal Travel Planner
Creates personalized travel plans, recommending destinations, activities, and accommodations.
Personal Shopping Assistant
Provides personalized shopping recommendations, suggesting products based on user preferences.
Personal Style Advisor
Provides personalized style advice, recommending clothing and accessories based on user preferences.
Personal Relationship Manager
Helps manage personal relationships, tracking contacts and reminding users of important events.
Personal Goal Tracker
Tracks progress towards personal goals, providing motivation and support.
Personal Habit Tracker
Tracks personal habits, helping users build positive routines and break negative ones.
Personal Journaling Assistant
Provides prompts and feedback for personal journaling, helping users reflect on their thoughts and feelings.
Personal Creativity Booster
Provides prompts and exercises for boosting creativity, helping users generate new ideas and solve problems.
Personal Stress Reducer
Provides techniques and tools for reducing stress, helping users relax and improve well-being.
Personal Time Management Tool
Helps manage time effectively, prioritizing tasks and scheduling activities.
Personal Decision Support System
Helps make informed decisions, weighing options and considering potential outcomes.
Personal Knowledge Organizer
Helps organize personal knowledge, creating a searchable and accessible repository of information.

Travel

AI tools for travel planning, booking, and navigation.

AI Travel Planner
Creates personalized travel plans based on user preferences and budget.
Flight Booking Assistant
Finds the best flight deals based on user preferences and travel dates.
Hotel Booking Assistant
Finds the best hotel deals based on user preferences and location.
Rental Car Booking Assistant
Finds the best rental car deals based on user preferences and location.
Travel Itinerary Generator
Generates detailed travel itineraries, including activities, attractions, and restaurants.
Travel Navigation Assistant
Provides real-time navigation assistance, guiding users to their destinations.
Travel Language Translator
Translates languages in real-time, facilitating communication with locals.
Travel Currency Converter
Converts currencies in real-time, helping users manage their travel expenses.
Travel Weather Forecaster
Provides accurate weather forecasts for travel destinations.
Travel Packing Assistant
Creates personalized packing lists based on travel destination and activities.
Travel Photo Organizer
Organizes travel photos automatically, tagging locations and creating albums.
Travel Journaling Assistant
Provides prompts and feedback for travel journaling, helping users document their experiences.
Travel Safety Advisor
Provides safety advice for travel destinations, alerting users to potential risks and hazards.
Travel Insurance Advisor
Recommends travel insurance policies based on user needs and travel plans.
Travel Visa Assistant
Provides information and assistance with travel visa requirements.
Travel Vaccination Advisor
Provides information and recommendations for travel vaccinations.
Travel Emergency Assistant
Provides assistance in travel emergencies, connecting users with local resources and support.
Travel Accessibility Advisor
Provides information and recommendations for accessible travel options.
Travel Sustainability Advisor
Provides information and recommendations for sustainable travel practices.
Travel Local Experience Recommender
Recommends local experiences and activities based on user interests.

Events

AI tools for event planning, promotion, and management.

AI Event Planner
Creates personalized event plans based on user preferences and budget.
Event Venue Finder
Finds the best event venues based on user preferences and location.
Event Speaker Recommender
Recommends event speakers based on event topic and audience.
Event Marketing Assistant
Helps market events, creating promotional materials and managing social media campaigns.
Event Ticketing System
Manages event ticketing, selling tickets and tracking attendance.
Event Registration System
Manages event registration, collecting attendee information and managing logistics.
Event Scheduling Assistant
Schedules event activities, optimizing timing and logistics.
Event Networking Tool
Facilitates event networking, connecting attendees with similar interests.
Event Feedback Collector
Collects event feedback, gathering attendee opinions and suggestions.
Event Data Analyzer
Analyzes event data, identifying trends and insights.
Event Budget Manager
Manages event budgets, tracking expenses and optimizing spending.
Event Risk Assessor
Assesses event risks, identifying potential hazards and recommending mitigation strategies.
Event Accessibility Advisor
Provides information and recommendations for accessible event design.
Event Sustainability Advisor
Provides information and recommendations for sustainable event practices.
Event Volunteer Manager
Manages event volunteers, recruiting, training, and scheduling.
Event Sponsor Matchmaker
Matches events with potential sponsors, connecting organizers with funding opportunities.
Event Content Curator
Curates event content, selecting relevant speakers, presentations, and activities.
Event Promotion Video Generator
Generates promotional videos for events, creating engaging content to attract attendees.
Event Post-Event Report Generator
Generates post-event reports, summarizing key metrics and insights.
Virtual Event Platform
Provides a platform for hosting virtual events, enabling online attendance and interaction.

Food & Beverage

AI tools for recipe generation, menu planning, and food safety.

AI Recipe Generator
Generates recipes based on user preferences and available ingredients.
Menu Planner
Creates personalized menu plans based on dietary restrictions and nutritional goals.
Restaurant Recommendation Engine
Recommends restaurants based on user preferences and location.
Food Safety Monitor
Monitors food safety, detecting potential contamination and hazards.
Grocery Shopping Assistant
Creates grocery shopping lists based on recipes and menu plans.
Wine Pairing Assistant
Recommends wine pairings based on food choices.
Cocktail Recipe Generator
Generates cocktail recipes based on user preferences and available ingredients.
Food Image Classifier
Classifies food images, identifying ingredients and nutritional information.
Restaurant Review Analyzer
Analyzes restaurant reviews, identifying trends and insights.
Food Waste Reducer
Provides recommendations for reducing food waste, optimizing storage and usage.
Personalized Nutrition Advisor
Provides personalized nutrition advice based on user health data and dietary goals.
Smart Kitchen Assistant
Provides voice-controlled assistance in the kitchen, helping with recipes, timers, and conversions.
Automated Restaurant Ordering System
Automates restaurant ordering, taking orders and processing payments.
Food Delivery Route Optimizer
Optimizes food delivery routes, improving efficiency and reducing delivery times.
Smart Refrigerator
Monitors refrigerator contents, tracking expiration dates and recommending recipes.
Personalized Coffee Recommender
Recommends coffee beans and brewing methods based on user preferences.
Craft Beer Recommendation Engine
Recommends craft beers based on user preferences and location.
Food Allergy Detector
Detects food allergies in images and recipes, alerting users to potential hazards.
Sustainable Food Sourcing Advisor
Provides recommendations for sustainable food sourcing, supporting local and ethical producers.
Automated Farm Management System
Automates farm management tasks, optimizing irrigation, fertilization, and pest control.

Fitness

AI tools for personalized workout plans, form correction, and progress tracking.

AI Personal Trainer
Creates personalized workout plans based on user goals, fitness level, and available equipment.
Form Correction Assistant
Analyzes exercise form in real-time, providing feedback and corrections.
Workout Progress Tracker
Tracks workout progress, providing insights and motivation.
Personalized Nutrition Advisor
Provides personalized nutrition advice based on user fitness goals and dietary preferences.
Sleep Optimization Assistant
Provides personalized recommendations for improving sleep quality and duration.
Stress Management Coach
Provides personalized stress management techniques and exercises.
Mindfulness Meditation Guide
Provides guided mindfulness meditations for improving focus and reducing anxiety.
Personalized Running Coach
Creates personalized running plans based on user goals and fitness level.
Cycling Route Planner
Creates personalized cycling routes based on user preferences and location.
Swimming Technique Analyzer
Analyzes swimming technique in real-time, providing feedback and corrections.
Yoga Pose Corrector
Analyzes yoga pose form in real-time, providing feedback and corrections.
Dance Workout Generator
Generates personalized dance workouts based on user preferences and fitness level.
Martial Arts Training Assistant
Provides personalized martial arts training plans and feedback.
Rock Climbing Route Recommender
Recommends rock climbing routes based on user skill level and location.
Hiking Trail Finder
Finds hiking trails based on user preferences and location.
Fitness Community Matchmaker
Matches users with fitness communities based on shared interests and goals.
Fitness Equipment Recommender
Recommends fitness equipment based on user needs and budget.
Fitness Event Planner
Helps plan fitness events, such as races, competitions, and workshops.
Fitness Challenge Generator
Generates fitness challenges to motivate users and track progress.
Fitness Music Playlist Creator
Creates personalized fitness music playlists based on user preferences and workout type.
Fitness Apparel Recommender
Recommends fitness apparel based on user preferences and activity type.
Fitness Tracker Analyzer
Analyzes data from fitness trackers, providing insights and recommendations.
Fitness Goal Setter
Helps users set realistic and achievable fitness goals.

Gaming

AI tools for game development, gameplay enhancement, and esports analytics.

AI Game Developer
Helps develop games, generating code, creating assets, and designing gameplay.
Game AI Assistant
Creates intelligent game AI, controlling non-player characters and creating challenging gameplay.
Game Asset Generator
Generates game assets automatically, creating textures, models, and animations.
Game Level Designer
Designs game levels automatically, creating challenging and engaging environments.
Game Story Writer
Writes game stories automatically, creating compelling narratives and characters.
Game Music Composer
Composes game music automatically, creating original scores and sound effects.
Game Testing Assistant
Tests games automatically, identifying bugs and performance issues.
Game Balancing Tool
Balances game gameplay automatically, adjusting difficulty and rewards.
Game Tutorial Generator
Generates game tutorials automatically, helping players learn the game mechanics.
Game Replay Analyzer
Analyzes game replays, providing insights and recommendations for improvement.
Game Coaching Assistant
Provides personalized game coaching, helping players improve their skills and strategies.
Esports Analytics Tool
Analyzes esports data, providing insights and recommendations for teams and players.
Esports Tournament Organizer
Organizes esports tournaments automatically, managing registration, scheduling, and results.
Game Streaming Assistant
Helps manage game streams, adding graphics, transitions, and interactive elements.
Game Community Manager
Manages game communities, moderating forums, organizing events, and engaging with players.
Game Mod Generator
Generates game mods automatically, creating new content and gameplay experiences.
Game Translation Tool
Translates games into multiple languages, making them accessible to a global audience.
Game Accessibility Advisor
Provides information and recommendations for accessible game design.
Game Monetization Optimizer
Optimizes game monetization strategies, maximizing revenue and player engagement.
Game Trend Forecaster
Forecasts game trends, identifying emerging genres and technologies.

IoT

AI tools for IoT device management, data analysis, and automation.

AI IoT Device Manager
Manages IoT devices automatically, monitoring performance, updating software, and troubleshooting issues.
IoT Data Analyzer
Analyzes IoT data automatically, identifying trends, patterns, and anomalies.
IoT Automation Engine
Automates IoT tasks, creating rules and triggers for device interactions.
Smart Home Assistant
Provides voice-controlled assistance for managing smart home devices.
Smart City Planner
Helps plan smart city infrastructure, optimizing traffic flow, energy consumption, and resource management.
Industrial IoT Optimizer
Optimizes industrial processes using IoT data, improving efficiency and reducing downtime.
Agricultural IoT Manager
Manages agricultural operations using IoT data, optimizing irrigation, fertilization, and pest control.
Healthcare IoT Monitor
Monitors patient health using IoT devices, alerting healthcare providers to potential issues.
Retail IoT Analyzer
Analyzes retail data from IoT devices, optimizing store layout, inventory management, and customer experience.
Transportation IoT Optimizer
Optimizes transportation systems using IoT data, improving traffic flow, reducing congestion, and enhancing safety.
Energy IoT Manager
Manages energy consumption using IoT devices, optimizing efficiency and reducing costs.
Environmental IoT Monitor
Monitors environmental conditions using IoT devices, tracking pollution levels, weather patterns, and natural disasters.
Security IoT System
Provides security monitoring and alerts using IoT devices, detecting intrusions and preventing crime.
Supply Chain IoT Tracker
Tracks goods and materials throughout the supply chain using IoT devices, improving visibility and efficiency.
Smart Building Manager
Manages building systems using IoT devices, optimizing energy consumption, security, and comfort.
Connected Car Assistant
Provides assistance to drivers using connected car data, offering navigation, entertainment, and safety features.
Wearable IoT Analyzer
Analyzes data from wearable IoT devices, providing insights into user health and activity.
Smart Agriculture Drone Manager
Manages agricultural drones using AI, optimizing flight paths, data collection, and analysis.
Remote Equipment Maintenance Predictor
Predicts equipment maintenance needs using IoT data, preventing downtime and improving reliability.
IoT Security Vulnerability Scanner
Scans IoT devices for security vulnerabilities, identifying potential risks and recommending solutions.

Sustainability

AI tools for environmental monitoring, resource optimization, and carbon footprint reduction.

AI Environmental Monitor
Monitors environmental conditions automatically, tracking pollution levels, weather patterns, and natural disasters.
Resource Optimizer
Optimizes resource consumption, reducing waste and improving efficiency.
Carbon Footprint Tracker
Tracks carbon footprint, providing insights and recommendations for reduction.
Renewable Energy Planner
Helps plan renewable energy projects, optimizing location, technology, and financing.
Sustainable Agriculture Advisor
Provides recommendations for sustainable agricultural practices, reducing environmental impact and improving yields.
Waste Management Optimizer
Optimizes waste management processes, reducing landfill waste and improving recycling rates.
Water Conservation Assistant
Provides recommendations for water conservation, reducing usage and improving efficiency.
Sustainable Transportation Planner
Helps plan sustainable transportation systems, optimizing routes, reducing emissions, and promoting alternative modes of transport.
Green Building Designer
Helps design green buildings, optimizing energy efficiency, water conservation, and material usage.
Sustainable Supply Chain Manager
Manages supply chains sustainably, tracking environmental impact and promoting ethical sourcing.
Climate Change Model
Models climate change scenarios, predicting future impacts and informing policy decisions.
Deforestation Monitor
Monitors deforestation automatically, detecting illegal logging and protecting forests.
Ocean Pollution Tracker
Tracks ocean pollution automatically, identifying sources and monitoring cleanup efforts.
Air Quality Forecaster
Forecasts air quality automatically, alerting users to potential health hazards.
Sustainable Investment Advisor
Provides recommendations for sustainable investments, supporting environmentally and socially responsible companies.
Sustainable Product Designer
Helps design sustainable products, optimizing material usage, recyclability, and durability.
Sustainable Packaging Optimizer
Optimizes packaging for sustainability, reducing material usage and promoting recyclability.
Sustainable Event Planner
Helps plan sustainable events, minimizing environmental impact and promoting responsible practices.
Sustainable Tourism Advisor
Provides recommendations for sustainable tourism practices, supporting local communities and protecting the environment.
Sustainable Fashion Recommender
Recommends sustainable fashion brands and products, promoting ethical and environmentally responsible clothing choices.

Niche Industries

AI tools tailored for specific, specialized industries.

AI Art Authenticator
Authenticates artwork, verifying provenance and detecting forgeries.
Legal Document Summarizer for Specific Jurisdictions
Summarizes legal documents, tailored to specific jurisdictions and legal systems.
Financial Risk Assessor for Cryptocurrency
Assesses financial risk in cryptocurrency investments, identifying potential scams and volatile assets.
Personalized Learning Path Generator for Rare Skills
Creates personalized learning paths for rare and specialized skills, such as ancient languages or niche programming languages.
AI-Powered Precision Farming Tool
Optimizes farming practices for specific crops and soil conditions, maximizing yields and minimizing resource usage.
AI-Driven Personalized Medicine Recommender
Recommends personalized medicine treatments based on individual genetic profiles and medical history.
AI-Based Predictive Maintenance for Spacecraft
Predicts maintenance needs for spacecraft, preventing failures and extending mission lifespans.
AI-Powered Underwater Exploration Assistant
Assists with underwater exploration, identifying marine life, mapping underwater terrain, and detecting anomalies.
AI-Driven Personalized Education for Gifted Children
Creates personalized education plans for gifted children, challenging them and fostering their talents.
AI-Based Threat Detection for Cybersecurity in Critical Infrastructure
Detects cybersecurity threats in critical infrastructure, such as power grids and water treatment plants, preventing disruptions and attacks.
AI-Powered Personalized Music Therapy
Creates personalized music therapy programs for individuals with specific medical conditions or emotional needs.
AI-Driven Personalized Art Curator
Curates personalized art collections for individuals and businesses, based on their tastes and preferences.
AI-Based Predictive Analytics for Clinical Trials
Predicts the success of clinical trials, identifying potential issues and optimizing trial design.
AI-Powered Personalized Language Learning for Endangered Languages
Creates personalized language learning programs for endangered languages, preserving cultural heritage and promoting language revitalization.
AI-Driven Personalized Financial Planning for High-Net-Worth Individuals
Creates personalized financial plans for high-net-worth individuals, optimizing investments and managing complex assets.
AI-Based Threat Detection for Wildlife Conservation
Detects threats to wildlife, such as poaching and habitat destruction, using remote sensing and image analysis.
AI-Powered Personalized Career Counseling for Veterans
Provides personalized career counseling for veterans, helping them transition to civilian careers and find meaningful employment.
AI-Driven Personalized Education for Students with Learning Disabilities
Creates personalized education plans for students with learning disabilities, addressing their specific needs and maximizing their potential.
AI-Based Predictive Maintenance for Renewable Energy Infrastructure
Predicts maintenance needs for renewable energy infrastructure, such as wind turbines and solar panels, preventing downtime and improving efficiency.
AI-Powered Personalized Travel Planning for People with Disabilities
Creates personalized travel plans for people with disabilities, ensuring accessibility and comfort.

Final Thoughts

The AI micro SaaS landscape offers tremendous opportunities for entrepreneurs to build focused, profitable businesses with relatively low overhead and high scalability. The ideas presented here are starting points that can be adapted and combined to create unique offerings that solve specific problems for well-defined customer segments.

When evaluating these AI Micro SaaS ideas, consider factors like market demand, technical feasibility, your expertise, and potential for recurring revenue. The most successful micro SaaS businesses typically focus on solving a specific pain point extremely well rather than trying to be everything to everyone.

Remember that AI technology continues to evolve rapidly, creating new opportunities regularly. Stay informed about advancements in AI capabilities and look for problems where these technologies can create significant value for specific user groups.

See also: AI Prompt Examples

The post AI Micro SaaS Ideas appeared first on AI Parabellum • Your Go-To AI Tools Directory for Success.

by: aiparabellum.com
Wed, 26 Mar 2025 03:13:15 +0000


Crafting effective prompts is both an art and a science. The right prompt can unlock the full potential of AI models, leading to more accurate, creative, and useful outputs. This guide explores various prompt categories and provides detailed AI prompt examples to help you master the skill of prompt engineering.

Whether you’re a developer, content creator, or AI enthusiast, these examples will help you understand how to communicate more effectively with AI systems and achieve better results.

150+ Best AI Prompt Examples

The following are the 16 most commonly used categories, each containing 10 examples of AI prompts.

If you find these prompts useful and want to organize them, try our free AI Prompt Manager tool. For creating additional prompts at no cost, check out our free AI Prompt Generator tool.

Creative Writing

Prompts designed to generate creative content like stories, poems, and scripts.

Short Story Generator

Generate a complete short story with a specific theme and elements.

Write a 500-word science fiction story about time travel that includes a paradox, a historical figure, and ends with a twist. Use vivid descriptions and include meaningful dialogue.
Pro tip: Specify word count, genre, and required elements for more controlled outputs.

Character Development

Create detailed character profiles for creative writing.

Create a detailed character profile for a complex anti-hero in a dystopian setting. Include their background, motivations, flaws, physical description, speech patterns, and a sample dialogue that showcases their personality.
Pro tip: The more specific details you provide about the character’s world, the more coherent the result will be.

Poetry Composition

Generate poetry in specific styles or addressing particular themes.

Write a sonnet in Shakespearean style about the relationship between technology and nature. Use appropriate meter and rhyme scheme, and include at least one powerful metaphor.
Pro tip: Specifying the poetic form (sonnet, haiku, free verse) helps the AI understand structural constraints.

Dialogue Writing

Create realistic dialogue between characters in specific scenarios.

Write a dialogue between a parent and a teenager who has just been caught sneaking out at night. Make the conversation emotionally charged but realistic, showing both perspectives and the underlying tensions.
Pro tip: Describe the characters’ emotions and relationship dynamics for more authentic dialogue.

Plot Outline

Generate structured plot outlines for longer works.

Create a detailed three-act plot outline for a mystery novel about a small-town detective investigating a series of disappearances. Include key plot points, red herrings, character arcs, and a satisfying resolution.
Pro tip: Mention specific plot structures (three-act, hero’s journey) if you want the AI to follow them.

Setting Description

Create vivid descriptions of locations and environments.

Describe an abandoned amusement park 50 years after its closure. Focus on sensory details, the atmosphere, signs of decay, and hints of its former glory. Make it both eerie and melancholic.
Pro tip: Ask for specific sensory details (sights, sounds, smells) to make settings more immersive.

Metaphor and Simile Creation

Generate creative comparisons for use in writing.

Create 5 original metaphors and 5 similes that describe the feeling of anxiety. Make them vivid, unexpected, and avoid clichés. Explain why each comparison works effectively.
Pro tip: Requesting explanations helps ensure the comparisons are meaningful rather than just creative.

Flash Fiction

Generate very short but complete stories.

Write a 100-word flash fiction piece about a life-changing encounter between strangers on a train. Make every word count and end with a line that resonates emotionally.
Pro tip: Tight word count constraints challenge the AI to be concise and impactful.

Alternate History Scenario

Explore creative “what if” historical scenarios.

Write a brief alternate history scenario describing how the world would be different today if the Internet had been invented in the 1920s instead of decades later. Consider technological, social, and political implications.
Pro tip: Provide a clear divergence point in history for more focused and plausible scenarios.

Genre Mashup

Combine different genres for unique creative writing.

Write the opening paragraph of a story that combines elements of Western and Horror genres. Set it in a remote frontier town in the 1880s where something supernatural has begun to occur. Use language that evokes both genres.
Pro tip: Specify which elements from each genre you want to see for more controlled fusion.

Code Generation

Prompts for generating code snippets, functions, and programming solutions.

Function Implementation

Generate specific functions with detailed requirements.

Write a JavaScript function that takes an array of objects with ‘name’ and ‘score’ properties and returns a new array with only the objects where the score is above a threshold passed as a second parameter. Include error handling and comments explaining the code.
Pro tip: Specify input/output types, edge cases to handle, and performance considerations.

Algorithm Solution

Generate solutions to algorithmic problems.

Write a Python function to find the longest palindromic substring in a given string. Explain the algorithm’s approach, time complexity, and space complexity. Include comments and handle edge cases.
Pro tip: Ask for explanations of time/space complexity to ensure efficient solutions.

Code Refactoring

Improve existing code for readability, performance, or maintainability.

Refactor this React component to use hooks instead of class components, improve performance by preventing unnecessary re-renders, and follow current best practices: class UserProfile extends React.Component { … }
Pro tip: Include the original code and specify what aspects need improvement.

API Integration

Generate code for integrating with specific APIs.

Write a Node.js function that fetches weather data from the OpenWeatherMap API for a given city name. Handle errors gracefully, implement caching to avoid redundant API calls, and return the data in a simplified format with only temperature, conditions, and forecast.
Pro tip: Specify exactly which API endpoints and features you need to implement.

Data Structure Implementation

Create custom data structures for specific use cases.

Implement a priority queue in Java that supports the following operations: insert with priority, remove highest priority element, peek at highest priority element, and change the priority of an existing element. Include a complete class with appropriate methods and documentation.
Pro tip: List all required operations and any performance constraints.

Unit Test Generation

Create comprehensive tests for existing code.

Write Jest unit tests for this JavaScript authentication utility function. Include tests for successful authentication, invalid credentials, expired tokens, and network failures. Use mocks where appropriate: async function authenticateUser(username, password) { … }
Pro tip: Include the code to be tested and specify which scenarios need test coverage.

Database Query

Generate SQL or NoSQL queries for specific data operations.

Write a SQL query to find the top 5 customers who have spent the most money in the last 6 months. The database has tables for customers, orders, and order_items with appropriate foreign keys. Include comments explaining the query logic.
Pro tip: Describe the database schema and the exact data you need to retrieve.

UI Component

Generate frontend components with specific functionality.

Create a React component for a paginated data table that supports sorting by columns, filtering, and row selection. Use TypeScript with proper typing, and styled-components for styling. Make it accessible and responsive.
Pro tip: Specify the framework, styling approach, and all required features.

Command Line Tool

Create scripts for automation or system tasks.

Write a Python script that recursively searches directories for duplicate files based on content (not just filename). The script should take a directory path as input, report all duplicates found, and offer options to delete or move duplicates. Include proper error handling.
Pro tip: Detail the exact functionality, input parameters, and output format.

Design Pattern Implementation

Implement specific software design patterns.

Implement the Observer design pattern in TypeScript to create a weather monitoring system. Include a WeatherStation class (the subject) and multiple display classes (observers) that update when the weather changes. Show example usage of the implementation.
Pro tip: Name the specific design pattern and provide context for its application.

Data Analysis

Prompts for analyzing data, generating insights, and creating visualizations.

Data Cleaning Script

Generate code to clean and preprocess datasets.

Write a Python function using pandas to clean a dataset with the following issues: missing values in numerical columns, inconsistent date formats, duplicate rows, and outliers in the ‘salary’ column. The function should handle each issue appropriately and return the cleaned DataFrame.
Pro tip: Specify the exact data issues and how you want them handled (e.g., impute, remove, transform).

Statistical Analysis

Generate code for statistical tests and analysis.

Write Python code to perform a comprehensive statistical analysis on two groups of test scores to determine if a new teaching method had a significant impact. Include descriptive statistics, visualization, normality testing, and the appropriate statistical test with interpretation of results.
Pro tip: Specify the hypothesis you’re testing and what kind of data you’re working with.

Data Visualization

Create code for specific data visualizations.

Create a Python script using matplotlib or seaborn to visualize the relationship between multiple variables in a housing dataset. Include a correlation heatmap, scatter plots with regression lines, distribution plots for key variables, and a pair plot. Add proper titles, labels, and a cohesive color scheme.
Pro tip: Describe the exact visualizations needed and any styling preferences.

Machine Learning Model

Generate code for implementing ML models for specific tasks.

Write Python code using scikit-learn to build a customer churn prediction model. Include data preprocessing, feature selection, model selection with cross-validation, hyperparameter tuning, and evaluation metrics appropriate for an imbalanced classification problem.
Pro tip: Specify the ML task, evaluation metrics, and any constraints or preferences.

Time Series Analysis

Generate code for analyzing time-based data.

Create a Python script to analyze and forecast monthly sales data for a retail business. Include trend and seasonality decomposition, autocorrelation analysis, and implement both ARIMA and Prophet models. Compare their performance and visualize the forecasts with confidence intervals.
Pro tip: Mention the time frequency of your data and how far you need to forecast.

Data Extraction

Generate code to extract data from various sources.

Write a Python script that extracts financial data from quarterly PDF reports. The PDFs have tables with revenue, expenses, and profit margins. The script should identify these tables, extract the data into a structured format, and save it as a CSV file with appropriate headers.
Pro tip: Provide details about the data source format and the specific information you need.

Dashboard Creation

Generate code for interactive data dashboards.

Create a Python script using Dash or Streamlit to build an interactive dashboard for COVID-19 data analysis. Include time series charts of cases/deaths, geographical visualization, key metrics, comparison tools, and filters for different countries and date ranges.
Pro tip: Specify which dashboard library you prefer and all required components.

A/B Test Analysis

Generate code to analyze experimental results.

Write R or Python code to analyze the results of an A/B test comparing two website designs. The data includes user IDs, group assignment (A or B), conversion (boolean), and time spent on site. Calculate the statistical significance of differences in conversion rate and provide visualizations to communicate the results.
Pro tip: Describe the metrics you’re comparing and the format of your experimental data.

Natural Language Processing

Generate code for text analysis tasks.

Create a Python script that analyzes customer reviews to extract sentiment, common topics, and key phrases. Use appropriate NLP libraries, implement text preprocessing, sentiment analysis, topic modeling, and visualization of the results. The output should help identify product issues and customer satisfaction trends.
Pro tip: Specify the exact NLP tasks and what insights you’re looking to extract.

ETL Pipeline

Generate code for data extraction, transformation, and loading processes.

Write Python code for an ETL pipeline that extracts data from a MongoDB database, transforms it by cleaning missing values and aggregating by customer, and loads it into a PostgreSQL database. Include error handling, logging, and make it schedulable via cron or Airflow.
Pro tip: Detail the source and destination data structures and all required transformations.

Business Writing

Prompts for creating professional business content and communications.

Executive Summary

Generate concise summaries of longer business documents.

Write an executive summary for a 20-page market research report on the electric vehicle industry. The report covers market growth projections (15% CAGR over 5 years), key players (Tesla, VW Group, BYD), regulatory trends, and consumer adoption barriers. Keep the summary under 500 words while capturing all critical insights and recommendations.
Pro tip: Provide the key points that must be included and specify the desired length.

Business Proposal

Create professional proposals for specific business opportunities.

Write a business proposal for a digital marketing agency pitching services to a mid-sized retail chain looking to increase online sales. Include an understanding of their challenges, proposed services (SEO, PPC, social media), expected outcomes, timeline, pricing structure, and why your agency is uniquely qualified. Use persuasive but professional language.
Pro tip: Specify the industry, target client, services offered, and unique selling points.

Professional Email

Generate effective emails for various business scenarios.

Write a professional email to a client who has missed their payment deadline by two weeks. This is a valued long-term client who has never missed a payment before. Strike a balance between firmness about the payment requirement and maintaining the good relationship. Include a clear call to action.
Pro tip: Describe the relationship context and the specific tone needed (formal, friendly, urgent).

Meeting Agenda

Create structured agendas for different types of meetings.

Create a detailed agenda for a quarterly strategic planning meeting for a software company’s leadership team. The meeting will be 3 hours long and needs to cover: Q2 performance review, product roadmap updates, competitive analysis, resource allocation for Q3, and team structure changes. Include time allocations, discussion questions, and required pre-work for participants.
Pro tip: Specify meeting duration, participants, and all topics that need to be covered.

SWOT Analysis

Generate structured analysis of strengths, weaknesses, opportunities, and threats.

Conduct a SWOT analysis for a small bakery considering expansion to a second location in a neighboring town. The bakery has strong local brand recognition, award-winning products, but limited management bandwidth and increasing ingredient costs. The new location has higher foot traffic but also three established competitors.
Pro tip: Provide specific details about the business and its current situation for a more accurate analysis.

Job Description

Create detailed and effective job postings.

Write a job description for a Senior UX Designer position at a fintech startup. The ideal candidate needs 5+ years of experience, expertise in design systems, financial application design experience, and strong research skills. Include responsibilities, requirements, benefits, and company culture information. Make it both appealing to candidates and specific about expectations.
Pro tip: Specify required experience, skills, and any unique aspects of the role or company.

Customer Service Response

Generate professional responses to customer inquiries or complaints.

Write a response to a customer who left a negative review complaining about shipping delays and poor communication for an e-commerce business. The delay was caused by an unexpected supplier issue, but the communication failure was an internal oversight. Apologize appropriately, explain without making excuses, and offer a specific remedy to rebuild trust.
Pro tip: Specify what caused the issue and what remedies you’re willing to offer.

Marketing Copy

Create persuasive content for marketing materials.

Write marketing copy for a landing page promoting a new productivity app for remote teams. The app’s key features include real-time collaboration, automated task prioritization using AI, and integration with major work tools. The target audience is team managers at medium to large companies. Focus on benefits rather than just features and include a compelling call to action.
Pro tip: Describe the product features, target audience, and desired tone (professional, conversational, etc.).

Business Plan Section

Generate specific sections of a business plan.

Write the market analysis section of a business plan for a new meal prep delivery service targeting health-conscious professionals in urban areas. Include market size, growth trends, customer demographics, competitor analysis, regulatory considerations, and how this business will differentiate itself. Use data-driven language and maintain a professional tone.
Pro tip: Specify which section you need and provide relevant details about the business concept.

Press Release

Create professional announcements for media distribution.

Write a press release announcing a tech company’s new AI-powered customer service platform that reduces resolution times by 40%. The company has secured $5M in funding and has partnerships with two Fortune 500 companies already using the platform. Include a compelling headline, dateline, company information, quotes from the CEO, and contact information.
Pro tip: Include all key facts, figures, and quotes that should appear in the release.

Educational

Prompts for creating learning materials, explanations, and educational content.

Concept Explanation

Generate clear explanations of complex topics for different audiences.

Explain quantum computing to three different audiences: 1) a 10-year-old child, 2) a high school student with basic physics knowledge, and 3) a computer science undergraduate. For each explanation, use appropriate analogies, vocabulary, and depth while maintaining accuracy.
Pro tip: Specify the target audience’s background knowledge and the desired level of detail.

Lesson Plan

Create structured plans for teaching specific topics.

Create a detailed 60-minute lesson plan for teaching photosynthesis to 7th-grade students. Include learning objectives, a warm-up activity, main instruction with visual aids, a hands-on experiment, assessment method, and homework assignment. Align with Next Generation Science Standards and include accommodations for different learning styles.
Pro tip: Specify grade level, duration, and any specific educational standards to follow.

Practice Problems

Generate exercises with solutions for various subjects.

Create 5 calculus problems on integration by parts with varying difficulty levels. For each problem, provide a clear solution showing all steps, common mistakes students might make, and a tip for approaching similar problems. Make the problems relevant to real-world applications where possible.
Pro tip: Specify the exact topic, number of problems, and whether you want step-by-step solutions.

Study Guide

Create comprehensive review materials for exams or topics.

Create a study guide for an introductory macroeconomics course final exam. Cover key concepts including GDP calculation, fiscal policy, monetary policy, inflation, unemployment, and economic growth. Include definitions, formulas, graphs, example problems, and memory aids. Organize it in a way that shows connections between concepts.
Pro tip: List all topics that should be included and specify the format (bullet points, Q&A, etc.).

Historical Context

Provide background information on historical events or periods.

Provide historical context for the American Civil Rights Movement of the 1950s-60s. Include the social and political conditions that preceded it, key events and figures, opposition faced, legislative changes achieved, and its lasting impact on American society. Include a timeline of pivotal moments and their significance.
Pro tip: Specify the time period, geographical focus, and aspects you want emphasized.

Comparative Analysis

Generate comparisons between related concepts, theories, or works.

Create a comparative analysis of three major learning theories: Behaviorism, Cognitivism, and Constructivism. For each theory, explain the core principles, key theorists, view of how learning occurs, classroom applications, strengths, and limitations. Conclude with how these theories might be combined in modern educational practice.
Pro tip: List the specific items to compare and the aspects to address for each.

Experiment Design

Create scientific experiments for educational purposes.

Design a middle school science experiment that demonstrates the greenhouse effect using common household materials. Include a hypothesis, materials list, step-by-step procedure, safety precautions, expected results, explanation of the underlying science, and extension questions for further inquiry.
Pro tip: Specify the age group, available resources, and the scientific concept to demonstrate.

Language Learning Dialogue

Create conversations for language practice with translations and notes.

Create a dialogue in Spanish between two friends planning a weekend trip. The conversation should use common travel vocabulary, different verb tenses, and natural expressions. Provide the dialogue, English translation, vocabulary notes for key terms, and grammar explanations for complex structures. Target intermediate Spanish learners.
Pro tip: Specify the language, proficiency level, and any specific vocabulary or grammar to include.

Case Study

Generate detailed scenarios for analysis and discussion.

Create a business ethics case study about a technology company facing a dilemma regarding user privacy and data monetization. Include background information, the specific ethical dilemma, stakeholder perspectives, relevant ethical frameworks, discussion questions, and potential courses of action with their implications.
Pro tip: Describe the type of scenario, key issues to explore, and the learning objectives.

Educational Game Design

Create concepts for games that teach specific skills or knowledge.

Design an educational card game that teaches basic chemistry concepts to high school students. Include the game objective, components needed, detailed rules, how the game mechanics reinforce chemistry concepts (elements, compounds, reactions), scoring system, and 10 example cards. The game should be engaging while ensuring scientific accuracy.
Pro tip: Specify the subject, age group, and whether you want physical or digital game concepts.

Image Prompts

Prompts designed for text-to-image AI models to generate specific visual outputs.

Detailed Scene Description

Create rich, detailed prompts for generating complex scenes.

A cozy bookstore cafe at dusk, warm golden lighting spilling from windows onto a rain-slicked cobblestone street. Inside, vintage bookshelves reach the ceiling, a spiral staircase connects two floors, and customers read in worn leather armchairs. Steam rises from coffee cups, and a cat sleeps on a windowsill. Photorealistic style, shallow depth of field, soft lighting.
Pro tip: Include setting, time of day, lighting conditions, specific objects, and desired artistic style.

Character Design

Generate detailed character concepts with specific attributes.

A female elven ranger, mid-30s, with sharp features, piercing green eyes, and intricate silver tattoos flowing across her face. She has braided auburn hair with small leaves woven in, and wears layered leather armor in forest tones with a weathered cloak. She carries an ornate longbow and has a knowing, determined expression. Fantasy illustration style, dramatic lighting, detailed textures.
Pro tip: Describe physical attributes, clothing, expressions, poses, and the artistic style.

Product Visualization

Create prompts for realistic product renderings.

A minimalist smart home speaker with a cylindrical design in matte white ceramic. The device has a subtle light ring at the top that glows soft blue, and fabric texture covering the lower half. Place it on a modern wooden side table in a bright, Scandinavian-style living room. Product photography style with soft, natural lighting, shallow depth of field, and clean background.
Pro tip: Include product details, materials, setting, lighting, and photographic style.

Concept Art

Generate prompts for imaginative concept art of environments or objects.

Concept art of a futuristic floating city built on massive interconnected platforms above a polluted Earth. The architecture blends Art Deco elements with advanced technology, featuring gleaming spires, hanging gardens, and anti-gravity transport systems. Flying vehicles move between levels, and massive energy collectors harvest sunlight. Wide establishing shot, detailed, cinematic lighting, sci-fi illustration style.
Pro tip: Describe the concept in detail, including architectural style, technology, scale, and atmosphere.

Style Transfer

Create prompts that apply specific artistic styles to subjects.

A serene Japanese garden with a red maple tree, stone lanterns, and a small bridge over a koi pond, rendered in the style of Studio Ghibli animation. Use soft watercolor textures, gentle pastel colors, and the characteristic whimsical lighting and atmosphere that defines Ghibli films. Include small details like ripples in the water and leaves floating in the breeze.
Pro tip: Name the specific artistic style and describe its key characteristics (colors, textures, lighting).

Mood and Atmosphere

Create prompts focused on evoking specific emotions through imagery.

A solitary lighthouse on a rocky cliff during a violent storm at night. Massive waves crash against the rocks, and dark storm clouds swirl overhead illuminated by occasional lightning. The lighthouse beam cuts through the darkness and heavy rain. Create a sense of isolation, danger, and resilience. Dramatic, high-contrast lighting, photorealistic style with detailed textures of wet surfaces.
Pro tip: Name the emotion explicitly and include environmental elements that evoke that feeling.

Abstract Concept Visualization

Generate prompts that visualize abstract ideas or emotions.

A surreal visualization of the concept of ‘time passing’ showing a landscape split between seasons, with objects in various states of growth, decay, and transformation. Include clock elements melting or fragmenting, hourglasses, and human figures at different life stages. Use rich symbolism and dreamlike quality with a color palette transitioning from warm to cool tones. Inspired by Salvador Dali and Rob Gonsalves.
Pro tip: Name the abstract concept and suggest symbolic elements, color schemes, and artistic influences.

Composite Imagery

Create prompts that combine multiple elements in unexpected ways.

A half-underwater photography showing both above and below the water line of a tropical coral reef. Above: a small wooden boat, clear blue sky, and distant island. Below: vibrant coral formations, schools of colorful fish, and a sea turtle. The composition should be split horizontally across the middle with perfect clarity both above and below the waterline. Photorealistic style with natural lighting.
Pro tip: Clearly describe how elements should be combined and the composition you want.

Technical Illustration

Generate prompts for detailed technical or scientific visualizations.

A detailed cross-section technical illustration of a modern electric vehicle showing the battery system, electric motors, power electronics, cooling system, and passenger compartment. Label key components with thin lines pointing to each part. Use a clean, precise technical illustration style with a limited color palette on a white background, similar to technical documentation or engineering textbooks.
Pro tip: Specify the technical subject, viewpoint (cutaway, exploded view, etc.), labeling, and illustration style.

Sequential Imagery

Create prompts for images that tell a sequential story.

A four-panel sequential image showing the transformation of an urban lot across seasons: 1) Winter: an abandoned, snow-covered vacant lot with litter and chain-link fence. 2) Spring: people clearing debris and preparing soil for a community garden. 3) Summer: a thriving garden with vegetables, flowers, and people of diverse ages working together. 4) Fall: a community harvest festival with tables of food made from the garden produce. Consistent perspective across all panels, illustrative style with warm lighting.
Pro tip: Clearly number and describe each panel while maintaining consistent elements across the sequence.

Philosophy & Ethics

Prompts that explore philosophical concepts, ethical dilemmas, and thought experiments.

Ethical Dilemma Analysis

Explore complex ethical scenarios from multiple perspectives.

Analyze the trolley problem from utilitarian, deontological, and virtue ethics perspectives. Present the strongest arguments from each framework, address potential objections, and explain how different philosophical traditions might resolve the dilemma differently.
Pro tip: Specify which ethical frameworks you want considered for a more structured analysis.

Modern Philosophy Thought Experiment

Create new thought experiments to explore contemporary issues.

Design a thought experiment similar to the ‘Brain in a Vat’ that explores the ethical and philosophical implications of consciousness uploading. Include key questions, potential paradoxes, and what this reveals about personal identity.
Pro tip: Reference classic thought experiments as models if you want a similar structure.

Philosophical Dialogue

Generate a conversation between philosophers or philosophical viewpoints.

Write a dialogue between Nietzsche and Buddha discussing the nature of suffering, the meaning of life, and the concept of self. Make their positions authentic to their philosophical works while creating engaging interaction.
Pro tip: Name specific thinkers and topics to ensure the dialogue reflects their actual philosophical positions.

Applied Ethics Case Study

Analyze real-world ethical problems in specific domains.

Create a comprehensive ethical analysis of the use of predictive algorithms in criminal justice. Consider questions of fairness, accountability, transparency, potential biases, and competing values like public safety and individual rights.
Pro tip: Focusing on a specific industry or technology will yield more detailed ethical considerations.

Philosophical Concept Exploration

Deep dive into philosophical concepts and their implications.

Explore the concept of ‘authenticity’ across existentialist philosophy. Compare how Sartre, Heidegger, and Camus understood the term, its relationship to freedom and responsibility, and its relevance to contemporary life.
Pro tip: Ask for concrete examples that illustrate abstract concepts for better understanding.

Cross-Cultural Philosophy Comparison

Compare philosophical traditions from different cultures.

Compare Eastern and Western philosophical approaches to the concept of the self. Contrast Confucian, Buddhist, and Hindu conceptions with those of Descartes, Locke, and Hume. Identify key differences, similarities, and potential areas of integration.
Pro tip: Specify time periods for more historically accurate philosophical comparisons.

Philosophical Argument Reconstruction

Break down and analyze philosophical arguments.

Reconstruct Plato’s argument for the immortality of the soul from the Phaedo. Present it in premise-conclusion form, identify key assumptions, evaluate its logical validity, and assess its soundness from a contemporary perspective.
Pro tip: Request specific argument forms (syllogisms, inferences) for more structured responses.

Virtue Ethics Application

Apply virtue ethics to modern scenarios and character development.

Analyze what Aristotelian virtues would look like in the context of social media use. Identify potential vices of excess and deficiency, describe what virtuous moderation would involve, and how one might cultivate these virtues.
Pro tip: Name specific virtues you’re interested in exploring for more focused analysis.

Political Philosophy Design

Design political systems based on philosophical principles.

Design a political system that balances John Rawls’ principles of justice with libertarian concerns about individual freedom. Address governance structures, rights protections, economic arrangements, and how conflicts between values would be resolved.
Pro tip: Specify which aspects of governance (economy, rights, participation) you want emphasized.

Metaphysical Problem Analysis

Explore fundamental questions about reality and existence.

Examine the problem of free will versus determinism in light of modern neuroscience. Present compatibilist and incompatibilist positions, address how scientific findings challenge or support different views, and explore the implications for moral responsibility.
Pro tip: Connecting metaphysical questions to concrete implications helps make abstract concepts accessible.

Science & Technology

Prompts that explore scientific concepts, emerging technologies, and their implications.

Technology Impact Assessment

Evaluate the potential impacts of emerging technologies.

Assess the potential societal impacts of widespread brain-computer interfaces over the next 20 years. Consider implications for privacy, inequality, education, employment, mental health, and human relationships. Include both opportunities and risks.
Pro tip: Specifying a timeframe helps focus the analysis on near-term vs. long-term impacts.

Scientific Concept Explanation

Explain complex scientific concepts in accessible terms.

Explain quantum entanglement to a curious high school student. Use analogies, avoid unnecessary jargon, address common misconceptions, and explain why this phenomenon is significant to both physics and potentially future technologies.
Pro tip: Specifying your audience helps tailor the explanation to the appropriate level.

Interdisciplinary Research Proposal

Generate ideas connecting different scientific fields.

Develop a research proposal that combines neuroscience and artificial intelligence to address the problem of algorithmic bias. Include research questions, methodology, potential applications, and ethical considerations.
Pro tip: Name specific subfields within each discipline for more targeted connections.

Future Technology Scenario

Envision plausible future technological developments.

Describe a detailed scenario of how urban transportation might function in 2050, assuming significant advances in autonomous vehicles, renewable energy, and smart city infrastructure. Include technical details, economic models, and social adaptations.
Pro tip: Establishing constraints (like energy limitations or economic factors) creates more plausible scenarios.

Scientific Controversy Analysis

Explore multiple sides of scientific debates.

Analyze the scientific controversy surrounding geoengineering as a climate change solution. Present the strongest evidence and arguments from different perspectives, explain areas of consensus, remaining uncertainties, and the values informing different positions.
Pro tip: Request a focus on methodological differences to understand why scientists reach different conclusions.

Technology Ethics Framework

Develop ethical guidelines for emerging technologies.

Create an ethical framework for the development and deployment of emotion recognition AI. Include principles for consent, privacy, accuracy, potential misuse, vulnerable populations, and accountability measures for developers and users.
Pro tip: Referencing established ethical frameworks (like bioethics principles) provides useful structure.

Scientific Method Application

Apply scientific thinking to everyday questions.

Design a rigorous experiment to test whether plants grow better when talked to. Include hypothesis, variables, controls, measurement methods, potential confounding factors, and how you would analyze the results.
Pro tip: Focus on one specific question rather than broad topics for more detailed methodology.

Technology Accessible Design

Explore ways to make technology more inclusive.

Propose design principles and specific features that would make virtual reality technology accessible to users with visual impairments. Consider hardware, software, interaction methods, and how to provide equivalent experiences.
Pro tip: Focusing on specific disabilities leads to more concrete and useful design solutions.

Scientific History Analysis

Examine the history and development of scientific ideas.

Trace the historical development of our understanding of evolution from Darwin to modern genomics. Highlight key discoveries, paradigm shifts, controversies, and how multiple disciplines contributed to our current knowledge.
Pro tip: Requesting focus on social and political contexts provides richer historical analysis.

Speculative Biology

Imagine plausible alien or future organisms based on scientific principles.

Design a plausible ecosystem for a tidally-locked exoplanet (one side always facing its star) with Earth-like gravity and atmospheric composition. Describe 3-5 organisms, their adaptations, ecological niches, and relationships.
Pro tip: Establishing specific environmental constraints leads to more scientifically grounded creations.

Health & Wellness

Prompts focused on physical and mental health, fitness, nutrition, and overall wellbeing.

Habit Formation Strategy

Develop personalized approaches to building healthy habits.

Create a comprehensive 30-day plan to establish a daily meditation habit for a busy professional with anxiety. Include progression schedule, addressing common obstacles, tracking methods, environmental modifications, and motivation strategies based on behavioral science.
Pro tip: Specifying personality traits and lifestyle factors enables more tailored strategies.

Nutrition Education Guide

Create educational material about nutritional concepts.

Develop an accessible guide explaining macronutrients and micronutrients for someone new to nutrition science. Define key terms, explain functions in the body, recommended intake levels, common food sources, and signs of deficiency or excess.
Pro tip: Requesting visuals like charts or comparison tables can make complex nutrition information clearer.

Mental Health Resource Toolkit

Compile strategies and resources for managing mental health conditions.

Create a comprehensive toolkit for managing social anxiety, including cognitive-behavioral techniques, gradual exposure exercises, self-care practices, communication scripts, professional treatment options, and recommended books and apps.
Pro tip: Specifying severity level helps tailor strategies to appropriate intervention levels.

Exercise Program Design

Develop structured fitness plans for specific goals.

Design a 12-week strength training program for a 45-year-old beginner with lower back issues. Include progressive workouts, proper form guidance, modification options, recovery protocols, and how to track progress safely.
Pro tip: Detailed information about physical conditions and limitations results in safer program design.

Sleep Optimization Plan

Create strategies for improving sleep quality and habits.

Develop a comprehensive sleep improvement protocol for a night shift worker. Include timing strategies, environmental modifications, nutrition considerations, light exposure management, and relaxation techniques specifically adapted for irregular schedules.
Pro tip: Including both immediate interventions and long-term habit changes provides more actionable advice.

Wellness Challenge Creator

Design structured challenges to improve health behaviors.

Create a 21-day workplace wellness challenge focused on reducing sedentary behavior. Include daily micro-challenges, team and individual components, tracking mechanisms, realistic progression, and ways to sustain changes after the challenge ends.
Pro tip: Specifying the environment (workplace, home, school) helps tailor the challenge to realistic constraints.

Health Condition Management Guide

Compile lifestyle strategies for managing chronic conditions.

Develop a comprehensive lifestyle management guide for someone newly diagnosed with type 2 diabetes. Include nutrition principles, physical activity recommendations, stress management, sleep importance, medication adherence strategies, and monitoring practices.
Pro tip: Request focus on the psychological aspects of condition management for more holistic guidance.

Mind-Body Practice Script

Create guided scripts for relaxation and mind-body practices.

Write a 15-minute progressive muscle relaxation script specifically designed for tension headache relief. Include precise timing, breathing instructions, body scanning elements, and guidance for releasing specific head, neck, and shoulder muscle groups.
Pro tip: Specifying the intended outcome (stress relief, focus, sleep) helps tailor the practice appropriately.

Health Information Simplifier

Translate complex health information into accessible explanations.

Explain the autoimmune disease lupus to a newly diagnosed teenager and their family. Cover causes, common symptoms, treatment approaches, lifestyle factors, and what to expect in language that’s accurate but accessible without unnecessary medical jargon.
Pro tip: Requesting analogies or metaphors can make complex bodily processes more understandable.

Preventative Health Protocol

Develop comprehensive prevention strategies for health conditions.

Create a holistic heart disease prevention protocol for someone with a strong family history but no current symptoms. Include screening recommendations, dietary approaches, fitness components, stress management, sleep hygiene, and when to consult healthcare providers.
Pro tip: Specifying age and current health status helps customize prevention strategies appropriately.

Personal Development

Prompts focused on self-improvement, productivity, goal setting, and personal growth.

Life Vision Exercise

Create structured exercises for clarifying personal direction and purpose.

Design a comprehensive ‘future self’ visualization exercise with specific guided questions to help someone clarify their ideal life 10 years from now across career, relationships, personal growth, health, and contribution. Include reflection prompts and steps to translate insights into present-day decisions.
Pro tip: Including both aspirational and practical elements creates more actionable life visions.

Productivity System Design

Develop personalized productivity frameworks and workflows.

Create a customized productivity system for a creative professional who struggles with ADHD. Include task management methods, environment optimization, energy management techniques, accountability structures, and technology recommendations that accommodate attention challenges.
Pro tip: Specifying work type and cognitive style leads to more suitable productivity recommendations.

Personal Decision Framework

Develop structured approaches to making important life decisions.

Design a comprehensive decision-making framework for evaluating a major career change. Include methods for clarifying values, researching options, weighing tradeoffs, addressing risks, testing assumptions, managing emotions, and establishing review triggers after the decision.
Pro tip: Requesting a focus on managing decision biases leads to more objective frameworks.

Habit Stacking Blueprint

Create strategies for combining and establishing multiple related habits.

Develop a morning routine habit stack for a parent of young children that incorporates mindfulness, light exercise, planning, and self-care in under 30 minutes. Include implementation intention scripts, environment design tips, minimal effective doses, and contingency plans.
Pro tip: Specifying time constraints helps create realistic and sustainable habit combinations.

Personal Feedback System

Design methods for gathering and using feedback for personal growth.

Create a comprehensive personal feedback system for a mid-level manager to gather insights about their leadership style. Include self-assessment tools, structured questions for different stakeholders, anonymous collection methods, analysis frameworks, and action planning templates.
Pro tip: Focusing on specific skills or traits you want feedback on produces more actionable insights.

Values Clarification Exercise

Develop exercises to identify and prioritize personal values.

Design a multistage values clarification process that helps distinguish between inherited, aspirational, and actual core values. Include narrative exercises, prioritization methods, values-in-action assessments, conflict resolution frameworks, and alignment evaluation tools.
Pro tip: Requesting examples of how values manifest in daily decisions makes abstract values more concrete.

Resilience Building Protocol

Create structured approaches to developing personal resilience.

Develop a comprehensive resilience-building program for someone recovering from burnout. Include cognitive reframing techniques, boundary-setting frameworks, stress response regulation methods, social support activation strategies, and identity reconstruction exercises.
Pro tip: Specifying the type of adversity helps tailor resilience strategies to relevant challenges.

Personal Knowledge Management System

Design systems for capturing, organizing and using personal knowledge.

Create a comprehensive personal knowledge management system for a graduate student researching across multiple disciplines. Include information capture workflows, organization taxonomies, connection-making protocols, retrieval methods, and application frameworks.
Pro tip: Specifying your content types (articles, books, ideas) helps customize the system appropriately.

Conflict Resolution Script

Develop communication templates for navigating difficult conversations.

Create a comprehensive conflict navigation script template for addressing recurring conflicts with a defensive colleague. Include opening statements, perspective-taking prompts, needs articulation frameworks, solution generation models, and follow-up protocols.
Pro tip: Describing relationship dynamics and history helps tailor communication approaches effectively.

Identity Shift Framework

Design approaches for intentionally evolving personal identity.

Develop a framework for transitioning identity from ’employee’ to ‘entrepreneur’ during a career change. Include narrative revision exercises, belief examination tools, new behavior adoption strategies, social reinforcement methods, and environmental restructuring techniques.
Pro tip: Specifying both current and desired identities creates more targeted transition strategies.

Social & Cultural Analysis

Prompts that examine social phenomena, cultural trends, and human interactions.

Cultural Comparison Framework

Analyze differences and similarities between cultural practices and values.

Create a nuanced comparison of attitudes toward aging and elderly care in Japanese, American, and Brazilian cultures. Examine historical influences, value systems, family structures, economic factors, and how these manifest in contemporary practices and institutions.
Pro tip: Requesting analysis of specific practices rather than entire cultures yields more insightful comparisons.

Social Trend Analysis

Examine emerging social trends and their potential implications.

Analyze the growing ‘digital nomad’ lifestyle trend. Explore its economic drivers, technological enablers, demographic patterns, environmental impacts, effects on local communities, potential future developments, and what it reveals about changing values toward work and place.
Pro tip: Requesting both macro (societal) and micro (individual) perspectives provides more comprehensive analysis.

Subculture Deep Dive

Examine specific subcultures and their practices, values, and dynamics.

Provide a comprehensive analysis of the mechanical keyboard enthusiast subculture. Examine its history, key practices, specialized language, status markers, community structures, economic ecosystem, and relationship to broader technology culture.
Pro tip: Focusing on specific elements like language, rituals, or values yields deeper subcultural insights.

Social Institution Comparative Analysis

Compare how social institutions function across different contexts.

Compare higher education systems in Germany, South Korea, and the United States. Analyze funding models, access patterns, curriculum approaches, cultural purposes, student experiences, and relationships to employment markets and social mobility.
Pro tip: Specifying evaluation criteria helps focus institutional comparisons on relevant dimensions.

Intergenerational Dialogue Construction

Create frameworks for understanding across generational divides.

Design a structured dialogue process for Baby Boomers and Gen Z to explore different perspectives on work ethics and career expectations. Include key discussion questions, perspective-taking exercises, shared value identification methods, and collaborative problem-solving frameworks.
Pro tip: Focusing on specific issues rather than general generational differences leads to more productive dialogue.

Ritual Analysis Framework

Examine the functions and meanings of social and cultural rituals.

Analyze modern graduation ceremonies as social rituals. Examine their symbolic elements, historical evolution, social functions, economic aspects, emotional impacts, power dynamics, and how they compare to other transition rituals across cultures.
Pro tip: Requesting comparisons between traditional and emerging forms of the same ritual reveals cultural shifts.

Cross-Cultural Communication Guide

Develop strategies for effective communication across cultural differences.

Create a practical guide for American business professionals working with Japanese counterparts. Include communication style differences, nonverbal interpretation frameworks, hierarchy navigation strategies, conflict resolution approaches, and relationship-building best practices.
Pro tip: Focusing on specific contexts (business, education, healthcare) yields more practical communication guidance.

Social Movement Comparative Analysis

Analyze the development, strategies, and impacts of social movements.

Compare the environmental movements in India, Germany, and Kenya. Analyze their historical development, key organizations, tactical approaches, messaging strategies, policy impacts, and relationships with other social justice concerns.
Pro tip: Requesting analysis of specific campaigns rather than entire movements provides more detailed insights.

Media Representation Analysis

Examine how groups or concepts are portrayed in media and entertainment.

Analyze the evolution of disability representation in mainstream television from the 1990s to the present. Examine changing narrative patterns, character development approaches, actor inclusion, production practices, audience reception, and impacts on public perception.
Pro tip: Narrowing to specific media formats or time periods allows for more detailed representation analysis.

Social Identity Construction Framework

Explore how identities are formed, maintained, and transformed.

Analyze how professional identities are constructed and maintained among emergency medical workers. Examine training socialization, language practices, symbolic markers, boundary maintenance, coping mechanisms, and how these relate to self-concept and group cohesion.
Pro tip: Focusing on specific identity aspects rather than whole identities produces more nuanced analysis.

Food & Cooking

Prompts related to culinary techniques, recipe development, food culture, and dietary approaches.

Recipe Adaptation Framework

Transform recipes to accommodate different dietary needs or preferences.

Adapt a traditional beef bourguignon recipe for a plant-based diet while preserving the depth of flavor and texture. Explain ingredient substitutions with ratios, technique modifications, nutrition considerations, and why each change works from a food science perspective.
Pro tip: Specifying which aspects of the original dish are most important helps preserve the essence while adapting.

Culinary Technique Mastery Guide

Detailed instructions for mastering specific cooking methods.

Create a comprehensive guide to pan-searing proteins to restaurant quality. Include equipment selection, temperature management, timing techniques, testing methods, troubleshooting common issues, and variations for different proteins from fish to tofu.
Pro tip: Asking for common mistakes and how to correct them makes technique guides more practical.

Flavor Pairing Analysis

Explore complementary flavor combinations and their principles.

Analyze why chocolate pairs well with certain ingredients. Explore its compatibility with chili, orange, mint, and sea salt from both chemical and cultural perspectives. Explain the underlying flavor compounds, contrasting elements, and cultural origins of these pairings.
Pro tip: Focusing on a specific ingredient as the base yields more in-depth pairing analyses.

Culinary Cultural History

Explore the historical and cultural development of dishes or ingredients.

Trace the historical journey of noodles from their origins through their spread and adaptation across Asian, Middle Eastern, and European cuisines. Analyze technological developments, cultural exchanges, regional adaptations, and how economic factors shaped their evolution.
Pro tip: Narrowing geographic focus or time period allows for more detailed culinary history.

Food Science Explanation

Explain the scientific principles behind cooking phenomena.

Explain the science behind bread baking, including gluten development, fermentation processes, Maillard reactions, starch gelatinization, and moisture management. Include how these processes affect texture, flavor, and shelf life, with troubleshooting for common issues.
Pro tip: Requesting practical applications of the science leads to more useful explanations.

Seasonal Menu Planning

Develop cohesive menus based on seasonal ingredients and themes.

Create a complete early autumn dinner party menu for 8 people featuring local, seasonal ingredients from the northeastern United States. Include cocktails, appetizers, main course, sides, and dessert with a cohesive flavor story and make-ahead preparation timeline.
Pro tip: Specifying dietary restrictions and equipment limitations helps create realistic menus.

Cooking Method Comparison

Analyze different cooking techniques for specific ingredients.

Compare five methods for cooking eggplant (grilling, roasting, frying, steaming, and braising), analyzing how each affects flavor, texture, appearance, nutrition, and best culinary applications. Include optimal execution tips for each method.
Pro tip: Requesting specific evaluation criteria helps create more structured cooking method comparisons.

Ingredient Substitution Guide

Comprehensive frameworks for replacing ingredients in recipes.

Create a detailed sugar substitution guide for baking that covers honey, maple syrup, coconut sugar, stevia, monk fruit, and artificial sweeteners. Include conversion ratios, texture impacts, flavor profiles, recipe adjustments needed, and best applications for each.
Pro tip: Focusing on a specific category of ingredients creates more thorough substitution guides.

Food Preservation Tutorial

Instructions for various food preservation methods.

Develop a comprehensive guide to fermenting vegetables at home. Include equipment recommendations, food safety protocols, basic process steps, troubleshooting common issues, storage guidelines, and specific recipes for kimchi, sauerkraut, and pickled carrots.
Pro tip: Requesting information about shelf life and storage methods creates more practical preservation guides.

Global Cooking Technique Adaptation

Adapt cooking techniques from various cultures to different contexts.

Explain how to adapt traditional Chinese wok cooking techniques for Western home kitchens with electric stoves. Address equipment alternatives, heat management strategies, ingredient substitutions, timing adjustments, and how to achieve authentic flavors despite limitations.
Pro tip: Being specific about available equipment and ingredients leads to more practical adaptations.

Marketing & Branding

Prompts focused on marketing strategies, brand development, customer engagement, and promotion.

Brand Voice Development

Create distinctive and consistent communication styles for brands.

Develop a comprehensive brand voice guide for a sustainable outdoor apparel company targeting environmentally conscious millennials. Include personality attributes, tone spectrum for different situations, vocabulary preferences, sample messaging across platforms, and do’s and don’ts with examples.
Pro tip: Providing competitor examples helps create more distinctive brand voice guidelines.

Customer Persona Creation

Develop detailed profiles of target customer segments.

Create a detailed customer persona for a premium home fitness app targeting busy professionals in their 30-40s. Include demographic details, psychographic profiles, goals and pain points, media consumption habits, purchasing behaviors, and day-in-the-life narrative.
Pro tip: Requesting both emotional and functional needs creates more three-dimensional customer personas.

Marketing Campaign Concept

Develop conceptual frameworks for multi-channel marketing initiatives.

Develop a comprehensive marketing campaign concept for launching a new plant-based protein product to health-conscious consumers who aren’t vegetarian. Include campaign theme, key messaging, visual direction, channel strategy, content pillars, and success metrics.
Pro tip: Specifying campaign objectives (awareness, conversion, loyalty) helps focus the strategic approach.

Content Strategy Framework

Create structured approaches to content development and distribution.

Design a 3-month content strategy for a B2B software company targeting financial institutions. Include content pillars, format mix, channel distribution, repurposing framework, engagement tactics, lead nurturing integration, and measurement approach.
Pro tip: Specifying the buyer journey stages you want to target creates more focused content strategies.

Brand Storytelling Framework

Develop narrative structures for authentic brand stories.

Create a brand storytelling framework for a family-owned restaurant celebrating its 25th anniversary. Include origin story structure, key narrative themes, character archetypes, conflict and resolution elements, and how to adapt the core story across different channels.
Pro tip: Providing information about brand history and values leads to more authentic storytelling frameworks.

Value Proposition Development

Craft compelling statements of customer value and differentiation.

Develop three potential value proposition statements for a premium virtual assistant service targeting small law firms. Include the core benefit focus, differentiation elements, proof points for each, and evaluation criteria to determine the strongest option.
Pro tip: Requesting competitive analysis integration creates more distinctive value propositions.

Social Media Content Calendar

Create structured plans for social media content.

Design a monthly social media content calendar for a local fitness studio across Instagram and Facebook. Include content categories, posting frequency, engagement tactics, user-generated content integration, promotional balance, and seasonal themes for January.
Pro tip: Specifying business objectives for social channels helps align content with strategic goals.

Rebranding Strategy Framework

Develop approaches for refreshing or transforming brand identities.

Create a comprehensive rebranding strategy framework for a 15-year-old financial services company looking to appear more innovative and accessible to younger clients. Include assessment methods, stakeholder management, elements to preserve, implementation phasing, and launch approach.
Pro tip: Clarifying what should change versus what should remain consistent creates more strategic rebranding plans.

Customer Journey Mapping

Visualize and optimize the customer experience across touchpoints.

Develop a detailed customer journey map for someone purchasing a major kitchen appliance online. Include research, consideration, purchase, delivery, first use, and support phases with emotions, touchpoints, pain points, opportunities, and optimization recommendations for each stage.
Pro tip: Focusing on specific customer segments creates more accurate and actionable journey maps.

Brand Extension Evaluation Framework

Assess potential new product or service lines for brand fit.

Create an evaluation framework for a premium coffee shop chain considering launching packaged coffee products in grocery stores. Include brand alignment criteria, market opportunity assessment, cannibalization risk, operational feasibility, and financial potential dimensions.
Pro tip: Including both quantitative and qualitative evaluation criteria provides more balanced assessment.

Travel & Adventure

Prompts related to travel planning, cultural exploration, outdoor adventures, and unique experiences.

Immersive Travel Itinerary

Create detailed travel plans focused on cultural immersion.

Design a 10-day immersive cultural itinerary for Oaxaca, Mexico that goes beyond tourist highlights. Include authentic food experiences, artisan workshops, local festivals or events, meaningful cultural exchanges, lesser-known natural sites, and suggested Spanish phrases for each interaction.
Pro tip: Specifying interests (art, history, food) helps create more personalized immersive itineraries.

Adventure Activity Guide

Comprehensive guides for outdoor and adventure activities.

Create a comprehensive guide for a first-time backpacker planning a 3-day trip in mountain terrain. Include gear selection principles, packing strategy, navigation basics, camp setup, food planning, water management, safety protocols, and leave-no-trace practices.
Pro tip: Specifying fitness level and experience creates more appropriate adventure recommendations.

Cultural Etiquette Briefing

Prepare travelers for cultural norms and expectations.

Develop a cultural etiquette briefing for business travelers to Japan. Include greeting protocols, gift-giving customs, dining etiquette, meeting behaviors, communication styles, relationship-building expectations, and key faux pas to avoid with recovery strategies.
Pro tip: Focusing on specific contexts (business, homestay, religious sites) creates more relevant guidance.

Budget Travel Optimization

Strategies for maximizing experiences while minimizing costs.

Create a comprehensive budget travel guide for exploring Southeast Asia for one month on $2000 (excluding flights). Include accommodation strategies, transportation optimization, food approaches, experience prioritization, money management, and country-specific cost considerations.
Pro tip: Specifying travel style preferences helps balance comfort and cost in budget recommendations.

Local Experience Curation

Discover authentic local experiences beyond typical tourist activities.

Curate a collection of 10 authentic local experiences in Barcelona that most tourists miss. For each, include what makes it culturally significant, best timing, local etiquette tips, how to access it independently, and phrases in Catalan/Spanish that would enhance the experience.
Pro tip: Requesting experiences in specific neighborhoods leads to more discoverable local recommendations.

Themed Journey Planning

Create travel itineraries around specific themes or interests.

Design a 14-day literary-themed journey through the United Kingdom for book lovers. Include sites associated with famous authors, unique bookstores, literary museums, writing workshops, locations that inspired classic works, and recommended reading to enhance each experience.
Pro tip: Narrowing the theme specificity (gothic literature vs. all literature) creates more focused journeys.

Responsible Tourism Framework

Develop approaches for minimizing negative impacts while traveling.

Create a comprehensive responsible tourism guide for visiting indigenous communities in Central America. Include research preparation, appropriate compensation practices, photography ethics, cultural preservation considerations, environmental impact minimization, and meaningful exchange creation.
Pro tip: Focusing on specific destinations provides more actionable responsibility guidelines.

Family Travel Strategy

Plan enriching travel experiences that accommodate multiple generations.

Develop a strategy for a 7-day intergenerational family trip to Costa Rica with ages 5-75. Include activity pacing, accommodation considerations, contingency planning, age-appropriate engagement methods, memory-making opportunities, and conflict prevention approaches.
Pro tip: Providing specific information about mobility issues or interests helps tailor family recommendations.

Culinary Tourism Roadmap

Plan travel experiences centered around food and culinary traditions.

Create a 5-day culinary exploration itinerary for Sicily that traces the island’s diverse cultural influences. Include market visits, cooking experiences, producer tours, signature dishes, historical context for regional specialties, and wine pairings with cultural significance.
Pro tip: Requesting focus on specific aspects (street food, fine dining, agriculture) creates more specialized culinary journeys.

Transformational Travel Design

Plan journeys focused on personal growth and perspective shifts.

Design a 10-day transformational journey to Peru for someone seeking perspective after a major life transition. Include mindfulness practices, cultural exchange opportunities, challenging but meaningful experiences, reflection prompts, and methods to integrate insights after returning home.
Pro tip: Sharing the specific transformation sought creates more purposeful journey recommendations.

Environmental Issues

Prompts exploring sustainability, conservation, climate solutions, and environmental challenges.

Environmental Solution Assessment

Evaluate approaches to addressing environmental challenges.

Analyze vertical farming as a solution for sustainable urban food production. Assess current technologies, environmental benefits and drawbacks, economic viability, scalability challenges, social implications, and comparison with alternative approaches.
Pro tip: Requesting both optimistic and pessimistic perspectives creates more balanced solution assessments.

Sustainability Framework Development

Create structured approaches to sustainability implementation.

Develop a comprehensive sustainability framework for a medium-sized food manufacturer. Include governance structures, priority assessment methods, goal-setting processes, measurement approaches, stakeholder engagement strategies, and implementation roadmap with key milestones.
Pro tip: Specifying industry contexts creates more relevant and actionable sustainability frameworks.

Environmental Communication Strategy

Develop approaches for effectively communicating environmental issues.

Create a communication strategy for engaging suburban homeowners on watershed protection. Include message framing, barrier identification, behavior change triggers, visual approaches, community-based tactics, and methods for making abstract impacts tangible.
Pro tip: Specifying audience values and priorities helps create more persuasive environmental messaging.

Circular Economy Innovation

Generate ideas for reducing waste through circular systems.

Develop circular economy innovations for the footwear industry. Include materials recapture systems, product design transformations, business model adaptations, consumer engagement approaches, supply chain modifications, and implementation phasing for transitioning from linear models.
Pro tip: Focusing on specific product categories creates more detailed circular economy recommendations.

Environmental Justice Analysis

Examine the intersection of environmental issues and social equity.

Analyze environmental justice dimensions of urban heat island effects in major U.S. cities. Examine historical development patterns, current temperature and health disparities, contributing policies, community impacts, existing interventions, and potential equity-centered solutions.
Pro tip: Focusing on specific communities or locations creates more grounded environmental justice analyses.

Sustainable Lifestyle Transition

Create practical approaches for adopting more sustainable habits.

Develop a comprehensive 6-month plan for a suburban family transitioning to a lower-waste lifestyle. Include baseline assessment methods, prioritization framework, room-by-room transformations, shopping alternatives, family engagement tactics, and progress tracking systems.
Pro tip: Including both high-impact and easy-win changes creates more motivating sustainability plans.

Ecological Restoration Design

Develop approaches for restoring damaged ecosystems.

Create a framework for restoring an urban stream that has been channelized in concrete. Include assessment methodology, stakeholder engagement approach, phased intervention design, native species selection principles, community participation opportunities, and monitoring protocols.
Pro tip: Specifying the ecosystem type and degradation factors leads to more relevant restoration approaches.

Climate Adaptation Strategy

Develop approaches for adapting to climate change impacts.

Design a climate adaptation strategy for a coastal community facing sea level rise and increased storm intensity. Include vulnerability assessment methods, infrastructure modifications, retreat considerations, economic transition planning, and governance approaches.
Pro tip: Providing specific geographic and socioeconomic context creates more relevant adaptation strategies.

Conservation Education Program

Design educational initiatives about environmental protection.

Develop a comprehensive conservation education program about local pollinators for elementary school students. Include age-appropriate learning objectives, hands-on activities, outdoor components, assessment methods, family engagement elements, and community connection opportunities.
Pro tip: Specifying learning environments (classroom, nature center, online) helps tailor educational approaches.

Environmental Impact Assessment

Analyze the environmental effects of products, policies, or activities.

Create an environmental impact assessment framework for music festivals. Include energy use, transportation, waste generation, water consumption, land impact, noise pollution, local ecosystem effects, and recommendations for measurement and mitigation approaches.
Pro tip: Requesting both direct and indirect impact analysis creates more comprehensive assessments.

Psychology & Human Behavior

Prompts exploring cognitive processes, behavioral patterns, emotional intelligence, and social dynamics.

Cognitive Bias Analysis

Examine how cognitive biases affect decision-making and perceptions.

Analyze how confirmation bias influences political polarization. Explain the psychological mechanisms involved, how social media amplifies this bias, real-world consequences, evidence from research studies, and potential interventions at individual and platform levels.
Pro tip: Focusing on specific contexts (workplace, relationships, health) creates more applicable bias analyses.

Psychological Framework Application

Apply psychological theories to understand specific behaviors or phenomena.

Apply attachment theory to explain patterns in adult romantic relationships. Include the four attachment styles, their developmental origins, characteristic behaviors, impact on conflict resolution, healing approaches, and recent research developments in this field.
Pro tip: Requesting multiple theoretical perspectives provides more comprehensive psychological analysis.

Behavior Change Strategy

Develop evidence-based approaches to modifying habits and behaviors.

Create a comprehensive behavior change strategy for reducing smartphone overuse based on psychological principles. Include habit loop analysis, environmental modification tactics, replacement behavior development, cognitive restructuring techniques, and accountability systems.
Pro tip: Specifying the target population helps tailor behavior change strategies to relevant motivations and barriers.

Emotional Intelligence Development

Create frameworks for understanding and improving emotional capabilities.

Design a progressive emotional intelligence development program for technical professionals. Include self-awareness assessment methods, emotion regulation techniques, empathy-building exercises, practical workplace applications, and measurement approaches.
Pro tip: Focusing on specific EI components (recognition, regulation, empathy) creates more targeted development plans.

Psychological Safety Framework

Develop approaches for creating environments of trust and openness.

Create a comprehensive framework for building psychological safety in product development teams during periods of organizational change. Include leader behaviors, meeting practices, feedback mechanisms, conflict navigation approaches, and measurement methods.
Pro tip: Specifying organizational context and challenges helps create more relevant psychological safety strategies.

Motivation System Design

Create structures to enhance motivation and engagement.

Design a motivation system for a long-term health behavior program based on self-determination theory. Include autonomy support mechanisms, competence development approach, relatedness cultivation strategies, intrinsic/extrinsic balance considerations, and individualization frameworks.
Pro tip: Requesting incorporation of specific motivational theories creates more evidence-based systems.

Persuasion Ethics Framework

Examine ethical considerations in influence and persuasion.

Develop an ethical framework for persuasive design in mental health applications. Include boundary principles between encouragement and manipulation, transparency requirements, autonomy preservation methods, vulnerable population considerations, and application evaluation criteria.
Pro tip: Focusing on specific contexts (marketing, healthcare, politics) creates more relevant ethical frameworks.

Group Dynamic Analysis

Examine patterns of interaction and influence in groups.

Analyze group dynamics in cross-functional teams with significant power imbalances. Examine communication patterns, decision-making processes, conflict manifestations, status behavior, psychological safety challenges, and evidence-based interventions to improve collaboration.
Pro tip: Specifying group composition and purpose helps create more relevant dynamic analyses.

Decision-Making Process Optimization

Improve how decisions are made based on psychological principles.

Design a decision-making process for complex healthcare decisions involving multiple stakeholders. Include cognitive bias mitigation techniques, emotion integration methods, stakeholder input frameworks, tradeoff evaluation approaches, and post-decision review protocols.
Pro tip: Clarifying decision types (high-stakes, frequent, technical) helps tailor appropriate processes.

Psychological Need Assessment

Identify core psychological needs in specific contexts.

Create a comprehensive assessment framework for evaluating how well remote work environments fulfill employees’ core psychological needs. Include autonomy, competence, relatedness, meaning, security dimensions with measurement approaches and enhancement recommendations.
Pro tip: Specifying demographic factors helps identify more relevant psychological needs and priorities.

Final Thoughts

The AI prompt examples provided are just starting points. As you become more familiar with AI systems, you’ll develop your own style and approach to prompt crafting. Remember that effective prompts are clear, specific, and provide the right amount of context.

Experiment with different formats, levels of detail, and instructions to find what works best for your specific use case. The field of prompt engineering is constantly evolving, so stay curious and keep refining your techniques.

With practice, you’ll be able to harness the full potential of AI tools, turning them into powerful extensions of your own creativity and problem-solving abilities.

The post AI Prompt Examples appeared first on AI Parabellum • Your Go-To AI Tools Directory for Success.

by: Daniel Schwarz
Tue, 25 Mar 2025 12:47:18 +0000


I came across this awesome article navigator by Jhey Tompkins:

It solved a UX problem I was facing on a project, so I’ve adapted it to the needs of an online course — a “course navigator” if you will — and built upon it. And today I’m going to pick it apart and show you how it all works:

You can see I’m imagining this as some sort of navigation that you might find in an online learning management system that powers an online course. To summarize what this component does, it:

  • links to all course lessons,
  • smoothly scrolls to anchored lesson headings,
  • indicates how much of the current lesson has been read,
  • toggles between light and dark modes, and
  • sits fixed at the bottom and collapses on scroll.

Also, while not a feature, we won’t be using JavaScript. You might think that’s impossible, but the spate of CSS features that have recently shipped make all of this possible with vanilla CSS, albeit using bleeding-edge techniques that are only fully supported by Chrome at the time I’m writing this. So, crack open the latest version and let’s do this together!

The HTML

We’re looking at a disclosure widget (the <details> element) pinned to the bottom of the page with fixed positioning. Behind it? A course lesson (or something of that effect) wrapped in an <article> with ids on the headings for same-page anchoring. Clicking on the disclosure’s <summary> toggles the course navigation, which is wrapped in a ::details-content pseudo-element. This navigation links to other lessons but also scrolls to the aforementioned headings of the current lesson.

The <summary> contains a label (since it functions as a toggle-disclosure button), the name of the current lesson, the distance scrolled, and a dark mode toggle.

With me so far?

<details>
  
  <!-- The toggle (flex →) -->
  <summary>
    <span><!-- Toggle label --></span>
    <span><!-- Current lesson + % read --></span>
    <label><!-- Light/dark-mode toggle --></label>
  </summary>
  
  <!-- ::details-content -->
    <!-- Course navigation -->
  <!-- /::details-content -->
    
</details>

<article>
  <h1 id="sectionA">Section A</h1>
  <p>...</p>
  <h2 id="sectionB">Section B</h2>
  <p>...</p>
  <h2 id="sectionC">Section C</h2>
  <p>...</p>
</article>

Getting into position

First, we’ll place the disclosure with fixed positioning so that it’s pinned to the bottom of the page:

details {
  position: fixed;
  inset: 24px; /* Use as margin */
  place-self: end center; /* y x */
}

Setting up CSS-only dark mode (the new way)

There are certain scenarios where dark mode is better for accessibility, especially for the legibility of long-form content, so let’s set that up.

First, the HTML. We have an ugly checkbox input that’s hidden thanks to its hidden attribute, followed by an <i> which’ll be a better-looking faux checkbox once we’ve sprinkled on some Font Awesome, followed by a <span> for the checkbox’s text label. All of this is then wrapped in an actual <label>, which is wrapped by the <summary>. We wrap the label’s content in a <span> so that flexbox gaps get applied between everything.

Functionally, even though the checkbox is hidden, it toggles whenever its label is clicked. And on that note, it might be a good idea to place an explicit aria-label on this label, just to be 100% sure that screen readers announce a label, since implicit labels don’t always get picked up.

<details>

  <summary>
    
    <!-- ... -->
        
    <label aria-label="Dark mode">
      <input type="checkbox" hidden>
      <i></i>
      <span>Dark mode</span>
    </label>
        
  </summary>
    
  <!-- ... -->
  
</details>

Next we need to put the right icons in there, subject to a little conditional logic. Rather than use Font Awesome’s HTML classes and have to mess around with CSS overwrites, we’ll use Font Awesome’s CSS properties with our rule logic, as follows:

If the <i> element is followed by (notice the next-sibling combinator) a checked checkbox, we’ll display a checked checkbox icon in it. If it’s followed by an unchecked checkbox, we’ll display an unchecked checkbox icon in it. It’s still the same rule logic even if you don’t use Font Awesome.

/* Copied from Font Awesome’s CSS */
i::before {
  font-style: normal;
  font-family: "Font Awesome 6 Free";
  display: inline-block;
  width: 1.25em; /* Prevents content shift when swapping to differently sized icons by making them all have the same width (this is equivalent to Font Awesome’s .fa-fw class) */
}

/* If followed by a checked checkbox... */
input[type=checkbox]:checked + i::before {
  content: "\f058";
  font-weight: 900;
}

/* If followed by an unchecked checkbox... */
input[type=checkbox]:not(:checked) + i::before {
  content: "\f111";
  font-weight: 400;
}

We need to implement the modes at the root level (again, using a little conditional logic). If the root :has the checked checkbox, apply color-scheme: dark. If the root does :not(:has) the unchecked checkbox, then we apply color-scheme: light.

/* If the root has a checked checkbox... */
:root:has(input[type=checkbox]:checked) {
  color-scheme: dark;
}

/* If the root does not have a checked checkbox... */
:root:not(:has(input[type=checkbox]:checked)) {
  color-scheme: light;
}

If you toggle the checkbox, your web browser’s UI will already toggle between light and dark color schemes. Now let’s make sure that our demo does the same thing using the light-dark() CSS function, which takes two values — the light mode color and then the dark mode color. You can utilize this function instead of any color data type (later on we’ll even use it within a conic gradient).

In the demo I’m using the same HSL color throughout but with different lightness values, then flipping the lightness values based on the mode:

color: light-dark(hsl(var(--hs) 90%), hsl(var(--hs) 10%));
background: light-dark(hsl(var(--hs) 10%), hsl(var(--hs) 90%));

I don’t think the light-dark() function is any better than swapping out CSS variables, but I don’t believe it’s any worse either. Totally up to you as far as which approach you choose.

Displaying scroll progress

Now let’s display the amount read as defined by the scroll progress, first, as what I like to call a “progress pie” and then, second, as a plain-text percentage. These’ll go in the middle part of the <summary>:

<details>

  <summary>
    
    <!-- ... -->
      
    <span>
      <span id="progress-pie"></span>
      <span>1. LessonA</span>
      <span id="progress-percentage"></span>
    </span>
        
    <!-- ... -->

  </summary>
    
  <!-- ... -->
    
</details>

What we need is to display the percentage and allow it to “count” as the scroll position changes. Normally, this is squarely in JavaScript territory. But now that we can define our own custom properties, we can establish a variable called --percentage that is formatted as an integer that defaults to a value of 0. This provides CSS with the context it needs to read and interpolate the value between 0 and 100, which is the maximum value we want to support.

So, first, we define the variable as a custom property:

@property --percentage {
  syntax: "<integer>";
  inherits: true;
  initial-value: 0;
}

Then we define the animation in keyframes so that the value of --percentage is updated from 0 to 100:

@keyframes updatePercentage {
  to {
    --percentage: 100;
  }
}

And, finally, we apply the animation on the root element:

:root {
  animation: updatePercentage;
  animation-timeline: scroll();
  counter-reset: percentage var(--percentage);
}

Notice what we’re doing here: this is a scroll-driven animation! By setting the animation-timeline to scroll(), we’re no longer running the animation based on the document’s timeline but instead based on the user’s scroll position. You can dig deeper into scroll timelines in the CSS-Tricks Almanac.

Since we’re dealing with an integer, we can target the ::before pseudo-element and place the percentage value inside of it using the content property and a little counter() hacking (followed by the percentage symbol):

#progress-percentage::before {
  content: counter(percentage) "%";
  min-width: 40px; display: inline-block; /* Prevents content shift */
}

The progress pie is just as straightforward. It’s a conic gradient made up of two colors that are positioned using 0% and the scroll percentage! This means that you’ll need that --percentage variable as an actual percentage, but you can convert it into such by multiplying it by 1% (calc(var(--percentage) * 1%))!

#progress-pie {
  aspect-ratio: 1;
  background: conic-gradient(hsl(var(--hs) 50%) calc(var(--percentage) * 1%), light-dark(hsl(var(--hs) 90%), hsl(var(--hs) 10%)) 0%);
  border-radius: 50%; /* Make it a circle */
  width: 17px; /* Same dimensions as the icons */
}

Creating a (good) course navigation

Now for the table contents containing the nested lists of lesson sections within them, starting with some resets. While there are more resets in the demo and more lines of code overall, two specific resets are vital to the UX of this component.

First, here’s an example of how the nested lists are marked up:

<details>

  <summary>
    <!-- ... -->
  </summary>
  
  <ol>
    <li class="active">
      <a>LessonA</a>
      <ol>
        <li><a href="#sectionA">SectionA</a></li>
        <li><a href="#sectionB">SectionB</a></li>
        <li><a href="#sectionC">SectionC</a></li>
      </ol>
    </li>
    <li><a>LessonB</a></li>
    <li><a>LessonC</a></li>
  </ol>
    
</details>

Let’s reset the list spacing in CSS:

ol {
  padding-left: 0;
  list-style-position: inside;
}

padding-left: 0 ensures that the parent list and all nested lists snap to the left side of the disclosure, minus any padding you might want to add. Don’t worry about the indentation of nested lists — we have something planned for those. list-style-position: inside ensures that the list markers snap to the side, rather than the text, causing the markers to overflow.

After that, we slap color: transparent on the ::markers of nested <li> elements since we don’t need the lesson section titles to be numbered. We’re only using nested lists for semantics, and nested numbered lists specifically because a different type of list marker (e.g., bullets) would cause vertical misalignment between the course’s lesson titles and the lesson section titles.

ol ol li::marker {
  color: transparent;
}

Finally, so that users can more easily traverse the current lesson, we’ll dim all list items that aren’t related to the current lesson. It’s a form of emphasizing something by de-emphasizing others:

details {
  /* The default color */
  color: light-dark(hsl(var(--hs) 90%), hsl(var(--hs) 10%));
}

/* <li>s without .active that’re direct descendants of the parent <ol> */
ol:has(ol) > li:not(.active) {
  /* A less intense color */
  color: light-dark(hsl(var(--hs) 80%), hsl(var(--hs) 20%));
}

/* Also */
a {
  color: inherit;
}

One more thing… those anchor links scroll users to specific headings, right? So, putting scroll-behavior: smooth on the root to enables smooth scrolling between them. And that percentage-read tracker that we created? Yep, that’ll work here as well.

:root {
  scroll-behavior: smooth; /* Smooth anchor scrolling */
  scroll-padding-top: 20px; /* A scroll offset, basically */
}

Transitioning the disclosure

Next, let’s transition the opening and closing of the ::details-content pseudo-element. By default, the <details> element snaps open and closed when clicked, but we want a smooth transition instead. Geoff recently detailed how to do this in a comprehensive set of notes about the <details> element, but we’ll break it down together.

First, we’ll transition from height: 0 to height: auto. This is a brand-new feature in CSS! We start by “opting into” the feature at the root level with interpolate-size: allow-keywords`:

:root {
  interpolate-size: allow-keywords;
}

I recommend setting overflow-y: clip on details::details-content to prevent the content from overflowing the disclosure as it transitions in and out:

details::details-content {
  overflow-y: clip;
}

Another option is sliding the content out and then fading it in (and vice-versa), but you’ll need to be quite specific about the transition’s setup.

First, for the “before” and “after” states, you’ll need to target both details[open] and details:not([open]), because vaguely targeting details and then overwriting the transitioning styles with details[open] doesn’t allow us to reverse the transition.

After that, slap the same transition on both but with different values for the transition delays so that the fade happens after when opening but before when closing.

Finally, you’ll also need to specify which properties are transitioned. We could simply put the all keyword in there, but that is neither performant nor allows us to set the transition durations and delays for each property. So we’ll list them individually instead in a comma-separated list. Notice that we’re specifically transitioning the content-visibility and using the allow-discrete keyword because it is a discrete property. this is why we opted into interpolate-size: allow-keywords earlier.

details:not([open])::details-content {
  height: 0;
  opacity: 0;
  padding: 0 42px;
  filter: blur(10px);
  border-top: 0 solid light-dark(hsl(var(--hs) 30%), hsl(var(--hs) 70%));
  transition:
    height 300ms 300ms, 
    padding-top 300ms 300ms, 
    padding-bottom 300ms 300ms, 
    content-visibility 300ms 300ms allow-discrete, 
    filter 300ms 0ms, 
    opacity 300ms 0ms;
}

details[open]::details-content {
  height: auto;
  opacity: 1;
  padding: 42px;
  filter: blur(0);
  border-top: 1px solid light-dark(hsl(var(--hs) 30%), hsl(var(--hs) 70%));
  transition: 
    height 300ms 0ms, 
    padding-top 300ms 0ms, 
    padding-bottom 300ms 0ms, 
    content-visibility 300ms 0ms allow-discrete, 
    filter 300ms 300ms, 
    opacity 300ms 300ms;
}

Giving the summary a label and icons

Preceding the current lesson’s title, percentage read, and dark mode toggle, the <summary> element needs a label that helps describe what it does. I went with “Navigate course” and included an aria-label saying the same thing so that screen readers didn’t announce all that other stuff.

<details>
  <summary aria-label="Navigate course">
    <span>
      <i></i>
      <span>Navigate course</span>
    </span>
    
    <!-- ... -->

  </summary>
  
  <!-- ... -->
</details>

In addition, the summary gets display: flex so that we can easily separate the three sections with a gap, which also removes the summary’s default marker, allowing you to use your own. (Again, I’m using Font Awesome in the demo.)

i::before {
  width: 1.25em;
  font-style: normal;
  display: inline-block;
  font-family: "Font Awesome 6 Free";
}

details i::before {
  content: "\f0cb"; /* fa-list-ol */
}

details[open] i::before {
  content: "\f00d"; /* fa-xmark */
}


/* For older Safari */
summary::-webkit-details-marker {
   display: none;
}

And finally, if you’re pro-cursor: pointer for most interactive elements, you’ll want to use it on the summary and manually make sure that the checkbox’s label inherits it, as it doesn’t do that automatically.

summary {
  cursor: pointer;
}

label {
  cursor: inherit;
}

Giving the disclosure an auto-closure mechanism

A tiny bit of JavaScript couldn’t hurt though, could it? I know I said this is a no-JavaScript deal, but this one-liner will automatically close the disclosure when the mouse leaves it:

document.querySelector("details").addEventListener("mouseleave", e => e.target.removeAttribute("open"));

Annoying or useful? I’ll let you decide.

Setting the preferred color scheme automatically

Setting the preferred color scheme automatically is certainly useful, but if you like to avoid JavaScript wherever possible, I don’t think users will be too mad for not offering this feature. Either way, the following conditional snippet checks if the user’s preferred color scheme is “dark” by evaluating the relevant CSS media query (prefers-color-scheme: dark) using window.matchMedia and matches. If the condition is met, the checkbox gets checked, and then the CSS handles the rest.

if (window.matchMedia("prefers-color-scheme: dark").matches) {
  document.querySelector("input[type=checkbox]").checked = true;
}

Recap

This has been fun! It’s such a blessing we can combine all of these cutting-edge CSS features, not just into one project but into a single component. To summarize, that includes:

  • a course navigator that shows the current lesson, all other lessons, and smooth scrolls between the different headings,
  • a percentage-scrolled tracker that shows the amount read in plain text and as a conic gradient… pie chart,
  • a light/dark-mode toggle (with some optional JavaScript that detects the preferred color scheme), and it is
  • all packed into a single, floating, animated, native disclosure component.

The newer CSS features we covered in the process:

  • Scroll-driven animations
  • interpolate-size: allow-keywords for transitioning between 0 and auto
  • smooth scrolling by way of scroll-behavior: smooth
  • dark mode magic using the light-dark() function
  • a progress chart made with a conic-gradient()
  • styling the ::details-content pseudo-element
  • animating the <details> element

Thanks to Jhey for the inspiration! If you’re not following Jhey on Bluesky or X, you’re missing out. You can also see his work on CodePen, some of which he has talked about right here on CSS-Tricks.


Case Study: Combining Cutting-Edge CSS Features Into a “Course Navigation” Component originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.