Skip to content

xraman-71/Divine-Wisdom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Divine Wisdom Icon

Divine Wisdom: Daily Hindu Scriptures & Spiritual Insights

Transform your browser with daily verses from the Bhagavad Gita, Puranas, and Vedas. One sacred verse per session β€” appearing gently, then fading away.

Chrome Web Store Manifest Version Version

πŸ“– Overview

Divine Wisdom is a lightweight Chrome extension that displays one sacred Hindu scripture verse per browser session. After a natural 5–7 second delay, a beautifully styled overlay slides down from the top of your screen β€” then quietly fades after 10–20 seconds. No interruptions. No clutter. Just one moment of ancient wisdom per day.

Verses are drawn from the Bhagavad Gita, Puranas, and Vedas, delivered in a premium saffron-and-gold aesthetic designed to feel sacred and calm.


✨ How It Works

  1. You start or restart your browser
  2. The extension sets a session flag β€” one message is queued
  3. On the first page you visit, after a 5–7 second natural delay, the verse overlay slides in from the top
  4. The verse displays for 10–20 seconds, then gently fades out
  5. No more overlays appear until the next browser restart

This one-per-session design is intentional β€” preserving your focus while still delivering a mindful moment.


πŸ—‚οΈ Project Structure

divine-wisdom/
β”œβ”€β”€ manifest.json          # Chrome Extension manifest (v3)
β”œβ”€β”€ background.js          # Service worker β€” session gate & message logic
β”œβ”€β”€ content.js             # Overlay injection & timing logic
β”œβ”€β”€ popup.html             # Extension popup UI
β”œβ”€β”€ styles.css             # Overlay styles (Cinzel + Poppins fonts, saffron theme)
β”œβ”€β”€ messages.json          # Scripture verses database (5000+ entries)
β”œβ”€β”€ logo_gen.html          # Animated logo generator (Canvas-based Om symbol)
β”œβ”€β”€ icon16.png             # Toolbar icon (16x16)
β”œβ”€β”€ icon48.png             # Extensions page icon (48x48)
β”œβ”€β”€ icon128.png            # Chrome Web Store icon (128x128)
└── README.md              # This file

βš™οΈ Technical Architecture

Manifest v3 β€” Service Worker Model

The extension runs on Manifest v3 using a service worker (background.js) instead of a persistent background page. This is the modern Chrome standard and keeps the extension lightweight and efficient.

Session Gate (Race-Condition Safe)

The background script uses a dual-lock system to guarantee only one verse is ever shown per session β€” even when multiple tabs open simultaneously:

Browser Starts
     β”‚
     β–Ό
sessionGateLocked = false
showMessage = true  (session storage)
     β”‚
     β–Ό
First tab sends getMessage
     β”‚
     β”œβ”€ Lock already set? β†’ return null (no overlay)
     β”‚
     └─ Not locked β†’ Lock immediately + clear flag β†’ fetch verse β†’ send to tab
  • In-memory lock (sessionGateLocked) β€” blocks concurrent requests in the same service worker instance
  • Session storage flag (showMessage) β€” persists across service worker restarts within the same session

Overlay Timing

Page loads
    β”‚
    └── Random delay: 5000–7000ms
              β”‚
              └── Request verse from background
                        β”‚
                        └── Slide in (0.8s cubic-bezier spring)
                                  β”‚
                                  └── Random duration: 10000–20000ms
                                            β”‚
                                            └── Fade out + remove from DOM

Permissions β€” What & Why

Permission Used In Purpose
storage background.js Session storage for the one-per-session gate flag
tabs manifest.json Required to access tab context for content script injection
activeTab manifest.json Enables the popup when the extension icon is clicked

No browsing data is read, recorded, or transmitted. The extension only writes and reads its own session flag.


🎨 Design System

Fonts

  • Cinzel (serif) β€” Used for scripture source labels and speaker names. Evokes classical sacred typography.
  • Poppins (sans-serif) β€” Used for verse body text. Clean and readable.
  • Outfit (sans-serif) β€” Used in the popup UI for a modern, airy feel.

