Mr-vabs/lazyscript

Assignment maker for personal use

β˜… 0Forks 0TypeScriptGitHub β†—Compare

Project website β†—

README

😴 LazyScript

Private Tool: Turn typed text into realistic handwritten assignments.

React Vite TypeScript Tailwind CSS Netlify Status

🌟 Overview

LazyScript is a custom tool built to convert digital text into realistic handwritten documents. It supports complex formatting like tables, images, and text alignment, rendering everything onto a canvas that simulates A4 paper.

πŸ”΄ Live Demo


✨ Features

✍️ Core Handwriting Engine

  • Realistic Rendering: Converts text to handwriting using 6 distinct font styles (Standard, Cursive, Messy, etc.).
  • Human Imperfections: adjustable Messiness (skew/rotation) and Spacing sliders to mimic natural writing.
  • Paper Styles: Toggle between Lined, Grid, or Blank backgrounds.
  • Visual Effects:
    • Scanner Mode: Adds shadows and noise to look like a scanned document.
    • Blue/Red Lines: Adjustable opacity for the page ruling.

πŸ›  Editor Tools

  • Rich Text: Support for Bold, Underline, and multiple Ink Colors.
  • Smart Tables: Create tables with advanced controls to Merge Cells, add/remove rows, and auto-resize columns.
  • Case Management: Instantly convert text to UPPERCASE, lowercase, or Title Case.
  • Image Support: Drag and drop images which render with a "taped-on" visual effect.

πŸ€– AI Assistance

  • Prompt Generator: Built-in tool to generate a system prompt for ChatGPT/Gemini. This ensures the AI outputs answers in a format LazyScript can read perfectly (HTML/Tables).

πŸ’Ύ Export & Save

  • PDF Export: Downloads high-resolution A4 PDFs.
  • Project Files: Save/Load your work using .lazy JSON files to preserve settings and content.

πŸ› οΈ Project Structure

src/
β”œβ”€β”€ App.tsx          # Core Application Logic (State, Render Loop, UI)
β”œβ”€β”€ index.css        # Tailwind Imports & Custom CSS
β”œβ”€β”€ main.tsx         # React Entry Point
└── vite-env.d.ts    # TypeScript Definitions
public/
└── shinchan.jpeg    # Favicon Image

πŸš€ Installation & Local Development

  1. Clone the repository

    git clone https://github.com/mr-vabs/lazyscript.git
    cd lazyscript
  2. Install Dependencies

    npm install
  3. Start the Dev Server

    npm run dev
    # Open http://localhost:5173 in your browser

πŸš€ Deployment (Netlify)

Since this is a private repo, connect your GitHub account to Netlify:

  1. Push code to this repository.
  2. Go to Netlify Dashboard -> Add new site -> Import from Git.
  3. Authorize Netlify to access your Private Repositories.
  4. Select lazyscript.
  5. Build Settings:
    • Command: npm run build
    • Publish directory: dist
  6. Click Deploy.

πŸ“œ Full Changelog

πŸš€ Changelog v18.2 (Current)

πŸ”₯ Critical Fixes & Logic

  • Matrix Table Algorithm: Replaced the simple table parser with a robust 2D Grid System. This fixes alignment issues when using complex rowSpan and colSpan combinations.
  • Code Block Pagination: Code blocks now split cleanly across pages instead of bunching up or getting cut off.
  • Ghost Image Fix: Added a MutationObserver with cleanup logic to prevent invisible β€œghost” empty spaces when dragging and dropping images.

✨ Enhancements

  • Advanced Anti-OCR: The PDF exporter now applies a heavy noise filter and rotates the entire page by 0.5Β°, preventing PDF readers from selecting text and ensuring a flat scanned-image look.
  • UI Updates:
    • Swapped Delete Image icon β†’ Backspace
    • Swapped Clear Canvas β†’ Refresh / New Page
  • Pagination Logic: Improved flushLine handling to prevent gaps at the bottom of pages when font sizes change dynamically.

πŸ§ͺ Changelog v18.1

