Skip to content

Peakk2011/PaintAPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paint application

A Paint Electron lightweight application

Features

🎨 Advanced Drawing Tools

Smooth brush with quadratic curves
Texture brush with bristle simulation
Variable brush sizes with real-time preview
Color picker with HSV controls

🖼️ Canvas Management

Infinite canvas with pan & zoom (0.95x - 10x)
Grid overlay for precision drawing
High-DPI display support
Auto-save progress to localStorage

📝 Sticky Notes System

Triple-click to create sticky notes
Drag & drop positioning
Double-click to edit text
Integrated with undo/redo system

⚡ Performance Optimizations

Document fragment for DOM updates
Separate drawing/preview canvases
Optimized redraw with requestAnimationFrame
Memory-efficient history management (20 states)

🔄 Undo/Redo System

Full canvas state restoration
Sticky notes preservation
Smart timestamp-based merging
Keyboard shortcuts (Ctrl+Z, Ctrl+Y)

💾 Export & Save

Multiple formats: PNG, JPG, WebP
High-quality export with background
Project save/load with sticky notes
Auto-save on every action

⌨️ Keyboard Shortcuts

Drawing: Ctrl+Z (undo), Ctrl+Y (redo)
View: Ctrl+Plus (zoom in), Ctrl+Minus (zoom out), Ctrl+0 (reset)
Actions: Ctrl+C (clear), Ctrl+S (save), Ctrl+Shift+S (export)

📱 Cross-Platform Support

Touch events for mobile/tablet
Platform-specific styling (Mac/Windows)
Electron IPC integration
Context menu support

🎯 UI/UX Features

Color picker with live preview
Brush size indicator
Loading states and error handling
Dark/light theme adaptation

Directory Structure & Flow

📦 Root Files

PAINTAPP-DESKTOP/
├── assets/             # Assets folder stored icons app folder
├── node_modules/       # App module
├── out/                # Build-file
├── src/                # Source code
├── .gitignore          
├── forge.config.js     # Electron Forge Config
├── package-lock.json   
├── package.json        # JSON module configulation file
└── README.md           # Documents

📝 Source Code Flow .src/

src/
├── data-loader.js      # JSON File data loader
├── data.json           # PaintAPP Data File (JSON)
├── index.html          # Main HTML File
├── main.js             # Electron Main Process
├── menu.js             # Native macOS menubar
├── Paint.css           # PaintAPP styling
├── Paint.js            # PaintAPP file logic (Paint app entry file)
├── preload.js          # Electron preload script
└── Reset.css           # CSS Reset

HTML Data flow structure

Process

  1. Load JSON -> Fetch('./data.json');
  2. Create DOM -> Create HTML Elements from JSON
  3. Connect Logic -> Call initializePaint(data)

UI Elements

1. Navigation Links

data.navLinks.forEach(link => {
  const li = document.createElement('li');
  if (link.isCurrent) li.id = 'CurrentPage';  // Current page
  const a = document.createElement('a');
  a.href = link.href;
  a.textContent = link.text;
  // Create menu
});

2. Toolbar Controls

switch (controlInfo.type) {
  case 'color-picker':    // Picker
  case 'range':           // Slide bar
  case 'select':          // Dropdown menu
}

3. Buttons

// Fetch from JSON file
toolbarData.buttons.forEach(buttonInfo => {
  const button = document.createElement('button');
  button.id = buttonInfo.id;
  button.textContent = buttonInfo.text;
});