Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# push-it-real-good
git hook that surprises and delights

A fantastic terminal animation that plays when you push to GitHub! Features graffiti-style ASCII art of "PUSH IT REAL GOOD" with a stunning rainbow spray effect.

## 🎨 Preview

The animation displays the text "PUSH IT REAL GOOD" in bold graffiti-style letters with a mesmerizing spray effect that emanates from the center, painting the characters in a vibrant rainbow gradient (red β†’ orange β†’ yellow β†’ green β†’ blue β†’ indigo β†’ violet).

## πŸš€ Installation

1. Clone this repository
2. Run the installation script:
```bash
./install.sh
```

This will:
- Install the required Python packages (`pyfiglet` and `terminaltexteffects`)
- Set up the pre-push git hook

## 🎭 Usage

Once installed, the animation will automatically play every time you run `git push`!

You can also run the animation manually:
```bash
python3 push_animation.py
```

## πŸ› οΈ Manual Installation

If you prefer to install manually:

1. Install dependencies:
```bash
pip install -r requirements.txt
```

2. Copy the hook to your git hooks directory:
```bash
cp pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
```

## πŸ“¦ Dependencies

- Python 3.8+
- pyfiglet - ASCII art text generator
- terminaltexteffects - Terminal visual effects engine

## 🎨 Customization

Want to customize the animation? Edit `push_animation.py` to:
- Change the text
- Modify colors in the gradient
- Try different effects (fireworks, beams, matrix, etc.)
- Adjust animation speed and parameters

See the [terminaltexteffects documentation](https://github.com/ChrisBuilds/terminaltexteffects) for all available effects.

## πŸ“ License

This project is open source and available for anyone to use and enjoy!
25 changes: 25 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# PUSH IT REAL GOOD - Installation Script
# Sets up the git hook and dependencies
#

set -e

echo "🎨 Installing PUSH IT REAL GOOD git hook..."

# Install Python dependencies
echo "πŸ“¦ Installing Python dependencies..."
pip install -r requirements.txt --user || echo "⚠️ Some packages may already be installed"

# Install the pre-push hook
echo "πŸͺ Installing pre-push hook..."
cp pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push

echo "βœ… Installation complete!"
echo ""
echo "The animation will now play every time you push to this repository."
echo "To test it, try: git push"
echo ""
echo "Enjoy! πŸŽ‰"
24 changes: 24 additions & 0 deletions pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# PUSH IT REAL GOOD - Git Pre-Push Hook
# Plays a fantastic terminal animation before each push
#
# To install this hook, copy it to .git/hooks/pre-push and make it executable:
# cp pre-push .git/hooks/pre-push
# chmod +x .git/hooks/pre-push

# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# If running from .git/hooks, go up two directories to get to repo root
if [[ "$SCRIPT_DIR" == *"/.git/hooks" ]]; then
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
else
REPO_ROOT="$SCRIPT_DIR"
fi

# Run the animation
python3 "$REPO_ROOT/push_animation.py"

# Always allow the push to proceed
exit 0
40 changes: 40 additions & 0 deletions push_animation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""
PUSH IT REAL GOOD - Terminal Animation
Displays a fantastic graffiti-style animation using terminaltexteffects
"""

import subprocess
import sys
from pyfiglet import Figlet


def main():
# Generate graffiti-style ASCII art
figlet = Figlet(font='graffiti')
text = figlet.renderText('PUSH IT REAL GOOD')

# Use tte CLI with spray effect and rainbow gradient
cmd = [
'tte', 'spray',
'--final-gradient-stops', 'e81416', 'ffa500', 'faeb36', '79c314', '487de7', '4b369d', '70369d',
'--final-gradient-steps', '12',
'--final-gradient-direction', 'horizontal',
'--spray-position', 'center',
'--spray-volume', '0.01',
'--movement-speed-range', '0.3-1.0',
'--movement-easing', 'OUT_EXPO'
]

# Run the effect
try:
process = subprocess.Popen(cmd, stdin=subprocess.PIPE, text=True)
process.communicate(input=text)
process.wait()
except KeyboardInterrupt:
process.terminate()
sys.exit(0)


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyfiglet==1.0.2
terminaltexteffects==0.12.1