ipv6 subnet calculator

This commit is contained in:
Alicia Sykes committed 2025-08-31 10:47:17 +01:00
1 parent 165e5506ed
commit a6f7b0d1a8
8 files changed
+1440 -8

No files matched your search

@@ -0,0 +1,837 @@
<script lang="ts">
import {
calculateIPv6Subnet,
getCommonIPv6Prefixes,
parseIPv6WithPrefix,
type IPv6SubnetResult
} from '$lib/utils/ipv6-subnet-calculations.js';
import Tooltip from './Tooltip.svelte';
import Icon from './Icon.svelte';
let networkAddress = $state('2001:db8::/64');
let prefixLength = $state(64);
let subnetResult = $state<IPv6SubnetResult | null>(null);
let copiedStates = $state<Record<string, boolean>>({});
let showBinaryView = $state(false);
const commonPrefixes = getCommonIPv6Prefixes();
/* Handle input change for combined address/prefix */
function handleAddressInput(value: string) {
const parsed = parseIPv6WithPrefix(value);
if (parsed) {
networkAddress = `${parsed.address}/${parsed.prefix}`;
prefixLength = parsed.prefix;
} else {
networkAddress = value;
}
}
/* Set preset example */
function setPreset(address: string, prefix: number) {
networkAddress = `${address}/${prefix}`;
prefixLength = prefix;
}
/* Copy text to clipboard */
async function copyToClipboard(text: string, id: string) {
try {
await navigator.clipboard.writeText(text);
copiedStates[id] = true;
setTimeout(() => {
copiedStates[id] = false;
}, 3000);
} catch (err) {
console.error('Failed to copy text: ', err);
}
}
/* Get prefix description */
function getPrefixDescription(prefix: number): string {
const common = commonPrefixes.find(p => p.prefix === prefix);
return common?.description || `/${prefix} - Custom prefix length`;
}
/* Format large numbers */
function formatLargeNumber(num: string): string {
if (num.includes('≈')) return num;
const cleaned = num.replace(/[,\s]/g, '');
if (cleaned.length > 15) {
return `${cleaned.slice(0, 6)}... (${cleaned.length} digits)`;
}
return num;
}
// Reactive calculation
$effect(() => {
const addressPart = networkAddress.split('/')[0];
if (addressPart && prefixLength) {
subnetResult = calculateIPv6Subnet(addressPart, prefixLength);
}
});
</script>
<div class="card ipv6-calc-card">
<header class="card-header">
<h2>IPv6 Subnet Calculator</h2>
<p>Calculate IPv6 subnet information with 128-bit addressing and modern network prefix notation.</p>
</header>
<!-- Input Section -->
<div class="input-section">
<h3>Network Configuration</h3>
<div class="input-grid">
<div class="form-group">
<label for="ipv6-input">IPv6 Network Address</label>
<div class="input-wrapper">
<input
id="ipv6-input"
type="text"
bind:value={networkAddress}
oninput={(e) => handleAddressInput(e.target?.value || '')}
placeholder="2001:db8::/64"
class="ipv6-input"
/>
<Tooltip text="Enter IPv6 address with prefix (e.g., 2001:db8::/64) or address only">
<Icon name="help" size="sm" />
</Tooltip>
</div>
</div>
<div class="form-group">
<label for="prefix-input">Prefix Length</label>
<div class="prefix-controls">
<span class="prefix-display">/{prefixLength}</span>
<input
id="prefix-slider"
type="range"
min="1"
max="128"
bind:value={prefixLength}
class="prefix-slider"
/>
<input
id="prefix-input"
type="number"
min="1"
max="128"
bind:value={prefixLength}
class="prefix-number"
/>
</div>
<p class="prefix-description">{getPrefixDescription(prefixLength)}</p>
</div>
</div>
</div>
<!-- Common Presets -->
<div class="presets-section">
<h3>Common IPv6 Networks</h3>
<div class="presets-grid">
<button type="button" class="preset-btn" onclick={() => setPreset('2001:db8::', 48)}>
Documentation /48
</button>
<button type="button" class="preset-btn" onclick={() => setPreset('2001:db8::', 64)}>
Standard Subnet /64
</button>
<button type="button" class="preset-btn" onclick={() => setPreset('fe80::', 64)}>
Link-Local /64
</button>
<button type="button" class="preset-btn" onclick={() => setPreset('::1', 128)}>
Loopback /128
</button>
<button type="button" class="preset-btn" onclick={() => setPreset('2001:4860:4860::', 48)}>
Google DNS /48
</button>
<button type="button" class="preset-btn" onclick={() => setPreset('ff02::1', 128)}>
Multicast All Nodes
</button>
</div>
</div>
<!-- Results -->
{#if subnetResult}
<div class="results-section">
{#if subnetResult.success && subnetResult.subnet}
<!-- Network Information -->
<div class="info-panel success">
<h3>IPv6 Subnet Information</h3>
<div class="info-grid">
<div class="info-item">
<span class="info-label">Network</span>
<div class="value-copy">
<span class="info-value">{subnetResult.subnet.networkCompressed}/{subnetResult.subnet.prefixLength}</span>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['network']}
onclick={() => copyToClipboard(`${subnetResult.subnet.networkCompressed}/${subnetResult.subnet.prefixLength}`, 'network')}
>
<Icon name={copiedStates['network'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="info-item">
<span class="info-label">Total Addresses</span>
<span class="info-value large-number">{formatLargeNumber(subnetResult.subnet.totalAddresses)}</span>
</div>
</div>
</div>
<!-- Detailed Information -->
<div class="details-section">
<div class="details-header">
<h3>Network Details</h3>
<div class="header-actions">
<button
type="button"
class="btn btn-secondary btn-sm"
onclick={() => showBinaryView = !showBinaryView}
>
<Icon name="binary" size="sm" />
{showBinaryView ? 'Hide' : 'Show'} Binary
</button>
</div>
</div>
<div class="details-grid">
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Network Address (Compressed)</span>
<Tooltip text="Compressed IPv6 notation using :: for consecutive zero groups">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value">{subnetResult.subnet.networkCompressed}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['compressed']}
onclick={() => copyToClipboard(subnetResult.subnet.networkCompressed, 'compressed')}
>
<Icon name={copiedStates['compressed'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Network Address (Expanded)</span>
<Tooltip text="Full 128-bit IPv6 representation with all zero groups shown">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value expanded">{subnetResult.subnet.networkExpanded}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['expanded']}
onclick={() => copyToClipboard(subnetResult.subnet.networkExpanded, 'expanded')}
>
<Icon name={copiedStates['expanded'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Subnet Mask</span>
<Tooltip text="IPv6 subnet mask showing network portion (compressed format)">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value">{subnetResult.subnet.subnetMask}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['mask']}
onclick={() => copyToClipboard(subnetResult.subnet.subnetMask, 'mask')}
>
<Icon name={copiedStates['mask'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Address Range</span>
<Tooltip text="First and last assignable addresses in the subnet">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value range">
{subnetResult.subnet.firstAddress} - {subnetResult.subnet.lastAddress}
</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['range']}
onclick={() => copyToClipboard(`${subnetResult.subnet.firstAddress} - ${subnetResult.subnet.lastAddress}`, 'range')}
>
<Icon name={copiedStates['range'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Assignable Addresses</span>
<Tooltip text="Number of addresses available for host assignment (excluding network/broadcast concepts)">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value">{formatLargeNumber(subnetResult.subnet.assignableAddresses)}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['assignable']}
onclick={() => copyToClipboard(subnetResult.subnet.assignableAddresses, 'assignable')}
>
<Icon name={copiedStates['assignable'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
<div class="detail-item">
<div class="detail-label-wrapper">
<span class="detail-label">Reverse DNS Zone</span>
<Tooltip text="PTR record zone for reverse DNS lookups">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value reverse">{subnetResult.subnet.reverseZone}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['reverse']}
onclick={() => copyToClipboard(subnetResult.subnet.reverseZone, 'reverse')}
>
<Icon name={copiedStates['reverse'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
{#if showBinaryView}
<div class="detail-item full-width">
<div class="detail-label-wrapper">
<span class="detail-label">Binary Prefix Representation</span>
<Tooltip text="128-bit binary representation showing network (1) and host (0) bits">
<Icon name="help" size="sm" />
</Tooltip>
</div>
<div class="value-copy">
<code class="detail-value binary-display">{subnetResult.subnet.binaryPrefix}</code>
<button
class="btn btn-icon copy-btn"
class:copied={copiedStates['binary']}
onclick={() => copyToClipboard(subnetResult.subnet.binaryPrefix, 'binary')}
>
<Icon name={copiedStates['binary'] ? 'check' : 'copy'} size="sm" />
</button>
</div>
</div>
{/if}
</div>
</div>
<!-- IPv6 Address Structure Visualization -->
<div class="visualization-section">
<h3>IPv6 Address Structure</h3>
<div class="address-structure">
<div class="structure-header">
<h4>128-bit Address Breakdown</h4>
<p>Showing network and host portions for {subnetResult.subnet.networkCompressed}/{prefixLength}</p>
</div>
<div class="bit-visualization">
<div class="bit-section network-bits">
<div class="bit-header">
<span class="bit-label">Network Portion</span>
<span class="bit-count">{prefixLength} bits</span>
</div>
<div class="bit-bar" style="width: {(prefixLength / 128) * 100}%"></div>
</div>
<div class="bit-section host-bits">
<div class="bit-header">
<span class="bit-label">Host Portion</span>
<span class="bit-count">{128 - prefixLength} bits</span>
</div>
<div class="bit-bar" style="width: {((128 - prefixLength) / 128) * 100}%"></div>
</div>
</div>
<div class="bit-scale">
<div class="scale-markers">
<span>0</span>
<span>32</span>
<span>64</span>
<span>96</span>
<span>128</span>
</div>
</div>
</div>
</div>
{:else}
<!-- Error Display -->
<div class="info-panel error">
<h3>Calculation Error</h3>
<p class="error-message">{subnetResult.error}</p>
</div>
{/if}
</div>
{/if}
</div>
<style>
.ipv6-calc-card .btn :global(.icon) {
width: 1rem;
height: 1rem;
vertical-align: middle;
}
.input-section {
margin-bottom: var(--spacing-lg);
h3 {
margin-bottom: var(--spacing-md);
color: var(--color-primary);
}
}
.input-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--spacing-lg);
}
.input-wrapper {
display: flex;
align-items: center;
gap: var(--spacing-sm);
position: relative;
:global(.tooltip-trigger) {
color: var(--text-secondary);
opacity: 0.7;
transition: opacity var(--transition-fast);
&:hover {
opacity: 1;
color: var(--color-info);
}
}
}
.ipv6-input {
flex: 1;
font-family: var(--font-mono);
font-size: var(--font-size-sm);
}
.prefix-controls {
display: flex;
align-items: center;
gap: var(--spacing-sm);
margin-top: var(--spacing-xs);
}
.prefix-display {
font-family: var(--font-mono);
font-weight: 600;
color: var(--color-primary);
font-size: var(--font-size-md);
min-width: 3rem;
}
.prefix-slider {
flex: 1;
height: 0.5rem;
background-color: var(--bg-tertiary);
border-radius: var(--radius-lg);
appearance: none;
cursor: pointer;
outline: none;
&::-webkit-slider-thumb {
appearance: none;
height: 1.25rem;
width: 1.25rem;
border-radius: 50%;
background: var(--color-primary);
cursor: pointer;
box-shadow: var(--shadow-md);
transition: transform var(--transition-fast);
&:hover {
transform: scale(1.1);
}
}
&::-moz-range-thumb {
height: 1.25rem;
width: 1.25rem;
border-radius: 50%;
background: var(--color-primary);
cursor: pointer;
border: none;
box-shadow: var(--shadow-md);
transition: transform var(--transition-fast);
&:hover {
transform: scale(1.1);
}
}
}
.prefix-number {
width: 4rem;
text-align: center;
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
&[type=number] {
-moz-appearance: textfield;
}
}
.prefix-description {
margin-top: var(--spacing-xs);
font-size: var(--font-size-sm);
color: var(--text-secondary);
font-style: italic;
}
.presets-section {
margin-bottom: var(--spacing-lg);
h3 {
margin-bottom: var(--spacing-md);
color: var(--color-primary);
}
}
.presets-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: var(--spacing-sm);
}
.preset-btn {
padding: var(--spacing-xs) var(--spacing-sm);
font-size: var(--font-size-sm);
font-family: var(--font-mono);
border-radius: var(--radius-sm);
background-color: var(--bg-tertiary);
color: var(--text-primary);
border: 1px solid var(--border-secondary);
transition: all var(--transition-fast);
text-align: left;
&:hover {
background-color: var(--surface-hover);
border-color: var(--color-primary);
color: var(--color-primary);
}
}
.results-section {
margin-top: var(--spacing-xl);
display: flex;
flex-direction: column;
gap: var(--spacing-lg);
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: var(--spacing-md);
margin-top: var(--spacing-md);
}
.info-item {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.value-copy {
justify-content: center;
}
}
.info-label {
font-size: var(--font-size-sm);
color: var(--text-secondary);
margin-bottom: var(--spacing-sm);
}
.info-value {
font-family: var(--font-mono);
font-size: var(--font-size-lg);
font-weight: 600;
color: var(--text-primary);
&.large-number {
font-size: var(--font-size-md);
text-align: center;
word-break: break-all;
}
}
.details-section {
background-color: var(--bg-secondary);
border-radius: var(--radius-lg);
padding: var(--spacing-lg);
}
.details-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--spacing-lg);
h3 {
margin: 0;
color: var(--color-primary);
}
}
.header-actions {
display: flex;
gap: var(--spacing-sm);
}
.details-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: var(--spacing-lg);
}
.detail-item {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
&.full-width {
grid-column: 1 / -1;
}
}
.detail-label-wrapper {
display: flex;
align-items: center;
gap: var(--spacing-xs);
margin-bottom: var(--spacing-xs);
:global(.tooltip-trigger) {
display: flex;
align-items: center;
color: var(--text-secondary);
opacity: 0.7;
transition: opacity var(--transition-fast);
&:hover {
opacity: 1;
color: var(--color-info);
}
}
}
.detail-label {
font-size: var(--font-size-sm);
color: var(--text-secondary);
font-weight: 600;
flex: 1;
}
.value-copy {
display: flex;
align-items: start;
gap: var(--spacing-sm);
width: 100%;
height: 100%;
}
.detail-value {
font-family: var(--font-mono);
background-color: var(--bg-tertiary);
padding: var(--spacing-sm) var(--spacing-md);
border-radius: var(--radius-sm);
border: 1px solid var(--border-primary);
flex: 1;
min-width: 0;
font-size: var(--font-size-sm);
word-break: break-all;
word-wrap: anywhere;
height: 100%;
overflow: auto;
&.expanded {
font-size: var(--font-size-xs);
letter-spacing: 0.5px;
}
&.range {
font-size: var(--font-size-xs);
line-height: 1.4;
}
&.reverse {
font-size: var(--font-size-xs);
}
&.binary-display {
font-size: var(--font-size-xs);
line-height: 1.6;
letter-spacing: 1px;
}
}
.copy-btn {
transition: all var(--transition-fast);
&.copied {
color: var(--color-success);
background-color: rgba(35, 134, 54, 0.1);
border-color: var(--color-success);
transform: scale(1.05);
}
}
.visualization-section {
background-color: var(--bg-secondary);
border-radius: var(--radius-lg);
padding: var(--spacing-lg);
}
.address-structure {
margin-top: var(--spacing-md);
}
.structure-header {
text-align: center;
margin-bottom: var(--spacing-lg);
h4 {
color: var(--color-primary);
margin-bottom: var(--spacing-xs);
}
p {
color: var(--text-secondary);
font-size: var(--font-size-sm);
margin: 0;
}
}
.bit-visualization {
display: flex;
flex-direction: column;
gap: var(--spacing-md);
margin-bottom: var(--spacing-md);
}
.bit-section {
&.network-bits .bit-bar {
background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
}
&.host-bits .bit-bar {
background: linear-gradient(90deg, var(--color-info), var(--color-info-light));
}
}
.bit-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--spacing-xs);
}
.bit-label {
font-weight: 600;
color: var(--text-primary);
font-size: var(--font-size-sm);
}
.bit-count {
font-family: var(--font-mono);
color: var(--text-secondary);
font-size: var(--font-size-sm);
}
.bit-bar {
height: 1.5rem;
border-radius: var(--radius-sm);
position: relative;
min-width: 2px;
}
.bit-scale {
margin-top: var(--spacing-sm);
}
.scale-markers {
display: flex;
justify-content: space-between;
font-family: var(--font-mono);
font-size: var(--font-size-xs);
color: var(--text-secondary);
}
.error-message {
color: var(--color-error);
font-weight: 500;
margin: 0;
}
/* Responsive Design */
@media (max-width: 768px) {
.input-grid {
grid-template-columns: 1fr;
gap: var(--spacing-md);
}
.presets-grid {
grid-template-columns: 1fr;
}
.info-grid {
grid-template-columns: 1fr;
}
.details-grid {
grid-template-columns: 1fr;
gap: var(--spacing-md);
}
.details-section,
.visualization-section {
padding: var(--spacing-md);
}
.details-header {
flex-direction: column;
gap: var(--spacing-sm);
align-items: stretch;
}
}
@media (max-width: 480px) {
.prefix-controls {
flex-wrap: wrap;
gap: var(--spacing-xs);
}
.prefix-slider {
order: 3;
width: 100%;
}
}
</style>
+13 -4
View File
@@ -57,13 +57,18 @@
{:else if name === 'ip-convertor'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 272C112 289.7 126.3 304 144 304C161.7 304 176 289.7 176 272C176 254.3 161.7 240 144 240C126.3 240 112 254.3 112 272zM368 496C368 513.7 382.3 528 400 528C417.7 528 432 513.7 432 496C432 478.3 417.7 464 400 464C382.3 464 368 478.3 368 496zM432 144C432 161.7 446.3 176 464 176C481.7 176 496 161.7 496 144C496 126.3 481.7 112 464 112C446.3 112 432 126.3 432 144z"/><path d="M432 144C432 126.3 446.3 112 464 112C481.7 112 496 126.3 496 144C496 161.7 481.7 176 464 176C446.3 176 432 161.7 432 144zM402.1 194.6C408.9 202.9 417.3 209.8 426.8 214.8L390 416.6C378.5 418 367.8 421.9 358.3 427.7L217.3 304.2C221.6 294.3 224 283.5 224 272C224 270 223.9 267.9 223.8 265.9L402.1 194.6zM474 223.4C513.5 218.5 544 184.8 544 144C544 99.8 508.2 64 464 64C419.8 64 384 99.8 384 144C384 146 384.1 148.1 384.2 150.1L205.9 221.4C191.3 203.4 169 192 144 192C99.8 192 64 227.8 64 272C64 316.2 99.8 352 144 352C159.3 352 173.5 347.7 185.6 340.3L326.7 463.8C322.4 473.7 320 484.5 320 496C320 540.2 355.8 576 400 576C444.2 576 480 540.2 480 496C480 465.3 462.7 438.6 437.3 425.2L474 223.4zM368 496C368 478.3 382.3 464 400 464C417.7 464 432 478.3 432 496C432 513.7 417.7 528 400 528C382.3 528 368 513.7 368 496zM144 240C161.7 240 176 254.3 176 272C176 289.7 161.7 304 144 304C126.3 304 112 289.7 112 272C112 254.3 126.3 240 144 240z"/></svg>
{:else if name === 'subnet-calculator'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M176 240L176 512C176 520.8 183.2 528 192 528L448 528C456.8 528 464 520.8 464 512L464 240L176 240zM256 296C256 309.3 245.3 320 232 320C218.7 320 208 309.3 208 296C208 282.7 218.7 272 232 272C245.3 272 256 282.7 256 296zM256 384C256 397.3 245.3 408 232 408C218.7 408 208 397.3 208 384C208 370.7 218.7 360 232 360C245.3 360 256 370.7 256 384zM208 472C208 458.7 218.7 448 232 448L320 448C333.3 448 344 458.7 344 472C344 485.3 333.3 496 320 496L232 496C218.7 496 208 485.3 208 472zM344 296C344 309.3 333.3 320 320 320C306.7 320 296 309.3 296 296C296 282.7 306.7 272 320 272C333.3 272 344 282.7 344 296zM344 384C344 397.3 333.3 408 320 408C306.7 408 296 397.3 296 384C296 370.7 306.7 360 320 360C333.3 360 344 370.7 344 384zM432 296C432 309.3 421.3 320 408 320C394.7 320 384 309.3 384 296C384 282.7 394.7 272 408 272C421.3 272 432 282.7 432 296zM432 384C432 397.3 421.3 408 408 408C394.7 408 384 397.3 384 384C384 370.7 394.7 360 408 360C421.3 360 432 370.7 432 384zM384 472C384 458.7 394.7 448 408 448C421.3 448 432 458.7 432 472C432 485.3 421.3 496 408 496C394.7 496 384 485.3 384 472z"/><path d="M464 240L464 512C464 520.8 456.8 528 448 528L192 528C183.2 528 176 520.8 176 512L176 240L464 240zM464 192L176 192L176 128C176 119.2 183.2 112 192 112L448 112C456.8 112 464 119.2 464 128L464 192zM512 192L512 128C512 92.7 483.3 64 448 64L192 64C156.7 64 128 92.7 128 128L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 192zM208 296C208 309.3 218.7 320 232 320C245.3 320 256 309.3 256 296C256 282.7 245.3 272 232 272C218.7 272 208 282.7 208 296zM232 360C218.7 360 208 370.7 208 384C208 397.3 218.7 408 232 408C245.3 408 256 397.3 256 384C256 370.7 245.3 360 232 360zM208 472C208 485.3 218.7 496 232 496L320 496C333.3 496 344 485.3 344 472C344 458.7 333.3 448 320 448L232 448C218.7 448 208 458.7 208 472zM320 272C306.7 272 296 282.7 296 296C296 309.3 306.7 320 320 320C333.3 320 344 309.3 344 296C344 282.7 333.3 272 320 272zM296 384C296 397.3 306.7 408 320 408C333.3 408 344 397.3 344 384C344 370.7 333.3 360 320 360C306.7 360 296 370.7 296 384zM408 272C394.7 272 384 282.7 384 296C384 309.3 394.7 320 408 320C421.3 320 432 309.3 432 296C432 282.7 421.3 272 408 272zM384 384C384 397.3 394.7 408 408 408C421.3 408 432 397.3 432 384C432 370.7 421.3 360 408 360C394.7 360 384 370.7 384 384zM408 448C394.7 448 384 458.7 384 472C384 485.3 394.7 496 408 496C421.3 496 432 485.3 432 472C432 458.7 421.3 448 408 448z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 464L112 496L144 496L144 464L112 464zM144 160C144 168.8 151.2 176 160 176L480 176C488.8 176 496 168.8 496 160C496 151.2 488.8 144 480 144L160 144C151.2 144 144 151.2 144 160zM291.9 312L320 340.1L348.1 312L320 283.9L291.9 312zM304 464L304 496L336 496L336 464L304 464zM496 464L496 496L528 496L528 464L496 464z"/><path d="M480 144C488.8 144 496 151.2 496 160C496 168.8 488.8 176 480 176L160 176C151.2 176 144 168.8 144 160C144 151.2 151.2 144 160 144L480 144zM160 96C124.7 96 96 124.7 96 160C96 195.3 124.7 224 160 224L296 224L296 240C292.4 243.6 279.7 256.3 257.9 278.1L248 288L192 288C143.4 288 104 327.4 104 376L104 416L96 416C78.3 416 64 430.3 64 448L64 512C64 529.7 78.3 544 96 544L160 544C177.7 544 192 529.7 192 512L192 448C192 430.3 177.7 416 160 416L152 416L152 376C152 353.9 169.9 336 192 336L248 336C251.6 339.6 264.3 352.3 286.1 374.1L296 384L296 416L288 416C270.3 416 256 430.3 256 448L256 512C256 529.7 270.3 544 288 544L352 544C369.7 544 384 529.7 384 512L384 448C384 430.3 369.7 416 352 416L344 416L344 384L392 336L448 336C470.1 336 488 353.9 488 376L488 416L480 416C462.3 416 448 430.3 448 448L448 512C448 529.7 462.3 544 480 544L544 544C561.7 544 576 529.7 576 512L576 448C576 430.3 561.7 416 544 416L536 416L536 376C536 327.4 496.6 288 448 288L392 288C388.4 284.4 375.7 271.7 353.9 249.9L344 240L344 224L480 224C515.3 224 544 195.3 544 160C544 124.7 515.3 96 480 96L160 96zM112 496L112 464L144 464L144 496L112 496zM304 496L304 464L336 464L336 496L304 496zM496 496L496 464L528 464L528 496L496 496zM291.9 312L320 283.9L348.1 312L320 340.1L291.9 312z"/></svg>
{:else if name === 'vlsm-calculator'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M139.2 212C132.6 223.5 136.5 238.2 148 244.8C159.5 251.4 174.2 247.5 180.8 236C187.4 224.5 183.5 209.8 172 203.2C160.5 196.6 145.8 200.5 139.2 212zM139.2 428C145.8 439.5 160.5 443.4 172 436.8C183.5 430.2 187.4 415.5 180.8 404C174.2 392.5 159.5 388.6 148 395.2C136.5 401.8 132.6 416.5 139.2 428zM296 128C296 141.3 306.7 152 320 152C333.3 152 344 141.3 344 128C344 114.7 333.3 104 320 104C306.7 104 296 114.7 296 128zM296 320C296 333.3 306.7 344 320 344C333.3 344 344 333.3 344 320C344 306.7 333.3 296 320 296C306.7 296 296 306.7 296 320zM296 512C296 525.3 306.7 536 320 536C333.3 536 344 525.3 344 512C344 498.7 333.3 488 320 488C306.7 488 296 498.7 296 512zM459.2 236C465.8 247.5 480.5 251.4 492 244.8C503.5 238.2 507.4 223.5 500.8 212C494.2 200.5 479.5 196.6 468 203.2C456.5 209.8 452.6 224.5 459.2 236zM459.2 404C452.6 415.5 456.5 430.2 468 436.8C479.5 443.4 494.2 439.5 500.8 428C507.4 416.5 503.5 401.8 492 395.2C480.5 388.6 465.8 392.5 459.2 404z"/><path d="M320 152C333.3 152 344 141.3 344 128C344 114.7 333.3 104 320 104C306.7 104 296 114.7 296 128C296 141.3 306.7 152 320 152zM384 128C384 154.9 367.5 177.9 344 187.3L344 260.6C367.5 270.1 384 293.1 384 319.9C384 323.3 383.7 326.6 383.2 329.9L441.4 364.8C445.9 361.4 450.8 358.7 455.9 356.6L455.9 283.3C450.7 281.2 445.9 278.5 441.4 275.1L412 292.7C407.3 276.9 398.7 262.8 387.3 251.6L416.7 234C412.7 208.6 424.4 182.3 447.9 168.6C478.5 150.9 517.7 161.4 535.3 192C552.9 222.6 542.5 261.8 511.9 279.4C509.3 280.9 506.6 282.2 503.9 283.3L503.9 356.6C506.6 357.7 509.3 359 511.9 360.5C542.5 378.2 553 417.3 535.3 447.9C517.6 478.5 478.5 489 447.9 471.3C424.3 457.7 412.7 431.3 416.7 405.9L358.5 371C354.1 374.3 349.2 377.1 344 379.2L344 452.5C367.5 462 384 485 384 511.8C384 547.1 355.3 575.8 320 575.8C284.7 575.8 256 547.1 256 511.8C256 484.9 272.5 461.9 296 452.5L296 379.2C272.5 369.7 256 346.7 256 319.9C256 316.5 256.3 313.2 256.8 309.9L198.6 275C194.1 278.4 189.2 281.1 184 283.2L184 356.5C189.1 358.6 194 361.3 198.5 364.7L227.9 347.1C232.6 362.9 241.2 377 252.6 388.2L223.2 406C227.2 431.4 215.6 457.8 192 471.4C161.4 489.1 122.3 478.6 104.6 448C86.9 417.4 97.4 378.3 128 360.6C130.6 359.1 133.3 357.8 136 356.7L136 283.4C133.3 282.3 130.6 281 128 279.5C97.4 261.8 86.9 222.6 104.6 192C122.3 161.4 161.4 150.9 192 168.6C215.6 182.2 227.2 208.6 223.2 234L281.4 268.9C285.8 265.6 290.7 262.8 295.9 260.7L295.9 187.4C272.4 177.9 255.9 154.9 255.9 128.1C255.9 92.8 284.6 64.1 319.9 64.1C355.2 64.1 383.9 92.8 383.9 128.1zM320 344C333.3 344 344 333.3 344 320C344 306.7 333.3 296 320 296C306.7 296 296 306.7 296 320C296 333.3 306.7 344 320 344zM492 244.8C503.5 238.2 507.4 223.5 500.8 212C494.2 200.5 479.5 196.6 468 203.2C456.5 209.8 452.6 224.5 459.2 236C465.8 247.5 480.5 251.4 492 244.8zM180.8 236C187.4 224.5 183.5 209.8 172 203.2C160.5 196.6 145.8 200.5 139.2 212C132.6 223.5 136.5 238.2 148 244.8C159.5 251.4 174.2 247.5 180.8 236zM344 512C344 498.7 333.3 488 320 488C306.7 488 296 498.7 296 512C296 525.3 306.7 536 320 536C333.3 536 344 525.3 344 512zM139.2 428C145.8 439.5 160.5 443.4 172 436.8C183.5 430.2 187.4 415.5 180.8 404C174.2 392.5 159.5 388.6 148 395.2C136.5 401.8 132.6 416.5 139.2 428zM492 395.2C480.5 388.6 465.8 392.5 459.2 404C452.6 415.5 456.5 430.2 468 436.8C479.5 443.4 494.2 439.5 500.8 428C507.4 416.5 503.5 401.8 492 395.2z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M121.9 192L192 262.1L192 121.9L121.9 192zM448 377.9L448 518L518.1 447.9L448 377.8z"/><path d="M199 64C221.6 64 240 82.3 240 105L240 168L552 168C565.3 168 576 178.7 576 192C576 205.3 565.3 216 552 216L240 216L240 279C240 301.6 221.7 320 199 320C188.1 320 177.7 315.7 170 308L71 209C66.5 204.5 64 198.4 64 192C64 185.6 66.5 179.5 71 175L170 76C177.7 68.3 188.1 64 199 64zM192 121.9L121.9 192L192 262.1L192 121.9zM400 361C400 338.4 418.3 320 441 320C451.9 320 462.3 324.3 470 332L569 431C573.5 435.5 576 441.6 576 448C576 454.4 573.5 460.5 569 465L470 564C462.3 571.7 451.9 576 441 576C418.4 576 400 557.7 400 535L400 472L88 472C74.7 472 64 461.3 64 448C64 434.7 74.7 424 88 424L400 424L400 361zM518.1 448L448 377.9L448 518L518.1 447.9z"/></svg>
{:else if name === 'ipv6-subnet-calculator'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 464L112 496L144 496L144 464L112 464zM304 144L304 176L336 176L336 144L304 144zM304 464L304 496L336 496L336 464L304 464zM496 464L496 496L528 496L528 464L496 464z"/><path d="M304 144L336 144L336 176L304 176L304 144zM288 96C270.3 96 256 110.3 256 128L256 192C256 209.7 270.3 224 288 224L296 224L296 288L176 288C136.2 288 104 320.2 104 360L104 416L96 416C78.3 416 64 430.3 64 448L64 512C64 529.7 78.3 544 96 544L160 544C177.7 544 192 529.7 192 512L192 448C192 430.3 177.7 416 160 416L152 416L152 360C152 346.7 162.7 336 176 336L296 336L296 416L288 416C270.3 416 256 430.3 256 448L256 512C256 529.7 270.3 544 288 544L352 544C369.7 544 384 529.7 384 512L384 448C384 430.3 369.7 416 352 416L344 416L344 336L464 336C477.3 336 488 346.7 488 360L488 416L480 416C462.3 416 448 430.3 448 448L448 512C448 529.7 462.3 544 480 544L544 544C561.7 544 576 529.7 576 512L576 448C576 430.3 561.7 416 544 416L536 416L536 360C536 320.2 503.8 288 464 288L344 288L344 224L352 224C369.7 224 384 209.7 384 192L384 128C384 110.3 369.7 96 352 96L288 96zM112 496L112 464L144 464L144 496L112 496zM304 496L304 464L336 464L336 496L304 496zM496 496L496 464L528 464L528 496L496 496z"/></svg>
{:else if name === 'supernet-calculator'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M107.2 308.1C103 315.5 103 324.6 107.2 331.9L203.4 500C207.7 507.5 215.6 512.1 224.2 512.1L415.8 512.1C424.4 512.1 432.4 507.5 436.6 500L532.8 332C537 324.6 537 315.5 532.8 308.2L436.7 140.1C432.4 132.6 424.4 128 415.8 128L224.2 128C215.6 128 207.6 132.6 203.4 140.1L107.2 308.1zM184 352C184 329.9 201.9 312 224 312L281.6 235.2C280.6 231.6 280 227.9 280 224C280 201.9 297.9 184 320 184C342.1 184 360 201.9 360 224C360 231.6 357.9 238.7 354.2 244.8L394.4 345.4C411.4 350 424 365.5 424 384C424 406.1 406.1 424 384 424C368.1 424 354.3 414.7 347.9 401.3L250.7 381.9C243.6 388.2 234.3 392.1 224 392.1C201.9 392.1 184 374.2 184 352.1zM266 335.9L345.2 351.7L313.5 272.5L266 335.9z"/><path d="M65.5 284.3C52.8 306.5 52.8 333.7 65.5 355.8L161.7 523.9C174.5 546.3 198.4 560.1 224.2 560.1L415.8 560.1C441.6 560.1 465.5 546.3 478.3 523.9L574.5 355.8C587.2 333.6 587.2 306.4 574.5 284.3L478.3 116.2C465.5 93.8 441.6 80 415.8 80L224.2 80C198.4 80 174.5 93.8 161.7 116.2L65.5 284.3zM107.2 332C103 324.6 103 315.5 107.2 308.2L203.4 140.1C207.7 132.6 215.6 128 224.2 128L415.8 128C424.4 128 432.4 132.6 436.6 140.1L532.8 308.2C537 315.6 537 324.7 532.8 332L436.7 500C432.4 507.5 424.5 512.1 415.9 512.1L224.3 512.1C215.7 512.1 207.7 507.5 203.5 500L107.2 332zM360 224C360 201.9 342.1 184 320 184C297.9 184 280 201.9 280 224C280 227.9 280.6 231.7 281.6 235.2L224 312C201.9 312 184 329.9 184 352C184 374.1 201.9 392 224 392C234.2 392 243.6 388.1 250.7 381.8L347.9 401.2C354.3 414.7 368.1 423.9 384 423.9C406.1 423.9 424 406 424 383.9C424 365.4 411.4 349.8 394.4 345.3L354.2 244.8C357.9 238.7 360 231.6 360 224zM266.1 335.9L313.6 272.5L345.3 351.7L266.1 335.9z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M139.2 212C132.6 223.5 136.5 238.2 148 244.8C159.5 251.4 174.2 247.5 180.8 236C187.4 224.5 183.5 209.8 172 203.2C160.5 196.6 145.8 200.5 139.2 212zM139.2 428C145.8 439.5 160.5 443.4 172 436.8C183.5 430.2 187.4 415.5 180.8 404C174.2 392.5 159.5 388.6 148 395.2C136.5 401.8 132.6 416.5 139.2 428zM296 128C296 141.3 306.7 152 320 152C333.3 152 344 141.3 344 128C344 114.7 333.3 104 320 104C306.7 104 296 114.7 296 128zM296 320C296 333.3 306.7 344 320 344C333.3 344 344 333.3 344 320C344 306.7 333.3 296 320 296C306.7 296 296 306.7 296 320zM296 512C296 525.3 306.7 536 320 536C333.3 536 344 525.3 344 512C344 498.7 333.3 488 320 488C306.7 488 296 498.7 296 512zM459.2 236C465.8 247.5 480.5 251.4 492 244.8C503.5 238.2 507.4 223.5 500.8 212C494.2 200.5 479.5 196.6 468 203.2C456.5 209.8 452.6 224.5 459.2 236zM459.2 404C452.6 415.5 456.5 430.2 468 436.8C479.5 443.4 494.2 439.5 500.8 428C507.4 416.5 503.5 401.8 492 395.2C480.5 388.6 465.8 392.5 459.2 404z"/><path d="M320 152C333.3 152 344 141.3 344 128C344 114.7 333.3 104 320 104C306.7 104 296 114.7 296 128C296 141.3 306.7 152 320 152zM384 128C384 154.9 367.5 177.9 344 187.3L344 260.6C367.5 270.1 384 293.1 384 319.9C384 323.3 383.7 326.6 383.2 329.9L441.4 364.8C445.9 361.4 450.8 358.7 455.9 356.6L455.9 283.3C450.7 281.2 445.9 278.5 441.4 275.1L412 292.7C407.3 276.9 398.7 262.8 387.3 251.6L416.7 234C412.7 208.6 424.4 182.3 447.9 168.6C478.5 150.9 517.7 161.4 535.3 192C552.9 222.6 542.5 261.8 511.9 279.4C509.3 280.9 506.6 282.2 503.9 283.3L503.9 356.6C506.6 357.7 509.3 359 511.9 360.5C542.5 378.2 553 417.3 535.3 447.9C517.6 478.5 478.5 489 447.9 471.3C424.3 457.7 412.7 431.3 416.7 405.9L358.5 371C354.1 374.3 349.2 377.1 344 379.2L344 452.5C367.5 462 384 485 384 511.8C384 547.1 355.3 575.8 320 575.8C284.7 575.8 256 547.1 256 511.8C256 484.9 272.5 461.9 296 452.5L296 379.2C272.5 369.7 256 346.7 256 319.9C256 316.5 256.3 313.2 256.8 309.9L198.6 275C194.1 278.4 189.2 281.1 184 283.2L184 356.5C189.1 358.6 194 361.3 198.5 364.7L227.9 347.1C232.6 362.9 241.2 377 252.6 388.2L223.2 406C227.2 431.4 215.6 457.8 192 471.4C161.4 489.1 122.3 478.6 104.6 448C86.9 417.4 97.4 378.3 128 360.6C130.6 359.1 133.3 357.8 136 356.7L136 283.4C133.3 282.3 130.6 281 128 279.5C97.4 261.8 86.9 222.6 104.6 192C122.3 161.4 161.4 150.9 192 168.6C215.6 182.2 227.2 208.6 223.2 234L281.4 268.9C285.8 265.6 290.7 262.8 295.9 260.7L295.9 187.4C272.4 177.9 255.9 154.9 255.9 128.1C255.9 92.8 284.6 64.1 319.9 64.1C355.2 64.1 383.9 92.8 383.9 128.1zM320 344C333.3 344 344 333.3 344 320C344 306.7 333.3 296 320 296C306.7 296 296 306.7 296 320C296 333.3 306.7 344 320 344zM492 244.8C503.5 238.2 507.4 223.5 500.8 212C494.2 200.5 479.5 196.6 468 203.2C456.5 209.8 452.6 224.5 459.2 236C465.8 247.5 480.5 251.4 492 244.8zM180.8 236C187.4 224.5 183.5 209.8 172 203.2C160.5 196.6 145.8 200.5 139.2 212C132.6 223.5 136.5 238.2 148 244.8C159.5 251.4 174.2 247.5 180.8 236zM344 512C344 498.7 333.3 488 320 488C306.7 488 296 498.7 296 512C296 525.3 306.7 536 320 536C333.3 536 344 525.3 344 512zM139.2 428C145.8 439.5 160.5 443.4 172 436.8C183.5 430.2 187.4 415.5 180.8 404C174.2 392.5 159.5 388.6 148 395.2C136.5 401.8 132.6 416.5 139.2 428zM492 395.2C480.5 388.6 465.8 392.5 459.2 404C452.6 415.5 456.5 430.2 468 436.8C479.5 443.4 494.2 439.5 500.8 428C507.4 416.5 503.5 401.8 492 395.2z"/></svg>
{:else if name === 'cidr-convertor-mask'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 400L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 400C496 391.2 488.8 384 480 384L160 384C151.2 384 144 391.2 144 400zM192 440C192 431.2 199.2 424 208 424L432 424C440.8 424 448 431.2 448 440C448 448.8 440.8 456 432 456L208 456C199.2 456 192 448.8 192 440z"/><path d="M391 191C400.4 181.6 415.6 181.6 424.9 191L439.9 206L439.9 167.9C439.9 154.6 429.2 143.9 415.9 143.9L317.9 143.9C319.2 149 319.9 154.4 319.9 159.9L319.9 223.9C319.9 259.2 291.2 287.9 255.9 287.9L159.9 287.9C124.6 287.9 95.9 259.2 95.9 223.9L96 160C96 124.7 124.7 96 160 96L416 96C455.8 96 488 128.2 488 168L488 206.1L503 191.1C512.4 181.7 527.6 181.7 536.9 191.1C546.2 200.5 546.3 215.7 536.9 225L480.9 281C471.5 290.4 456.3 290.4 447 281L391 225C381.6 215.6 381.6 200.4 391 191.1zM496 400C496 391.2 488.8 384 480 384L160 384C151.2 384 144 391.2 144 400L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 400zM544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 400C96 364.7 124.7 336 160 336L480 336C515.3 336 544 364.7 544 400L544 480zM272 160C272 151.2 264.8 144 256 144L160 144C151.2 144 144 151.2 144 160L144 224C144 232.8 151.2 240 160 240L256 240C264.8 240 272 232.8 272 224L272 160zM208 424L432 424C440.8 424 448 431.2 448 440C448 448.8 440.8 456 432 456L208 456C199.2 456 192 448.8 192 440C192 431.2 199.2 424 208 424z"/></svg>
{:else if name === 'cidr-convertor'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M86.6 384L208 262.6L208 320C208 326.4 210.5 332.5 215 337C219.5 341.5 225.6 344 232 344L320 344L320 448C320 434.7 309.3 424 296 424L232 424C218.7 424 208 434.7 208 448L208 505.4L86.6 384zM320 192C320 205.3 330.7 216 344 216L408 216C421.3 216 432 205.3 432 192L432 134.6L553.4 256L432 377.4L432 320C432 313.6 429.5 307.5 425 303C420.5 298.5 414.4 296 408 296L320 296L320 192z"/><path d="M432 134.6L432 192C432 205.3 421.3 216 408 216L344 216C330.7 216 320 205.3 320 192C320 178.7 330.7 168 344 168L384 168L384 96C384 83.1 391.8 71.4 403.8 66.4L403.8 66.4C415.8 61.4 429.5 64.2 438.7 73.3L598.7 233.3C611.2 245.8 611.2 266.1 598.7 278.6L438.7 438.6C429.5 447.8 415.8 450.5 403.8 445.5C391.8 440.5 384 428.9 384 416L384 344L232 344C225.6 344 219.5 341.5 215 337C210.5 332.5 208 326.4 208 320L208 262.6L86.6 384L208 505.4L208 448C208 434.7 218.7 424 232 424L296 424C309.3 424 320 434.7 320 448C320 461.3 309.3 472 296 472L256 472L256 544C256 556.9 248.2 568.6 236.2 573.6L236.2 573.6C224.2 578.6 210.5 575.8 201.3 566.7L41.3 406.7C28.8 394.2 28.8 373.9 41.3 361.4L201.3 201.4C210.5 192.2 224.2 189.5 236.2 194.5C248.2 199.5 256 211.1 256 224L256 296L408 296C414.4 296 420.5 298.5 425 303C429.5 307.5 432 313.6 432 320L432 377.4L553.4 256L432 134.6zM404.7 404.7L404.7 404.7zM235.3 532.7L235.3 532.7C235.3 532.7 235.3 532.7 235.3 532.7zM75.3 372.7C75.3 372.7 75.3 372.7 75.3 372.7L75.3 372.7L75.3 372.7z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 160L144 240C144 248.8 151.2 256 160 256L256 256C264.8 256 272 248.8 272 240L272 160C272 151.2 264.8 144 256 144L160 144C151.2 144 144 151.2 144 160zM176 200C176 191.2 183.2 184 192 184L224 184C232.8 184 240 191.2 240 200C240 208.8 232.8 216 224 216L192 216C183.2 216 176 208.8 176 200z"/><path d="M391 191C400.4 181.6 415.6 181.6 424.9 191L439.9 206L439.9 167.9C439.9 154.6 429.2 143.9 415.9 143.9L317.9 143.9C319.2 149 319.9 154.4 319.9 159.9L319.9 239.9C319.9 275.2 291.2 303.9 255.9 303.9L159.9 303.9C124.6 303.9 95.9 275.2 95.9 239.9L96 160C96 124.7 124.7 96 160 96L416 96C455.8 96 488 128.2 488 168L488 206.1L503 191.1C512.4 181.7 527.6 181.7 536.9 191.1C546.2 200.5 546.3 215.7 536.9 225L480.9 281C471.5 290.4 456.3 290.4 447 281L391 225C381.6 215.6 381.6 200.4 391 191.1zM496 416C496 407.2 488.8 400 480 400L160 400C151.2 400 144 407.2 144 416L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 416zM544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 416C96 380.7 124.7 352 160 352L480 352C515.3 352 544 380.7 544 416L544 480zM272 160C272 151.2 264.8 144 256 144L160 144C151.2 144 144 151.2 144 160L144 240C144 248.8 151.2 256 160 256L256 256C264.8 256 272 248.8 272 240L272 160zM192 184L224 184C232.8 184 240 191.2 240 200C240 208.8 232.8 216 224 216L192 216C183.2 216 176 208.8 176 200C176 191.2 183.2 184 192 184z"/></svg>
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M86.6 384L208 262.6L208 320C208 326.4 210.5 332.5 215 337C219.5 341.5 225.6 344 232 344L320 344L320 448C320 434.7 309.3 424 296 424L232 424C218.7 424 208 434.7 208 448L208 505.4L86.6 384zM320 192C320 205.3 330.7 216 344 216L408 216C421.3 216 432 205.3 432 192L432 134.6L553.4 256L432 377.4L432 320C432 313.6 429.5 307.5 425 303C420.5 298.5 414.4 296 408 296L320 296L320 192z"/><path d="M432 134.6L432 192C432 205.3 421.3 216 408 216L344 216C330.7 216 320 205.3 320 192C320 178.7 330.7 168 344 168L384 168L384 96C384 83.1 391.8 71.4 403.8 66.4L403.8 66.4C415.8 61.4 429.5 64.2 438.7 73.3L598.7 233.3C611.2 245.8 611.2 266.1 598.7 278.6L438.7 438.6C429.5 447.8 415.8 450.5 403.8 445.5C391.8 440.5 384 428.9 384 416L384 344L232 344C225.6 344 219.5 341.5 215 337C210.5 332.5 208 326.4 208 320L208 262.6L86.6 384L208 505.4L208 448C208 434.7 218.7 424 232 424L296 424C309.3 424 320 434.7 320 448C320 461.3 309.3 472 296 472L256 472L256 544C256 556.9 248.2 568.6 236.2 573.6L236.2 573.6C224.2 578.6 210.5 575.8 201.3 566.7L41.3 406.7C28.8 394.2 28.8 373.9 41.3 361.4L201.3 201.4C210.5 192.2 224.2 189.5 236.2 194.5C248.2 199.5 256 211.1 256 224L256 296L408 296C414.4 296 420.5 298.5 425 303C429.5 307.5 432 313.6 432 320L432 377.4L553.4 256L432 134.6zM404.7 404.7L404.7 404.7zM235.3 532.7L235.3 532.7C235.3 532.7 235.3 532.7 235.3 532.7zM75.3 372.7C75.3 372.7 75.3 372.7 75.3 372.7L75.3 372.7L75.3 372.7z"/></svg> -->
{:else if name === 'network-classes'}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M40 368C40 381.3 50.7 392 64 392C77.3 392 88 381.3 88 368C88 354.7 77.3 344 64 344C50.7 344 40 354.7 40 368zM200 128C200 141.3 210.7 152 224 152C237.3 152 248 141.3 248 128C248 114.7 237.3 104 224 104C210.7 104 200 114.7 200 128zM240 368C240 421 283 464 336 464C389 464 432 421 432 368C432 315 389 272 336 272C283 272 240 315 240 368zM552 192C552 205.3 562.7 216 576 216C589.3 216 600 205.3 600 192C600 178.7 589.3 168 576 168C562.7 168 552 178.7 552 192zM552 512C552 525.3 562.7 536 576 536C589.3 536 600 525.3 600 512C600 498.7 589.3 488 576 488C562.7 488 552 498.7 552 512z"/><path d="M224 104C237.3 104 248 114.7 248 128C248 141.3 237.3 152 224 152C210.7 152 200 141.3 200 128C200 114.7 210.7 104 224 104zM224 192C225.1 192 226.2 192 227.3 191.9L254.2 249.5C222.9 271.2 200.5 304.9 194 344L123.4 344C113.9 320.5 90.9 304 64.1 304C28.8 304 .1 332.7 .1 368C.1 403.3 28.8 432 64.1 432C91 432 114 415.5 123.4 392L194 392C205.4 460.1 264.7 512 336 512C379.8 512 419 492.5 445.4 461.6L512.8 502C512.3 505.2 512 508.6 512 511.9C512 547.2 540.7 575.9 576 575.9C611.3 575.9 640 547.2 640 511.9C640 476.6 611.3 447.9 576 447.9C561.5 447.9 548.2 452.7 537.5 460.8L470.2 420.4C476.6 404.1 480.1 386.4 480.1 367.9C480.1 344.7 474.6 322.7 464.8 303.3L542.4 246.4C552.2 252.5 563.7 256 576.1 256C611.4 256 640.1 227.3 640.1 192C640.1 156.7 611.4 128 576.1 128C540.8 128 512.1 156.7 512.1 192C512.1 197.4 512.8 202.7 514 207.7L436.4 264.6C410.5 239.4 375.1 223.9 336.1 223.9C322.8 223.9 310 225.7 297.8 229.1L270.9 171.6C281.5 160.2 288 144.9 288 128C288 92.7 259.3 64 224 64C188.7 64 160 92.7 160 128C160 163.3 188.7 192 224 192zM576 168C589.3 168 600 178.7 600 192C600 205.3 589.3 216 576 216C562.7 216 552 205.3 552 192C552 178.7 562.7 168 576 168zM552 512C552 498.7 562.7 488 576 488C589.3 488 600 498.7 600 512C600 525.3 589.3 536 576 536C562.7 536 552 525.3 552 512zM64 344C77.3 344 88 354.7 88 368C88 381.3 77.3 392 64 392C50.7 392 40 381.3 40 368C40 354.7 50.7 344 64 344zM336 272C389 272 432 315 432 368C432 421 389 464 336 464C283 464 240 421 240 368C240 315 283 272 336 272z"/></svg>
{:else if name === 'reserved-ranges'}
@@ -116,6 +121,10 @@
max-width: 5rem;
display: inline-block;
vertical-align: middle;
&.w-4 {
width: 1.25rem;
height: 1.25rem;
}
}
.icon svg {
+3
View File
@@ -61,6 +61,9 @@
background-color: var(--bg-tertiary);
border-bottom: 1px solid var(--border-primary);
padding: var(--spacing-sm) 0;
@media (max-width: 768px) {
display: none;
}
}
/* Flat navigation styles (existing) */
+10 -4
View File
@@ -24,11 +24,17 @@ export const TOP_NAV: NavItem[] = [
export const SUB_NAV: Record<string, NavItem[] | NavGroup[]> = {
'/subnetting': [
{
href: '/subnetting/subnet-calculator',
label: 'Subnet Calculator',
href: '/subnetting/ipv4-subnet-calculator',
label: 'IPv4 Subnet Calculator',
description: 'Calculate subnet information, network addresses, broadcast addresses, and host ranges with visual network analysis',
icon: 'subnet-calculator'
},
{
href: '/subnetting/ipv6-subnet-calculator',
label: 'IPv6 Subnet Calculator',
description: 'Calculate IPv6 subnets with 128-bit addressing and modern network prefix planning',
icon: 'ipv6-subnet-calculator'
},
{
href: '/subnetting/vlsm-calculator',
label: 'VLSM Calculator',
@@ -50,10 +56,10 @@ export const SUB_NAV: Record<string, NavItem[] | NavGroup[]> = {
icon: 'cidr-convertor'
},
{
href: '/cidr-convertor/subnet-mask-to-cidr',
href: '/cidr-convertor/subnet-mask-to-cidr',
label: 'Mask → CIDR',
description: 'Convert subnet mask format (255.255.255.0) to CIDR notation (/24)',
icon: 'cidr-convertor'
icon: 'cidr-convertor-mask'
}
],
'/ip-address-convertor': [
+4
View File
@@ -54,6 +54,10 @@ export const pages = {
ipConverter: {
title: 'IP Address Converter - IP Calc',
description: 'Convert IP addresses between decimal, binary, hexadecimal, and octal formats. Professional IP address conversion tool.'
},
ipv6SubnetCalculator: {
title: 'IPv6 Subnet Calculator - IP Calc',
description: 'Calculate IPv6 subnets with 128-bit addressing. Plan modern networks with IPv6 prefix lengths, address compression, and visualizations.'
}
};
+348
View File
@@ -0,0 +1,348 @@
/* IPv6 Subnet Calculation Utilities */
export interface IPv6SubnetResult {
success: boolean;
subnet?: {
network: string;
prefixLength: number;
subnetMask: string;
networkExpanded: string;
networkCompressed: string;
firstAddress: string;
lastAddress: string;
totalAddresses: string;
assignableAddresses: string;
binaryPrefix: string;
reverseZone: string;
};
error?: string;
originalNetwork: string;
originalPrefix: number;
}
export interface IPv6ValidationResult {
valid: boolean;
error?: string;
}
/* Expand IPv6 address to full 128-bit representation */
function expandIPv6(address: string): string {
// Remove prefix if present
const cleanAddress = address.split('/')[0];
// Handle :: compression
if (cleanAddress.includes('::')) {
const parts = cleanAddress.split('::');
const leftParts = parts[0] ? parts[0].split(':') : [];
const rightParts = parts[1] ? parts[1].split(':') : [];
// Calculate missing groups
const missingGroups = 8 - leftParts.length - rightParts.length;
const middleParts = Array(missingGroups).fill('0000');
const allParts = [...leftParts, ...middleParts, ...rightParts];
return allParts.map(part => part.padStart(4, '0')).join(':');
}
// Already expanded or no compression
return cleanAddress.split(':').map(part => part.padStart(4, '0')).join(':');
}
/* Compress IPv6 address using :: notation */
function compressIPv6(address: string): string {
const expanded = expandIPv6(address);
const groups = expanded.split(':');
// Remove leading zeros from each group
const trimmedGroups = groups.map(group => group.replace(/^0+/, '') || '0');
// Find longest sequence of consecutive zeros
let longestStart = -1;
let longestLength = 0;
let currentStart = -1;
let currentLength = 0;
for (let i = 0; i < trimmedGroups.length; i++) {
if (trimmedGroups[i] === '0') {
if (currentStart === -1) {
currentStart = i;
currentLength = 1;
} else {
currentLength++;
}
} else {
if (currentLength > longestLength) {
longestStart = currentStart;
longestLength = currentLength;
}
currentStart = -1;
currentLength = 0;
}
}
// Check final sequence
if (currentLength > longestLength) {
longestStart = currentStart;
longestLength = currentLength;
}
// Only compress if we have 2 or more consecutive zeros
if (longestLength >= 2) {
const beforeZeros = trimmedGroups.slice(0, longestStart);
const afterZeros = trimmedGroups.slice(longestStart + longestLength);
if (beforeZeros.length === 0 && afterZeros.length === 0) {
return '::';
} else if (beforeZeros.length === 0) {
return '::' + afterZeros.join(':');
} else if (afterZeros.length === 0) {
return beforeZeros.join(':') + '::';
} else {
return beforeZeros.join(':') + '::' + afterZeros.join(':');
}
}
return trimmedGroups.join(':');
}
/* Convert IPv6 address to binary representation */
function ipv6ToBinary(address: string): string {
const expanded = expandIPv6(address);
return expanded.split(':')
.map(group => parseInt(group, 16).toString(2).padStart(16, '0'))
.join('');
}
/* Convert binary to IPv6 address */
function binaryToIPv6(binary: string): string {
const groups = [];
for (let i = 0; i < 128; i += 16) {
const group = binary.substr(i, 16);
const hex = parseInt(group, 2).toString(16).padStart(4, '0');
groups.push(hex);
}
return groups.join(':');
}
/* Calculate subnet mask for IPv6 prefix */
function calculateIPv6SubnetMask(prefixLength: number): string {
const binaryMask = '1'.repeat(prefixLength) + '0'.repeat(128 - prefixLength);
return binaryToIPv6(binaryMask);
}
/* Get network address from IPv6 and prefix */
function getIPv6NetworkAddress(address: string, prefixLength: number): string {
const binary = ipv6ToBinary(address);
const networkBinary = binary.substr(0, prefixLength) + '0'.repeat(128 - prefixLength);
return binaryToIPv6(networkBinary);
}
/* Calculate first and last addresses in subnet */
function calculateIPv6AddressRange(networkAddress: string, prefixLength: number): {
first: string;
last: string;
} {
const networkBinary = ipv6ToBinary(networkAddress);
const hostBits = 128 - prefixLength;
// Handle /128 case (single host address)
if (hostBits === 0) {
const singleAddress = compressIPv6(networkAddress);
return { first: singleAddress, last: singleAddress };
}
// First address (network + 1)
const firstBinary = networkBinary.substr(0, prefixLength) + '0'.repeat(hostBits - 1) + '1';
const first = binaryToIPv6(firstBinary);
// Last address (all host bits set to 1, minus 1 for broadcast concept)
const lastBinary = networkBinary.substr(0, prefixLength) + '1'.repeat(hostBits - 1) + '0';
const last = binaryToIPv6(lastBinary);
return { first: compressIPv6(first), last: compressIPv6(last) };
}
/* Calculate total addresses in subnet */
function calculateIPv6TotalAddresses(prefixLength: number): string {
const hostBits = 128 - prefixLength;
if (hostBits <= 53) {
// Use regular number for smaller subnets
return Math.pow(2, hostBits).toLocaleString();
} else {
// Use scientific notation for very large subnets
const exponent = hostBits;
return `2^${exponent} (≈ ${(Math.pow(2, hostBits % 10) * Math.pow(10, Math.floor(hostBits / 10 * Math.log10(2)))).toExponential(2)})`;
}
}
/* Generate reverse DNS zone */
function generateReverseZone(networkAddress: string, prefixLength: number): string {
if (prefixLength % 4 !== 0) {
return 'Reverse zones are typically aligned to 4-bit boundaries';
}
const expanded = expandIPv6(networkAddress);
const nibbleCount = prefixLength / 4;
const nibbles = expanded.replace(/:/g, '').substr(0, nibbleCount);
// Reverse the nibbles and add dots
const reversed = nibbles.split('').reverse().join('.');
return `${reversed}.ip6.arpa`;
}
/* Validate IPv6 address */
export function validateIPv6Address(address: string): IPv6ValidationResult {
if (!address.trim()) {
return { valid: false, error: 'IPv6 address is required' };
}
// Remove prefix if present
const cleanAddress = address.split('/')[0];
// Basic format validation
const ipv6Regex = /^([0-9a-fA-F]{0,4}:){0,7}[0-9a-fA-F]{0,4}$/;
const compressedRegex = /^([0-9a-fA-F]{0,4}:)*::([0-9a-fA-F]{0,4}:)*[0-9a-fA-F]{0,4}$/;
if (!ipv6Regex.test(cleanAddress) && !compressedRegex.test(cleanAddress) && cleanAddress !== '::') {
return { valid: false, error: 'Invalid IPv6 address format' };
}
// Check for valid compression
if (cleanAddress.includes('::')) {
const parts = cleanAddress.split('::');
if (parts.length > 2) {
return { valid: false, error: 'Multiple :: compressions not allowed' };
}
}
// Validate individual groups
const groups = cleanAddress.replace('::', ':0000:').split(':');
for (const group of groups) {
if (group && (group.length > 4 || !/^[0-9a-fA-F]*$/.test(group))) {
return { valid: false, error: 'Invalid hexadecimal group' };
}
}
return { valid: true };
}
/* Validate IPv6 prefix length */
function validatePrefixLength(prefix: number): IPv6ValidationResult {
if (prefix < 1 || prefix > 128) {
return { valid: false, error: 'Prefix length must be between 1 and 128' };
}
if (!Number.isInteger(prefix)) {
return { valid: false, error: 'Prefix length must be an integer' };
}
return { valid: true };
}
/* Main IPv6 subnet calculation function */
export function calculateIPv6Subnet(
networkAddress: string,
prefixLength: number
): IPv6SubnetResult {
try {
// Validate inputs
const addressValidation = validateIPv6Address(networkAddress);
if (!addressValidation.valid) {
return {
success: false,
error: addressValidation.error,
originalNetwork: networkAddress,
originalPrefix: prefixLength
};
}
const prefixValidation = validatePrefixLength(prefixLength);
if (!prefixValidation.valid) {
return {
success: false,
error: prefixValidation.error,
originalNetwork: networkAddress,
originalPrefix: prefixLength
};
}
// Calculate network address
const network = getIPv6NetworkAddress(networkAddress, prefixLength);
const networkExpanded = expandIPv6(network);
const networkCompressed = compressIPv6(network);
// Calculate subnet mask
const subnetMask = compressIPv6(calculateIPv6SubnetMask(prefixLength));
// Calculate address range
const addressRange = calculateIPv6AddressRange(network, prefixLength);
// Calculate totals
const totalAddresses = calculateIPv6TotalAddresses(prefixLength);
const assignableAddresses = prefixLength >= 127 ? '0' : calculateIPv6TotalAddresses(prefixLength).replace(/[,\s]/g, '') === '2' ? '0' :
prefixLength <= 53 ? (Math.pow(2, 128 - prefixLength) - 2).toLocaleString() : 'Nearly all addresses';
// Generate binary prefix representation
const binaryPrefix = '1'.repeat(prefixLength) + '0'.repeat(128 - prefixLength);
const formattedBinary = binaryPrefix.match(/.{1,16}/g)?.join('.') || binaryPrefix;
// Generate reverse zone
const reverseZone = generateReverseZone(network, prefixLength);
return {
success: true,
subnet: {
network: networkCompressed,
prefixLength,
subnetMask,
networkExpanded,
networkCompressed,
firstAddress: addressRange.first,
lastAddress: addressRange.last,
totalAddresses,
assignableAddresses,
binaryPrefix: formattedBinary,
reverseZone
},
originalNetwork: networkAddress,
originalPrefix: prefixLength
};
} catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : 'Unknown error occurred',
originalNetwork: networkAddress,
originalPrefix: prefixLength
};
}
}
/* Get common IPv6 prefix lengths with descriptions */
export function getCommonIPv6Prefixes(): Array<{prefix: number, description: string}> {
return [
{ prefix: 48, description: '/48 - Site prefix (recommended for organizations)' },
{ prefix: 56, description: '/56 - Small site or home network' },
{ prefix: 64, description: '/64 - Standard subnet (single network segment)' },
{ prefix: 96, description: '/96 - IPv4-mapped IPv6 addresses' },
{ prefix: 112, description: '/112 - Point-to-point links' },
{ prefix: 128, description: '/128 - Single host address' }
];
}
/* Parse IPv6 address with prefix */
export function parseIPv6WithPrefix(input: string): {address: string, prefix: number} | null {
const parts = input.split('/');
if (parts.length !== 2) {
return null;
}
const address = parts[0].trim();
const prefix = parseInt(parts[1].trim());
if (isNaN(prefix)) {
return null;
}
return { address, prefix };
}
@@ -0,0 +1,225 @@
<script lang="ts">
import IPv6SubnetCalculator from '$lib/components/IPv6SubnetCalculator.svelte';
import { site } from '$lib/constants/site';
import '$lib/../styles/pages.scss';
import Icon from '$lib/components/Icon.svelte';
</script>
<svelte:head>
<title>IPv6 Subnet Calculator - 128-bit Network Planning Tool | {site.name}</title>
<meta name="description" content="Calculate IPv6 subnets with 128-bit addressing. Plan modern networks with IPv6 prefix lengths, address compression, and visualizations." />
<meta name="keywords" content="{site.keywords}, IPv6, subnet calculator, 128-bit addressing, IPv6 prefix, network planning, modern networking" />
<meta property="og:title" content="IPv6 Subnet Calculator - 128-bit Network Planning Tool" />
<meta property="og:description" content="Calculate IPv6 subnets with 128-bit addressing. Plan modern networks with IPv6 prefix lengths, address compression, and visualizations." />
<meta property="og:url" content="{site.url}/subnetting/ipv6-subnet-calculator" />
</svelte:head>
<div class="page-container">
<IPv6SubnetCalculator />
<section class="explainer-section">
<h3>About IPv6 Subnetting</h3>
<p>
<strong>IPv6 subnetting</strong> uses 128-bit addresses and hierarchical prefix-based allocation
to provide virtually unlimited address space. Unlike IPv4, IPv6 simplifies subnet planning with:
</p>
<div class="benefits-grid">
<div class="benefit-item">
<h4>Massive Address Space</h4>
<p>128-bit addressing provides 2^128 addresses - virtually unlimited for any network</p>
</div>
<div class="benefit-item">
<h4>Simplified Subnetting</h4>
<p>Standard /64 subnets eliminate complex subnet calculations</p>
</div>
<div class="benefit-item">
<h4>Hierarchical Design</h4>
<p>Provider-independent addressing with clear network hierarchy</p>
</div>
<div class="benefit-item">
<h4>No Broadcast Domain</h4>
<p>Uses multicast instead of broadcast, improving network efficiency</p>
</div>
</div>
<div class="addressing-section">
<h4>IPv6 Address Structure</h4>
<div class="address-types-grid">
<div class="address-type-item">
<h5>Global Unicast (2000::/3)</h5>
<p>Internet-routable addresses for global connectivity</p>
</div>
<div class="address-type-item">
<h5>Link-Local (fe80::/10)</h5>
<p>Local network communication, automatically configured</p>
</div>
<div class="address-type-item">
<h5>Unique Local (fc00::/7)</h5>
<p>Private addresses for internal networks (like RFC 1918)</p>
</div>
<div class="address-type-item">
<h5>Multicast (ff00::/8)</h5>
<p>One-to-many communication replacing broadcast</p>
</div>
</div>
</div>
<div class="best-practices-section">
<h4>IPv6 Subnetting Best Practices</h4>
<div class="practices-grid">
<div class="practice-item">
<h5>Standard /64 Subnets</h5>
<p>Use /64 for all LAN segments to ensure SLAAC and privacy extensions work properly</p>
</div>
<div class="practice-item">
<h5>Hierarchical Allocation</h5>
<p>Plan address space hierarchically: /48 sites, /56 small sites, /64 subnets</p>
</div>
<div class="practice-item">
<h5>Address Compression</h5>
<p>Use :: notation to compress consecutive zero groups for readability</p>
</div>
<div class="practice-item">
<h5>Documentation Prefix</h5>
<p>Use 2001:db8::/32 for examples and documentation</p>
</div>
</div>
</div>
<div class="info-box">
<h4>
<Icon name="lightbulb" size="sm" />
IPv6 Planning Tip
</h4>
<p>
IPv6's massive address space eliminates the need for complex subnetting. Focus on
logical network hierarchy rather than conserving addresses. A single /64 subnet
provides more addresses than the entire IPv4 internet.
</p>
</div>
</section>
</div>
<style>
.explainer-section {
margin-top: var(--spacing-xl);
padding: var(--spacing-lg);
background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
border-radius: var(--radius-lg);
border: 1px solid var(--border-secondary);
h3 {
color: var(--text-primary);
margin-bottom: var(--spacing-md);
}
@media (max-width: 768px) {
padding: var(--spacing-md);
}
}
.benefits-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: var(--spacing-md);
margin: var(--spacing-lg) 0;
}
.benefit-item {
padding: var(--spacing-md);
background-color: var(--bg-secondary);
border-radius: var(--radius-md);
border: 1px solid var(--border-primary);
h4 {
color: var(--color-primary);
margin-bottom: var(--spacing-sm);
font-size: var(--font-size-md);
}
p {
color: var(--text-secondary);
font-size: var(--font-size-sm);
line-height: 1.5;
margin: 0;
}
}
.addressing-section,
.best-practices-section {
margin: var(--spacing-lg) 0;
h4 {
color: var(--text-primary);
margin-bottom: var(--spacing-md);
font-size: var(--font-size-lg);
font-weight: 600;
}
}
.address-types-grid,
.practices-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: var(--spacing-md);
}
.address-type-item,
.practice-item {
padding: var(--spacing-md);
background-color: var(--bg-secondary);
border-radius: var(--radius-md);
border: 1px solid var(--border-primary);
h5 {
color: var(--color-primary);
margin-bottom: var(--spacing-sm);
font-size: var(--font-size-md);
font-weight: 600;
font-family: var(--font-mono);
}
p {
color: var(--text-secondary);
font-size: var(--font-size-sm);
line-height: 1.5;
margin: 0;
}
}
.info-box {
margin-top: var(--spacing-lg);
padding: var(--spacing-md);
background: linear-gradient(135deg, rgba(9, 105, 218, 0.1), rgba(31, 111, 235, 0.05));
border: 1px solid var(--color-info);
border-radius: var(--radius-md);
h4 {
color: var(--color-info);
margin-bottom: var(--spacing-sm);
font-size: var(--font-size-md);
font-weight: 600;
:global(.icon) {
width: 1.6em;
height: 1.8em;
}
}
p {
color: var(--text-primary);
font-size: var(--font-size-sm);
line-height: 1.6;
margin: 0;
}
}
@media (max-width: 768px) {
.benefits-grid,
.address-types-grid,
.practices-grid {
grid-template-columns: 1fr;
}
}
</style>