πŸ†• New Features

  • Code Block Support: Added a parser for <pre> tags. Code now renders with:
    • A distinct left-side vertical border
    • Preserved indentation and spacing
  • Scanner Mode V1: Introduced the Xerox Effect (High Contrast + Grayscale) for PDF exports.

πŸ›  Improvements

  • Image Positioning: Fixed a bug where inserting an image would always place it at the end of the text. Images now correctly respect the cursor position.
  • Table Columns: Added specific logic to handle Column Deletion correctly without breaking layout.

🎨 Changelog v18.0

🌟 Major Feature β€” Drawing Mode

  • Pen Tool: Added a toggle to switch between Text Mode and Drawing Mode.
  • Bezier Curves: Implemented smooth stroke rendering for natural-looking digital ink.
  • Undo System: Added Undo2 functionality specifically optimized for drawing strokes.
  • Ink Sync: Drawing color now syncs automatically with the selected Text Color.

πŸ“± Mobile & UI

  • Responsive Header: Fixed z-index and padding issues to ensure the header doesn’t overlap the paper on mobile devices.
  • Toolbar Wrap: Toolbar buttons now wrap gracefully on smaller screens.
  • Paste AI: Added a button to parse HTML directly from the system clipboard.

Changelog v17.0

New Features

  • AI Integration: Added a Robot Icon πŸ€– to the toolbar to copy the specialized AI system prompt.
  • Table Merging: Added logic to merge table cells both Right and Down (rowSpan/colSpan).
  • Case Converter: Added a dropdown menu to toggle text case without retyping.
  • Paper Types: Introduced logic to switch between Lined, Grid, and Blank paper (setPaperType).
  • Toast System: Replaced standard browser alert() with a custom, non-intrusive Toast Notification system for errors and success messages.

Improvements

  • Safety: Added a 3-stage confirmation to the Clear button (Clear? -> Really??) to prevent accidents.
  • Rendering: Added a visual "tape" effect to inserted images (ctx.fillRect corners).
  • Performance: Implemented a debounce (300ms) on the parser to prevent lag while typing.
  • UI: Fully implemented Dark Mode styling for the toolbar and editor.

Changelog v16.4

  • Critical Fix (TS2367): Changed the declaration of dominantAlign in the Renderer loop to explicitly allow all 3 states: 'left' | 'center' | 'right'.
  • Explicit Casting: Added specific type casting inside the loop (seg.align as ...) to ensure data flows correctly without narrowing.
  • Strict Typing: Ensured AlignType is used consistently across the parser and renderer.

v16.1

  • UI Fix: Restored the Line Opacity slider.
  • Organization: Grouped all 4 customization sliders (Messiness, Size, Spacing, Opacity) in the UI.

v16.0

  • Mobile Responsive: Layout adapts to vertical stack on mobile devices.
  • Text Case Tools: Added menu to transform text case (Upper/Lower/Title).
  • Branding: Added custom Shinchan favicon.
  • Fix: Restored Font Size slider functionality.

v15.0

  • Letter Spacing: Added slider to manipulate space between characters.

v14.0

  • Fonts: Integrated Google Fonts to replace broken external links.
  • UI: Improved Font Dropdown UI.

v12.0 - v13.0

  • Alignment: Added visual support for Left, Center, and Right alignment.
  • Rendering: Switched table drawing from rect to line strokes to fix border overlap.

v10.0 - v11.0

  • Images: Added "Select to Delete" functionality (Blue border).
  • Bugfix: Prevented images from being inserted into the toolbar.
  • Layout: Fixed editor scrolling issues with large images.

v8.0 - v9.0

  • Tables: Added logic for Merging Rows and Columns.
  • Engine: Rewrote table engine to use a coordinate grid system.

v6.0 - v7.0

  • Core: Implemented DOMPurify for security.
  • UI: Added Dark Mode and Sticky Header.

πŸ”’ Private Repository

This project is maintained privately. Please do not share access tokens or .lazy or .json files containing sensitive data publicly.

Contributors

Mr-vabs

Issues