@every-env/compound-plugin 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +37 -0
- package/.github/workflows/deploy-docs.yml +39 -0
- package/AGENTS.md +48 -0
- package/CLAUDE.md +380 -0
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/bun.lock +30 -0
- package/docs/css/docs.css +675 -0
- package/docs/css/style.css +2886 -0
- package/docs/index.html +1046 -0
- package/docs/js/main.js +225 -0
- package/docs/pages/agents.html +649 -0
- package/docs/pages/changelog.html +495 -0
- package/docs/pages/commands.html +523 -0
- package/docs/pages/getting-started.html +582 -0
- package/docs/pages/mcp-servers.html +409 -0
- package/docs/pages/skills.html +611 -0
- package/docs/solutions/plugin-versioning-requirements.md +77 -0
- package/docs/specs/claude-code.md +67 -0
- package/docs/specs/codex.md +59 -0
- package/docs/specs/opencode.md +57 -0
- package/package.json +26 -0
- package/plans/grow-your-own-garden-plugin-architecture.md +102 -0
- package/plans/landing-page-launchkit-refresh.md +279 -0
- package/plugins/coding-tutor/.claude-plugin/plugin.json +9 -0
- package/plugins/coding-tutor/README.md +37 -0
- package/plugins/coding-tutor/commands/quiz-me.md +1 -0
- package/plugins/coding-tutor/commands/sync-tutorials.md +25 -0
- package/plugins/coding-tutor/commands/teach-me.md +1 -0
- package/plugins/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
- package/plugins/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +207 -0
- package/plugins/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +193 -0
- package/plugins/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
- package/plugins/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +118 -0
- package/plugins/compound-engineering/.claude-plugin/plugin.json +33 -0
- package/plugins/compound-engineering/CHANGELOG.md +393 -0
- package/plugins/compound-engineering/CLAUDE.md +90 -0
- package/plugins/compound-engineering/LICENSE +21 -0
- package/plugins/compound-engineering/README.md +219 -0
- package/plugins/compound-engineering/agents/design/design-implementation-reviewer.md +94 -0
- package/plugins/compound-engineering/agents/design/design-iterator.md +197 -0
- package/plugins/compound-engineering/agents/design/figma-design-sync.md +172 -0
- package/plugins/compound-engineering/agents/docs/ankane-readme-writer.md +50 -0
- package/plugins/compound-engineering/agents/research/best-practices-researcher.md +100 -0
- package/plugins/compound-engineering/agents/research/framework-docs-researcher.md +83 -0
- package/plugins/compound-engineering/agents/research/git-history-analyzer.md +42 -0
- package/plugins/compound-engineering/agents/research/repo-research-analyst.md +113 -0
- package/plugins/compound-engineering/agents/review/agent-native-reviewer.md +246 -0
- package/plugins/compound-engineering/agents/review/architecture-strategist.md +52 -0
- package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +85 -0
- package/plugins/compound-engineering/agents/review/data-integrity-guardian.md +70 -0
- package/plugins/compound-engineering/agents/review/data-migration-expert.md +97 -0
- package/plugins/compound-engineering/agents/review/deployment-verification-agent.md +159 -0
- package/plugins/compound-engineering/agents/review/dhh-rails-reviewer.md +45 -0
- package/plugins/compound-engineering/agents/review/julik-frontend-races-reviewer.md +222 -0
- package/plugins/compound-engineering/agents/review/kieran-python-reviewer.md +104 -0
- package/plugins/compound-engineering/agents/review/kieran-rails-reviewer.md +86 -0
- package/plugins/compound-engineering/agents/review/kieran-typescript-reviewer.md +95 -0
- package/plugins/compound-engineering/agents/review/pattern-recognition-specialist.md +57 -0
- package/plugins/compound-engineering/agents/review/performance-oracle.md +110 -0
- package/plugins/compound-engineering/agents/review/security-sentinel.md +93 -0
- package/plugins/compound-engineering/agents/workflow/bug-reproduction-validator.md +67 -0
- package/plugins/compound-engineering/agents/workflow/every-style-editor.md +64 -0
- package/plugins/compound-engineering/agents/workflow/lint.md +16 -0
- package/plugins/compound-engineering/agents/workflow/pr-comment-resolver.md +69 -0
- package/plugins/compound-engineering/agents/workflow/spec-flow-analyzer.md +113 -0
- package/plugins/compound-engineering/commands/agent-native-audit.md +277 -0
- package/plugins/compound-engineering/commands/changelog.md +137 -0
- package/plugins/compound-engineering/commands/create-agent-skill.md +8 -0
- package/plugins/compound-engineering/commands/deepen-plan.md +546 -0
- package/plugins/compound-engineering/commands/deploy-docs.md +112 -0
- package/plugins/compound-engineering/commands/feature-video.md +342 -0
- package/plugins/compound-engineering/commands/generate_command.md +162 -0
- package/plugins/compound-engineering/commands/heal-skill.md +142 -0
- package/plugins/compound-engineering/commands/lfg.md +19 -0
- package/plugins/compound-engineering/commands/plan_review.md +7 -0
- package/plugins/compound-engineering/commands/release-docs.md +211 -0
- package/plugins/compound-engineering/commands/report-bug.md +150 -0
- package/plugins/compound-engineering/commands/reproduce-bug.md +99 -0
- package/plugins/compound-engineering/commands/resolve_parallel.md +34 -0
- package/plugins/compound-engineering/commands/resolve_pr_parallel.md +49 -0
- package/plugins/compound-engineering/commands/resolve_todo_parallel.md +35 -0
- package/plugins/compound-engineering/commands/test-browser.md +339 -0
- package/plugins/compound-engineering/commands/triage.md +310 -0
- package/plugins/compound-engineering/commands/workflows/compound.md +202 -0
- package/plugins/compound-engineering/commands/workflows/plan.md +466 -0
- package/plugins/compound-engineering/commands/workflows/review.md +514 -0
- package/plugins/compound-engineering/commands/workflows/work.md +363 -0
- package/plugins/compound-engineering/commands/xcode-test.md +331 -0
- package/plugins/compound-engineering/skills/agent-browser/SKILL.md +223 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/SKILL.md +435 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/product-implications.md +443 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/self-modification.md +269 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
- package/plugins/compound-engineering/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/SKILL.md +184 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/resources.md +119 -0
- package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
- package/plugins/compound-engineering/skills/compound-docs/SKILL.md +510 -0
- package/plugins/compound-engineering/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/plugins/compound-engineering/skills/compound-docs/assets/resolution-template.md +93 -0
- package/plugins/compound-engineering/skills/compound-docs/references/yaml-schema.md +65 -0
- package/plugins/compound-engineering/skills/compound-docs/schema.yaml +176 -0
- package/plugins/compound-engineering/skills/create-agent-skills/SKILL.md +299 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md +226 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md +404 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md +595 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md +437 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md +175 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md +185 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md +168 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md +372 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md +113 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md +112 -0
- package/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
- package/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md +73 -0
- package/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md +33 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md +96 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md +93 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md +74 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md +120 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md +138 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md +121 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
- package/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md +204 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/SKILL.md +185 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/architecture.md +653 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/controllers.md +303 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/frontend.md +510 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/gems.md +266 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/models.md +359 -0
- package/plugins/compound-engineering/skills/dhh-rails-style/references/testing.md +338 -0
- package/plugins/compound-engineering/skills/dspy-ruby/SKILL.md +594 -0
- package/plugins/compound-engineering/skills/dspy-ruby/assets/config-template.rb +359 -0
- package/plugins/compound-engineering/skills/dspy-ruby/assets/module-template.rb +326 -0
- package/plugins/compound-engineering/skills/dspy-ruby/assets/signature-template.rb +143 -0
- package/plugins/compound-engineering/skills/dspy-ruby/references/core-concepts.md +265 -0
- package/plugins/compound-engineering/skills/dspy-ruby/references/optimization.md +623 -0
- package/plugins/compound-engineering/skills/dspy-ruby/references/providers.md +338 -0
- package/plugins/compound-engineering/skills/every-style-editor/SKILL.md +134 -0
- package/plugins/compound-engineering/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
- package/plugins/compound-engineering/skills/file-todos/SKILL.md +251 -0
- package/plugins/compound-engineering/skills/file-todos/assets/todo-template.md +155 -0
- package/plugins/compound-engineering/skills/frontend-design/SKILL.md +42 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/SKILL.md +237 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/requirements.txt +2 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/scripts/compose_images.py +157 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/scripts/edit_image.py +144 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/scripts/gemini_images.py +263 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/scripts/generate_image.py +133 -0
- package/plugins/compound-engineering/skills/gemini-imagegen/scripts/multi_turn_chat.py +216 -0
- package/plugins/compound-engineering/skills/git-worktree/SKILL.md +302 -0
- package/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh +345 -0
- package/plugins/compound-engineering/skills/rclone/SKILL.md +150 -0
- package/plugins/compound-engineering/skills/rclone/scripts/check_setup.sh +60 -0
- package/plugins/compound-engineering/skills/skill-creator/SKILL.md +209 -0
- package/plugins/compound-engineering/skills/skill-creator/scripts/init_skill.py +303 -0
- package/plugins/compound-engineering/skills/skill-creator/scripts/package_skill.py +110 -0
- package/plugins/compound-engineering/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/src/commands/convert.ts +156 -0
- package/src/commands/install.ts +221 -0
- package/src/commands/list.ts +37 -0
- package/src/converters/claude-to-codex.ts +124 -0
- package/src/converters/claude-to-opencode.ts +392 -0
- package/src/index.ts +20 -0
- package/src/parsers/claude.ts +248 -0
- package/src/targets/codex.ts +91 -0
- package/src/targets/index.ts +29 -0
- package/src/targets/opencode.ts +48 -0
- package/src/types/claude.ts +88 -0
- package/src/types/codex.ts +23 -0
- package/src/types/opencode.ts +54 -0
- package/src/utils/codex-agents.ts +64 -0
- package/src/utils/files.ts +64 -0
- package/src/utils/frontmatter.ts +65 -0
- package/tests/claude-parser.test.ts +89 -0
- package/tests/cli.test.ts +289 -0
- package/tests/codex-agents.test.ts +62 -0
- package/tests/codex-converter.test.ts +121 -0
- package/tests/codex-writer.test.ts +76 -0
- package/tests/converter.test.ts +171 -0
- package/tests/fixtures/custom-paths/.claude-plugin/plugin.json +8 -0
- package/tests/fixtures/custom-paths/agents/default-agent.md +5 -0
- package/tests/fixtures/custom-paths/commands/default-command.md +5 -0
- package/tests/fixtures/custom-paths/custom-agents/custom-agent.md +5 -0
- package/tests/fixtures/custom-paths/custom-commands/custom-command.md +5 -0
- package/tests/fixtures/custom-paths/custom-hooks/hooks.json +7 -0
- package/tests/fixtures/custom-paths/custom-skills/custom-skill/SKILL.md +5 -0
- package/tests/fixtures/custom-paths/hooks/hooks.json +7 -0
- package/tests/fixtures/custom-paths/skills/default-skill/SKILL.md +5 -0
- package/tests/fixtures/invalid-command-path/.claude-plugin/plugin.json +5 -0
- package/tests/fixtures/invalid-hooks-path/.claude-plugin/plugin.json +5 -0
- package/tests/fixtures/invalid-mcp-path/.claude-plugin/plugin.json +5 -0
- package/tests/fixtures/mcp-file/.claude-plugin/plugin.json +5 -0
- package/tests/fixtures/mcp-file/.mcp.json +6 -0
- package/tests/fixtures/sample-plugin/.claude-plugin/plugin.json +30 -0
- package/tests/fixtures/sample-plugin/agents/agent-one.md +10 -0
- package/tests/fixtures/sample-plugin/agents/security-reviewer.md +7 -0
- package/tests/fixtures/sample-plugin/commands/command-one.md +7 -0
- package/tests/fixtures/sample-plugin/commands/model-command.md +8 -0
- package/tests/fixtures/sample-plugin/commands/nested/command-two.md +9 -0
- package/tests/fixtures/sample-plugin/commands/pattern-command.md +7 -0
- package/tests/fixtures/sample-plugin/commands/skill-command.md +7 -0
- package/tests/fixtures/sample-plugin/commands/todo-command.md +7 -0
- package/tests/fixtures/sample-plugin/hooks/hooks.json +156 -0
- package/tests/fixtures/sample-plugin/skills/skill-one/SKILL.md +6 -0
- package/tests/frontmatter.test.ts +20 -0
- package/tests/opencode-writer.test.ts +62 -0
- package/tsconfig.json +14 -0
package/docs/js/main.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compounding Engineering Documentation
|
|
3
|
+
* Main JavaScript functionality
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
7
|
+
initMobileNav();
|
|
8
|
+
initSmoothScroll();
|
|
9
|
+
initCopyCode();
|
|
10
|
+
initThemeToggle();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Mobile Navigation Toggle
|
|
15
|
+
*/
|
|
16
|
+
function initMobileNav() {
|
|
17
|
+
const mobileToggle = document.querySelector('[data-mobile-toggle]');
|
|
18
|
+
const navigation = document.querySelector('[data-navigation]');
|
|
19
|
+
|
|
20
|
+
if (!mobileToggle || !navigation) return;
|
|
21
|
+
|
|
22
|
+
mobileToggle.addEventListener('click', () => {
|
|
23
|
+
navigation.classList.toggle('open');
|
|
24
|
+
mobileToggle.classList.toggle('active');
|
|
25
|
+
|
|
26
|
+
// Update aria-expanded
|
|
27
|
+
const isOpen = navigation.classList.contains('open');
|
|
28
|
+
mobileToggle.setAttribute('aria-expanded', isOpen);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Close menu when clicking outside
|
|
32
|
+
document.addEventListener('click', (event) => {
|
|
33
|
+
if (!mobileToggle.contains(event.target) && !navigation.contains(event.target)) {
|
|
34
|
+
navigation.classList.remove('open');
|
|
35
|
+
mobileToggle.classList.remove('active');
|
|
36
|
+
mobileToggle.setAttribute('aria-expanded', 'false');
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Close menu when clicking a nav link
|
|
41
|
+
navigation.querySelectorAll('.nav-link').forEach(link => {
|
|
42
|
+
link.addEventListener('click', () => {
|
|
43
|
+
navigation.classList.remove('open');
|
|
44
|
+
mobileToggle.classList.remove('active');
|
|
45
|
+
mobileToggle.setAttribute('aria-expanded', 'false');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Smooth Scroll for Anchor Links
|
|
52
|
+
*/
|
|
53
|
+
function initSmoothScroll() {
|
|
54
|
+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
55
|
+
anchor.addEventListener('click', function(e) {
|
|
56
|
+
const targetId = this.getAttribute('href');
|
|
57
|
+
if (targetId === '#') return;
|
|
58
|
+
|
|
59
|
+
const targetElement = document.querySelector(targetId);
|
|
60
|
+
if (!targetElement) return;
|
|
61
|
+
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
|
|
64
|
+
const navHeight = document.querySelector('.nav-container')?.offsetHeight || 0;
|
|
65
|
+
const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset - navHeight - 24;
|
|
66
|
+
|
|
67
|
+
window.scrollTo({
|
|
68
|
+
top: targetPosition,
|
|
69
|
+
behavior: 'smooth'
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Update URL without jumping
|
|
73
|
+
history.pushState(null, null, targetId);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Copy Code Functionality
|
|
80
|
+
*/
|
|
81
|
+
function initCopyCode() {
|
|
82
|
+
document.querySelectorAll('.card-code-block').forEach(block => {
|
|
83
|
+
// Create copy button
|
|
84
|
+
const copyBtn = document.createElement('button');
|
|
85
|
+
copyBtn.className = 'copy-btn';
|
|
86
|
+
copyBtn.innerHTML = '<i class="fa-regular fa-copy"></i>';
|
|
87
|
+
copyBtn.setAttribute('aria-label', 'Copy code');
|
|
88
|
+
copyBtn.setAttribute('title', 'Copy to clipboard');
|
|
89
|
+
|
|
90
|
+
// Style the button
|
|
91
|
+
copyBtn.style.cssText = `
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 8px;
|
|
94
|
+
right: 8px;
|
|
95
|
+
padding: 6px 10px;
|
|
96
|
+
background: rgba(255, 255, 255, 0.1);
|
|
97
|
+
border: none;
|
|
98
|
+
border-radius: 6px;
|
|
99
|
+
color: #94a3b8;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
opacity: 0;
|
|
102
|
+
transition: all 0.2s ease;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
// Make parent relative for positioning
|
|
107
|
+
block.style.position = 'relative';
|
|
108
|
+
block.appendChild(copyBtn);
|
|
109
|
+
|
|
110
|
+
// Show/hide on hover
|
|
111
|
+
block.addEventListener('mouseenter', () => {
|
|
112
|
+
copyBtn.style.opacity = '1';
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
block.addEventListener('mouseleave', () => {
|
|
116
|
+
copyBtn.style.opacity = '0';
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Copy functionality
|
|
120
|
+
copyBtn.addEventListener('click', async () => {
|
|
121
|
+
const code = block.querySelector('code');
|
|
122
|
+
if (!code) return;
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
await navigator.clipboard.writeText(code.textContent);
|
|
126
|
+
copyBtn.innerHTML = '<i class="fa-solid fa-check"></i>';
|
|
127
|
+
copyBtn.style.color = '#34d399';
|
|
128
|
+
|
|
129
|
+
setTimeout(() => {
|
|
130
|
+
copyBtn.innerHTML = '<i class="fa-regular fa-copy"></i>';
|
|
131
|
+
copyBtn.style.color = '#94a3b8';
|
|
132
|
+
}, 2000);
|
|
133
|
+
} catch (err) {
|
|
134
|
+
console.error('Failed to copy:', err);
|
|
135
|
+
copyBtn.innerHTML = '<i class="fa-solid fa-xmark"></i>';
|
|
136
|
+
copyBtn.style.color = '#f87171';
|
|
137
|
+
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
copyBtn.innerHTML = '<i class="fa-regular fa-copy"></i>';
|
|
140
|
+
copyBtn.style.color = '#94a3b8';
|
|
141
|
+
}, 2000);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Theme Toggle (Light/Dark)
|
|
149
|
+
*/
|
|
150
|
+
function initThemeToggle() {
|
|
151
|
+
// Check for saved theme preference or default to dark
|
|
152
|
+
const savedTheme = localStorage.getItem('theme') || 'dark';
|
|
153
|
+
document.documentElement.className = `theme-${savedTheme}`;
|
|
154
|
+
|
|
155
|
+
// Create theme toggle button if it doesn't exist
|
|
156
|
+
const existingToggle = document.querySelector('[data-theme-toggle]');
|
|
157
|
+
if (existingToggle) {
|
|
158
|
+
existingToggle.addEventListener('click', toggleTheme);
|
|
159
|
+
updateThemeToggleIcon(existingToggle, savedTheme);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function toggleTheme() {
|
|
164
|
+
const html = document.documentElement;
|
|
165
|
+
const currentTheme = html.classList.contains('theme-dark') ? 'dark' : 'light';
|
|
166
|
+
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
167
|
+
|
|
168
|
+
html.className = `theme-${newTheme}`;
|
|
169
|
+
localStorage.setItem('theme', newTheme);
|
|
170
|
+
|
|
171
|
+
const toggle = document.querySelector('[data-theme-toggle]');
|
|
172
|
+
if (toggle) {
|
|
173
|
+
updateThemeToggleIcon(toggle, newTheme);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function updateThemeToggleIcon(toggle, theme) {
|
|
178
|
+
const icon = toggle.querySelector('i');
|
|
179
|
+
if (icon) {
|
|
180
|
+
icon.className = theme === 'dark' ? 'fa-solid fa-sun' : 'fa-solid fa-moon';
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Intersection Observer for Animation on Scroll
|
|
186
|
+
*/
|
|
187
|
+
function initScrollAnimations() {
|
|
188
|
+
const observerOptions = {
|
|
189
|
+
threshold: 0.1,
|
|
190
|
+
rootMargin: '0px 0px -50px 0px'
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const observer = new IntersectionObserver((entries) => {
|
|
194
|
+
entries.forEach(entry => {
|
|
195
|
+
if (entry.isIntersecting) {
|
|
196
|
+
entry.target.classList.add('visible');
|
|
197
|
+
observer.unobserve(entry.target);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}, observerOptions);
|
|
201
|
+
|
|
202
|
+
document.querySelectorAll('.agent-card, .command-card, .skill-card, .mcp-card, .stat-card').forEach(card => {
|
|
203
|
+
card.style.opacity = '0';
|
|
204
|
+
card.style.transform = 'translateY(20px)';
|
|
205
|
+
card.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
|
|
206
|
+
observer.observe(card);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Add visible class styles
|
|
211
|
+
const style = document.createElement('style');
|
|
212
|
+
style.textContent = `
|
|
213
|
+
.agent-card.visible,
|
|
214
|
+
.command-card.visible,
|
|
215
|
+
.skill-card.visible,
|
|
216
|
+
.mcp-card.visible,
|
|
217
|
+
.stat-card.visible {
|
|
218
|
+
opacity: 1 !important;
|
|
219
|
+
transform: translateY(0) !important;
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
document.head.appendChild(style);
|
|
223
|
+
|
|
224
|
+
// Initialize scroll animations after a short delay
|
|
225
|
+
setTimeout(initScrollAnimations, 100);
|