From 50566c213c20f2145c57d85ea106aad6d54f4f50 Mon Sep 17 00:00:00 2001 From: Reinholds Zviedris Date: Mon, 16 Nov 2026 10:32:37 +0200 Subject: [PATCH 1/2] improveded optics setup, page organisation as well fixed bugs --- README.md | 25 ++- index.html | 538 +++++++++++++++++++++++++++++++++++++---------------- test.js | 36 +++- 3 files changed, 426 insertions(+), 173 deletions(-) diff --git a/README.md b/README.md index 5849034..b4f2ae2 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ divided by the turret's click value at that distance: - 1 MOA subtends `2.908882 cm` per 100 m - 1 MRAD subtends `10 cm` per 100 m -- Turret click default: `0.25 cm per 100 m` (configurable in *Turret settings*) +- Turret click default: `0.25 cm per 100 m` (configurable in *Setup → Optic*) -In *Turret settings* you don't need to know the cm-per-100 m value. Pick the +In *Setup → Optic* you don't need to know the cm-per-100 m value. Pick the turret's **units** (MOA, MRAD or cm) and its **click value** (1/8, 1/4, 1/2 or 1 MOA; 0.05, 0.1 or 0.2 MRAD; 1/4, 1/2 or 1 cm), or choose *Custom…* and type any value in those units. The app works out what one click moves at 100 m. For @@ -27,6 +27,23 @@ example, 1/4 MOA = 0.727 cm and 0.1 MRAD = 1 cm. Both the click value and clicks-per-mark are adjustable for other scopes/turrets. +A full turn is set in **clicks**, so turrets whose turn ends mid-mark work too: +a 100-click 1/8 MOA turret (8 clicks per mark = 12.5 marks per turn) dials +113 clicks as `1 turn · mark 1 · + 5 clicks`. An optional **total elevation +clicks** value flags corrections (⚠) beyond the turret's travel. + +### Reticle: FFP / SFP + +Set the focal plane and zoom range. For an **SFP** scope also set the +magnification at which the reticle is true (defaults to max zoom, e.g. 40× on a +10-40×) and the magnification you're shooting at; reticle holds are then +rescaled (`hold × current / true`) and shown in extra *hold* columns. + +## Layout + +The page is split into tabs: **Setup** (saved gear, rifle, optic, load), +**Weather**, **Turret** (quick click calculator), **Trajectory** and **Targets**. + ## Full trajectory calculator A second section computes the whole trajectory from first principles instead of a @@ -79,7 +96,7 @@ even range ladder. Add a row per target (minimum one), type its distance, and ge the correction for each — rows are lettered **A, B, C, …** so they match how you range and call them. -It reuses the load, atmosphere, wind and turret settings from the sections above, +It reuses the load, atmosphere, wind and turret settings from the other tabs, so the numbers agree with the trajectory table. For every target it shows drop (cm + MRAD/MOA), elevation clicks to dial UP, drift with the side it pushes to, windage clicks with the direction to dial, time of flight and remaining velocity. @@ -94,7 +111,7 @@ equipment, so you can switch setups without retyping: | Kind | What it stores | | --- | --- | | **Rifle** | caliber, barrel twist, twist direction, sight height over bore, zero distance | -| **Optic** | turret units + click value, clicks per mark, marks per turn, MRAD/MOA output units | +| **Optic** | focal plane, zoom range, SFP true magnification, turret units + click value, clicks per mark / per turn / total, MRAD/MOA units | | **Load** | bullet weight (grains or grams), muzzle velocity, BC + G1/G7 model, bullet length (optional) | Pick a profile from the dropdown to load it. The calculators and any tables diff --git a/index.html b/index.html index f3a03f5..805b967 100644 --- a/index.html +++ b/index.html @@ -142,9 +142,39 @@ .gear-status.err { color: var(--danger); } .gear-io { margin-top: 18px; max-width: 420px; } @media (max-width: 700px) { .gear-grid { grid-template-columns: 1fr; } } + .tabs { + position: sticky; top: 0; z-index: 10; width: 100%; max-width: 900px; + display: flex; gap: 6px; padding: 8px; margin: -12px 0 0; + background: rgba(14,17,22,.92); backdrop-filter: blur(6px); + border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; + } + .tabs button { + flex: 1; padding: 10px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; + background: transparent; border: 1px solid transparent; color: var(--muted); + font-size: 14px; font-weight: 600; + } + .tabs button.active { background: var(--accent); color: #04121f; } + section.tab { display: none; width: 100%; flex-direction: column; align-items: center; gap: 20px; } + section.tab.active { display: flex; } + .card .grid2, .card .grid3 { margin-top: 10px; } + @media (max-width: 600px) { + body { padding: 12px; gap: 14px; } + .card { padding: 18px; } + .grid3 { grid-template-columns: 1fr 1fr; } + .tabs button { padding: 10px 6px; font-size: 13px; } + } + + +

Saved gear

Save rifles, optics and ammo loads by name and switch between them. @@ -158,82 +188,118 @@

Saved gear

-
-

Ballistic Turret Calculator

-
How many clicks to dial for a given drop & distance.
- - - - - -
-
-
- - - +
+

Rifle

+
+
+ + + +
-
- -
-
Elevation (dial UP)
-
–
-
-
-
- - -
-
-
- - - +
+ +
-
- - -
- -
-
Windage (dial LEFT)
-
–
-
-
+
+
+ +
+ + +
+
+
+ + +
+
+ + +
+
-
- Turret settings -
- +
+

Optic

+
Reticle
+
+
+
- - - + +
- - - +
+ +
+ +
- - -
+
+
+
+
+ + +
+
+ + +
+
+ +
+ +
Turret
+ +
+ + + +
+ + + + + +
+
+
- -
-
+
+ + +
+
+ + +
+
+
-
-

Full Trajectory Calculator

-
Point-mass solver (G1/G7 drag) — produces a drop & wind table with scope adjustments.
- -
Load
+
+

Load

@@ -254,7 +320,7 @@

Full Trajectory Calculator

-
+
@@ -268,51 +334,14 @@

Full Trajectory Calculator

+
+
-
Rifle & scope
-
-
- - - -
-
-
- - -
-
-
-
- - -
-
- - -
-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
Atmosphere & wind
+
+
+

Weather conditions

+
Used by the trajectory table and the target card.
+
Atmosphere
@@ -327,7 +356,8 @@

Full Trajectory Calculator

-
+
Wind
+
@@ -337,6 +367,63 @@

Full Trajectory Calculator

+
+
+ +
+
+

Ballistic Turret Calculator

+
How many clicks to dial for a given drop & distance. + Turret and reticle come from Setup → Optic.
+ + + + + +
+
+
+ + + +
+
+ +
+
Elevation (dial UP)
+
–
+
+
+
+ + +
+
+
+ + + +
+
+
+ + +
+ +
+
Windage (dial LEFT)
+
–
+
+
+
+
+
+ +
+
+

Full Trajectory Calculator

+
Point-mass solver (G1/G7 drag) — drop & wind table with scope adjustments, + using the rifle, optic, load and weather from the other tabs.
Range
@@ -361,11 +448,13 @@

Full Trajectory Calculator

+
+

Target Card

-
Corrections for a set of known targets — uses the load, atmosphere, - wind and turret settings from the calculators above.
+
Corrections for a set of known targets — uses the rifle, optic, load + and weather from the other tabs.
@@ -377,6 +466,7 @@

Target Card

+