mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-14 22:13:41 +08:00
Ports functionality from 10+ separate plugins into ECC so users only need one plugin installed. Consolidates: pr-review-toolkit, feature-dev, commit-commands, hookify, code-simplifier, security-guidance, frontend-design, explanatory-output-style, and personal skills. New agents (8): code-architect, code-explorer, code-simplifier, comment-analyzer, conversation-analyzer, pr-test-analyzer, silent-failure-hunter, type-design-analyzer New commands (9): commit, commit-push-pr, clean-gone, review-pr, feature-dev, hookify, hookify-list, hookify-configure, hookify-help New skills (8): frontend-design, hookify-rules, github-ops, knowledge-ops, lead-intelligence, oura-health, pmx-guidelines, remotion Enhanced skills (8): article-writing, content-engine, market-research, investor-materials, investor-outreach, x-api, security-scan, autonomous-loops — merged with personal skill content New hook: security-reminder.py (pattern-based OWASP vulnerability warnings on file edits) Totals: 36 agents, 69 commands, 128 skills, 29 hook scripts
35 lines
973 B
Markdown
35 lines
973 B
Markdown
---
|
|
name: measuring-dom-nodes
|
|
description: Measuring DOM element dimensions in Remotion
|
|
metadata:
|
|
tags: measure, layout, dimensions, getBoundingClientRect, scale
|
|
---
|
|
|
|
# Measuring DOM nodes in Remotion
|
|
|
|
Remotion applies a `scale()` transform to the video container, which affects values from `getBoundingClientRect()`. Use `useCurrentScale()` to get correct measurements.
|
|
|
|
## Measuring element dimensions
|
|
|
|
```tsx
|
|
import { useCurrentScale } from "remotion";
|
|
import { useRef, useEffect, useState } from "react";
|
|
|
|
export const MyComponent = () => {
|
|
const ref = useRef<HTMLDivElement>(null);
|
|
const scale = useCurrentScale();
|
|
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
|
|
|
|
useEffect(() => {
|
|
if (!ref.current) return;
|
|
const rect = ref.current.getBoundingClientRect();
|
|
setDimensions({
|
|
width: rect.width / scale,
|
|
height: rect.height / scale,
|
|
});
|
|
}, [scale]);
|
|
|
|
return <div ref={ref}>Content to measure</div>;
|
|
};
|
|
```
|