mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-02-12 16:52:46 +00:00
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
2.0 KiB
2.0 KiB
Tool System - Build-Time Template Injection
Architecture
- Templates: Separate
.htmlfiles intemplates/directory - Build Process: Injected into
index.htmlat build time - Result: Single static HTML file (fast loading, no HTTP requests)
File Structure
├── index.template.html # Base shell
├── index.html # Generated (templates injected)
├── templates/ # Edit HTML here
│ ├── decoder.html
│ ├── steganography.html
│ └── ...
├── js/tools/ # Tool classes (logic)
│ ├── Tool.js # Base class
│ └── *Tool.js # Auto-discovered
└── build/
└── inject-tool-templates.js
Creating a New Tool
1. Create Tool Class
js/tools/MyTool.js:
class MyTool extends Tool {
constructor() {
super({
id: 'mytool',
name: 'My Tool',
icon: 'fa-star',
title: 'Description',
order: 10
});
}
getVueData() {
return { myInput: '', myOutput: '' };
}
getVueMethods() {
return {
processInput() {
this.myOutput = this.myInput.toUpperCase();
}
};
}
}
2. Create Template
templates/mytool.html:
<div v-if="activeTab === 'mytool'" class="tab-content">
<div class="transform-layout">
<textarea v-model="myInput" @input="processInput"></textarea>
<div v-if="myOutput">{{ myOutput }}</div>
</div>
</div>
3. Build
npm run build:tools # Auto-discovers and registers tool
npm run build:templates # Injects template into index.html
How It Works
- Development: Edit templates in
templates/*.html - Build:
inject-tool-templates.jsreads templates and injects intoindex.template.html - Output: Complete
index.htmlwith all templates embedded - Browser: Vue compiles templates at page load (already in DOM)