Skip to content

grybbit/percentage-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Percentage Splitter

A single-file browser-based tool for visually splitting a total value into named, colored chunks using an interactive drag slider.

Features

  • Interactive slider — drag handles between segments to adjust percentages in real time
  • Configurable chunks — set 2–20 named, color-coded chunks
  • Lock/unlock chunks — lock individual chunks to prevent them from being adjusted when others change
  • Direct input — edit each chunk's percentage or absolute value directly
  • Custom colors — pick any color per chunk via a color picker
  • Resizable slider — drag the edges of the slider bar to resize it horizontally or vertically
  • Save/load presets — save named setups to localStorage and reload them later
  • Overflow labels — narrow segments automatically pop their labels above the bar with connector lines and overlap resolution
  • Responsive layout — chunk info boxes auto-arrange to avoid overlapping

Usage

Open percentage-splitter.html in any modern browser — no server or install required.

  1. Set the Total Value (e.g. 1000)
  2. Set the Number of Chunks (2–20)
  3. Drag the white handles on the slider to adjust split percentages
  4. Rename chunks, change colors, or type values/percentages directly in the boxes below
  5. Lock a chunk with the 🔓 Lock button to pin its percentage while adjusting others
  6. Save your current setup with 💾 Save Current in the panel on the left; reload it any time

Keyboard / Input

Action How
Set total value Type in the Total Value field
Set chunk count Type in the Number of Chunks field
Edit a percentage Type in the Percent field of a chunk box, press Enter or Tab
Edit an absolute value Type in the Value field of a chunk box, press Enter or Tab
Rename a chunk Click the Name field in a chunk box
Change chunk color Click the color swatch in a chunk box
Lock/unlock a chunk Click the 🔓 Lock / 🔒 Locked button

Save Panel

  • Collapses/expands with the ▲/▼ toggle button
  • Saved setups are stored in localStorage under the key percentageSplitterSaves
  • Rename a save by clicking its name field
  • Delete a save with the button
  • Reload a save with the button

Browser Support

Works in any modern browser (Chrome, Firefox, Edge, Safari). No dependencies, no build step.

About

A simple html page for a tool that will allow you to easily and visually split a number up into different chunks.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages