A tool for UI/UX designers and frontend developers. It allows for the instant calculation of the perfect corner radius for nested elements based on the outer radius and padding.
When creating interfaces, a common issue arises: if the same border-radius is set for both the outer container and the inner button, the corner spacing appears uneven. To make the interface look harmonious, the concentric radius rule must be applied.
This calculator automates the selection process, providing a visual preview and mathematically accurate data.
- Bidirectional Synchronization: Changing any parameter (outer radius, padding, or inner radius) automatically recalculates the other values.
- Real-time Visualization: You can instantly see the result of applying
border-radiusandpaddingCSS properties. - Mathematical Precision: Eliminates errors caused by visual estimation.
- Multilingual: Supports 10 interface languages.
The tool is based on the principle of concentric shapes. To ensure the border thickness (or padding) appears consistent on straight sections and in corners, the following formula is used:
Where:
- R outer — Parent container corner radius.
- Padding — Distance between the parent and child elements.
- R inner — Target radius of the child element.
If
$R_{outer} < Padding$ , the inner radius must be 0; otherwise, the nested element will overflow the parent's curvature. The calculator accounts for this constraint.
The interface is translated into 10 languages for the convenience of users worldwide:
| Language | Menu Name |
|---|---|
| English | English |
| Russian | Русский |
| Ukrainian | Українська |
| Hindi | हिन्दी (Hindi) |
| Spanish | Español |
| Arabic | العربية (Arabic) |
| French | Français |
| Portuguese | Português |
| German | Deutsch |
| Indonesian | Bahasa Indonesia |
The project does not require building, dependency installation, or Node.js. It is written in pure HTML, CSS, and JavaScript.
Local Launch:
- Clone the repository:
git clone [https://github.com/OstinUA/Nested-Radius-Calculator.git](https://github.com/OstinUA/Nested-Radius-Calculator.git)
- Open the
index.htmlfile in any modern browser.
GitHub Pages Deployment:
- Go to repository Settings.
- Navigate to the Pages section.
- Under Branch, select
mainand click Save. - In a few minutes, the site will be available at the link provided in the settings.
index.html— Markup and application structure.style.css— Styling, color variables, and responsiveness.script.js— Calculation logic and event handling.translations.js— Object containing language packages.
Инструмент для UI/UX дизайнеров и фронтенд-разработчиков. Позволяет мгновенно рассчитать идеальный радиус скругления для вложенных элементов, основываясь на внешнем радиусе и отступах (padding).
При создании интерфейсов часто возникает проблема: если задать одинаковый border-radius для внешнего контейнера и внутренней кнопки, отступы в углах будут визуально казаться неравномерными. Чтобы интерфейс выглядел гармонично, необходимо использовать правило концентрических радиусов.
Этот калькулятор автоматизирует процесс подбора значений, предоставляя визуальное превью и математически точные данные.
- Двусторонняя синхронизация: Изменение любого параметра (внешний радиус, отступ или внутренний радиус) автоматически пересчитывает остальные значения.
- Визуализация в реальном времени: Вы сразу видите результат применения CSS-свойств
border-radiusиpadding. - Математическая точность: Исключает ошибки визуального подбора "на глаз".
- Мультиязычность: Поддержка 10 языков интерфейса.
В основе работы лежит принцип концентричности фигур. Для того чтобы толщина рамки (или отступа) казалась одинаковой на прямых участках и в углах, используется формула:
Где:
- R outer — Радиус скругления родительского контейнера.
- Padding — Расстояние между родительским и дочерним элементом.
- R inner — Искомый радиус дочернего элемента.
Если
$R_{outer} < Padding$ , внутренний радиус должен быть равен 0, иначе вложенный элемент выйдет за пределы родительского скругления. Калькулятор учитывает это ограничение.
Интерфейс переведен на 10 языков для удобства пользователей по всему миру:
| Язык | Название в меню |
|---|---|
| Английский | English |
| Русский | Русский |
| Украинский | Українська |
| Хинди | हिन्दी (Hindi) |
| Испанский | Español |
| Арабский | العربية (Arabic) |
| Французский | Français |
| Португальский | Português |
| Немецкий | Deutsch |
| Индонезийский | Bahasa Indonesia |
Проект не требует сборки, установки зависимостей или использования Node.js. Он написан на чистом HTML, CSS и JavaScript.
Локальный запуск:
- Склонируйте репозиторий:
git clone [https://github.com/OstinUA/Nested-Radius-Calculator.git](https://github.com/OstinUA/Nested-Radius-Calculator.git)
- Откройте файл
index.htmlв любом современном браузере.
Размещение на GitHub Pages:
- Зайдите в настройки репозитория (Settings).
- Перейдите в раздел Pages.
- В пункте Branch выберите
mainи нажмите Save. - Через несколько минут сайт будет доступен по ссылке, указанной в настройках.
index.html— Разметка и структура приложения.style.css— Стилизация, цветовые переменные и адаптивность.script.js— Логика вычислений и обработка событий.translations.js— Объект с языковыми пакетами.