Color Palette

Name Hex Used For
Saffron #ff9933 Overlay border, source label, accent
Gold #d4af37 Speaker name highlight
Deep Amber #4a2c00 Body text on overlay
Warm White #fffbf5 Popup background
Accent Orange #e67e22 Popup headings and UI accents

Overlay Behavior

  • Slides in from top of screen (off-screen start β†’ top: 0)
  • Spring easing: cubic-bezier(0.175, 0.885, 0.32, 1.275)
  • z-index: 2147483647 β€” always on top
  • pointer-events: none β€” never blocks your clicks
  • Subtle Om watermark in the bottom-right corner

πŸ“¦ Installation

From Chrome Web Store (Recommended)

  1. Visit the Chrome Web Store listing (link coming soon)
  2. Click Add to Chrome
  3. Confirm the permissions
  4. Restart your browser and open any page β€” your first verse will appear

Manual / Developer Installation

  1. Clone or download this repository
    git clone https://github.com/yourusername/divine-wisdom-extension.git
  2. Open Chrome and go to chrome://extensions/
  3. Enable Developer Mode (toggle, top-right)
  4. Click Load unpacked and select the project folder
  5. Restart Chrome and open any webpage to trigger your first verse

πŸ› οΈ Development Guide

Testing the Overlay

Because the extension shows only once per session, use this workflow during development:

  1. Make your changes
  2. Go to chrome://extensions/ and click the refresh icon on the extension card
  3. This re-triggers onInstalled, which resets the session gate
  4. Open any tab β€” the overlay will appear after 5–7 seconds

Adding New Verses

Verses are stored in messages.json as an array. Each entry follows this structure:

[
  {
    "source": "Bhagavad Gita",
    "chapter": "Chapter 2, Verse 47",
    "speaker": "Lord Krishna",
    "message": "You have a right to perform your prescribed duties, but you are not entitled to the fruits of your actions."
  }
]
Field Description
source Scripture name β€” displayed in uppercase saffron text
chapter Chapter and verse reference β€” displayed as a subtitle
speaker Who speaks the verse β€” displayed in gold
message The verse text β€” displayed in italic

Updating the Logo

logo_gen.html is a Canvas-based animated logo generator featuring:

  • Radial saffron gradient background
  • Animated Om symbol with pulsing glow effect
  • Color cycling through gold β†’ saffron β†’ deep orange
  • Gold outer ring border

Open it in Chrome, screenshot at the required sizes, and save as icon16.png, icon48.png, and icon128.png.


πŸ”’ Privacy Policy

This extension collects zero personal data.

  • No browsing history is accessed or stored
  • No data is sent to any external server
  • All storage is local and limited to the extension's own session flag
  • Content scripts only display the overlay β€” no page content is read or transmitted

Full privacy policy: DivineWisdom Privacy Policy


πŸ“œ Scripture Sources

  • Bhagavad Gita β€” 700 verses of dialogue between Arjuna and Lord Krishna on duty, dharma, and liberation
  • Vedas β€” The four foundational texts of Hindu philosophy: Rigveda, Samaveda, Yajurveda, Atharvaveda
  • Puranas β€” 18 ancient texts covering cosmology, mythology, genealogy, and devotional teachings

🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create your branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Open a Pull Request

β˜• Support

If this extension brings peace to your day, consider supporting future projects:

πŸ‘‰ SUPPORT & HELP


Divine Wisdom Icon

"One who sees inaction in action, and action in inaction, is intelligent among men."
β€” Bhagavad Gita

Made with πŸ•‰οΈ and devotion

About

Bhagavad Gita, Vedas & Puranas daily verses on every new tab. Hindu scripture quotes, spiritual wisdom & mindfulness for your browser. Inspire your day with ancient Indian teachings & divine knowledge. Transform browsing into a sacred spiritual journey with timeless Vedic insights daily.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages