Skip to content
Notifications You must be signed in to change notification settings

giragon6/amphiptere-css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

411a093 · · Aug 15, 2025

History

21 Commits
Jul 31, 2025
Jul 31, 2025
Jul 31, 2025
Jul 31, 2025
Jul 31, 2025
Jul 31, 2025
Aug 15, 2025
Jul 30, 2025
Jul 31, 2025
Jul 31, 2025
Jul 28, 2025

Repository files navigation

Amphiptere CSS

A library for unique and visually engaging web components.

Current components:

  • Liquid Navbar: A navbar featuring a smoothly morphing SVG that "parts" around your navitems

Liquid Navbar component

Installation

Install via npm:

npm install amphiptere-css

Usage

Import a component in your project (ESM):

import 'amphiptere-css/dist/liquid-navbar.js';

Then use the custom element in your HTML:

liquid-navbar
   logo="/assets/amphiptere-css-logo.svg"
   items='[{"label":"Home","href":"/home","icon":"/assets/home.svg"}]'
   trailing='{"label":"Logout","href":"/logout","icon":"/assets/logout.svg"}'
   width="450"
   height="700"
   style="--navbar-background: linear-gradient(180deg, #232b6b 0%, #6a1e8a 100%); --nav-link-color: #fff;"

>gt;liquid-navbar>gt;
; height="700" style="--navbar-background: linear-gradient(180deg, #232b6b 0%, #6a1e8a 100%); --nav-link-color: #fff;" >navbar>" tabindex="0" role="button">

Customization

You can customize the look and feel using CSS custom properties:

Variable Description Example Value
--navbar-background Navbar background gradient/color linear-gradient(...)
--nav-link-color Nav link text color #fff
--nav-link-font-size Nav link font size 1.1rem
--nav-link-hover-filter Nav link hover filter brightness(0) ...
--nav-item-bg Nav item background color #fff
... ... ...

Storybook

Visit the live storybook demo page to view an interactive example

##Background

Why it was made

I saw this effect in a design mockup for a website and, while trying to recreate it, I realized that there wasn't a great way to accomplish it in the way I would want in native CSS. I decided to make the navbar a web component so it's modular and easily implemented in any projects that would like to use this effect without having to mess with SVGs for hours like I did.

How it was made

I created the basic shape in Figma then exported it to an online SVG editor to determine which points affected what. Then, I created functions to manipulate those points in a way that would allow the SVG to "wrap" around the navbar components before adding interpolation to make it all smooth.

Struggles

To manipulate the SVG, I first had to figure out what SVGs were and how they worked. I also had to manually find and edit each coordinate, which was extremely painful, but I learned a lot about the image format while doing it.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages