diff --git a/public/css/style.css b/public/css/style.css index 8440eaa..0014698 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -784,6 +784,35 @@ footer a:hover { color: var(--gold); } width: auto; } +/* --- Utilities -------------------------------------------- */ + +.mt-2xs { margin-top: 0.3rem; } +.mt-xs { margin-top: 0.4rem; } +.mt-sm { margin-top: 0.6rem; } +.mt-md { margin-top: 0.8rem; } +.mt-lg { margin-top: 1rem; } +.mt-xl { margin-top: 1.5rem; } + +.mb-sm { margin-bottom: 0.75rem; } +.mb-md { margin-bottom: 1rem; } +.mb-lg { margin-bottom: 1.2rem; } + +.w-full { width: 100%; } + +.gap-sm { gap: 0.8rem; } + +.is-hidden { display: none !important; } + +.summary-buttonless { + cursor: pointer; + user-select: none; +} + +.inline-fade { + color: var(--text-dim); + line-height: 1.5; +} + /* --- Tabellen --------------------------------------------- */ /* .data-table — Basisklasse für alle Tabellen diff --git a/public/moonphase_old.php b/public/moonphase_old.php deleted file mode 100644 index 2c05f44..0000000 --- a/public/moonphase_old.php +++ /dev/null @@ -1,1155 +0,0 @@ - - - - - - - - - -
-
-
-
-

- Interaktive Anzeige der Mondphase für ein frei wählbares Datum und eine Uhrzeit. - Der Mond wird direkt aus Datum und Uhrzeit berechnet und zentral visualisiert. -

- -
-
Lade Mondphase...
-
- - -
-
- -
-
- Beleuchtung - - -
-
- Entfernung - - -
-
- Mondalter - - -
-
- Ausgewählt - - -
-
- Libration - - -
-
- -
-
-
- - - -
-
- - - - -
-
- -
-
- - 00:00 -
- -
- 00:00 - 12:00 - 23:55 -
-
- - - - - -
-
- -
- -
- Hinweis: Die Anzeige zeigt die geozentrische Mondphase als anschauliche Visualisierung - und eignet sich sehr gut für Museums- und Bildungszwecke. -
-
- -
-
- -
-
-
-
-
-
Lade Mondtexturen... 0 %
-
-
-
-
-
- - - - - - diff --git a/public/satellitenhimmel_old.php b/public/satellitenhimmel_old.php deleted file mode 100644 index 3c58d6a..0000000 --- a/public/satellitenhimmel_old.php +++ /dev/null @@ -1,1603 +0,0 @@ - PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - ] -); - -$loggedIn = true; -$pageTitle = 'Satellitenhimmel - AstroTools'; -$bodyClass = 'satpass-page'; -$userId = (int)$_SESSION['user_id']; - -function h(?string $value): string -{ - return htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); -} - -function tleChecksum(string $line): int -{ - $sum = 0; - for ($i = 0; $i < 68; $i++) { - $c = $line[$i]; - if (ctype_digit($c)) { - $sum += (int)$c; - } elseif ($c === '-') { - $sum += 1; - } - } - return $sum % 10; -} - -function tleExp(float $val): string -{ - if (abs($val) < 1e-99) { - return ' 00000-0'; - } - - $sign = $val >= 0 ? '+' : '-'; - $abs = abs($val); - $exp = (int)floor(log10($abs)) + 1; - $mantissa = (int)round($abs / pow(10, $exp) * 1e5); - if ($mantissa >= 100000) { - $mantissa = 10000; - $exp++; - } - $expSign = $exp >= 0 ? '+' : '-'; - - return sprintf('%s%05d%s%d', $sign, $mantissa, $expSign, abs($exp)); -} - -function tleMmDot(float $val): string -{ - $sign = $val >= 0 ? ' ' : '-'; - return sprintf('%s.%08d', $sign, (int)round(abs($val) * 1e8)); -} - -function tleEpoch(string $epochStr): string -{ - $dt = new DateTimeImmutable($epochStr, new DateTimeZone('UTC')); - $yy = (int)$dt->format('Y') % 100; - $jan1 = new DateTimeImmutable($dt->format('Y') . '-01-01 00:00:00', new DateTimeZone('UTC')); - $secs = (float)$dt->format('U') - (float)$jan1->format('U'); - $day = $secs / 86400.0 + 1.0; - return sprintf('%02d%012.8f', $yy, $day); -} - -function tleIntlDesig(?string $objectId): string -{ - if (!$objectId) { - return str_repeat(' ', 8); - } - - if (preg_match('/^(\d{4})-(\d+)([A-Z]*)$/i', trim($objectId), $m)) { - $yy = substr($m[1], 2, 2); - $launch = str_pad($m[2], 3, '0', STR_PAD_LEFT); - $piece = str_pad(strtoupper($m[3]), 3, ' ', STR_PAD_RIGHT); - return substr(str_pad($yy . $launch . $piece, 8, ' '), 0, 8); - } - - return str_pad(substr($objectId, 0, 8), 8); -} - -function buildLine1(array $sat, array $tle): string -{ - $norad = (int)$sat['norad_cat_id']; - $class = in_array($sat['classification_type'] ?? '', ['U', 'C', 'S'], true) - ? $sat['classification_type'] - : 'U'; - - $line = sprintf( - '1 %05d%1s %-8s %14s %10s %8s %8s %1d %4d', - $norad, - $class, - tleIntlDesig($sat['object_id'] ?? null), - tleEpoch((string)$tle['epoch']), - tleMmDot((float)($tle['mean_motion_dot'] ?? 0)), - tleExp((float)($tle['mean_motion_ddot'] ?? 0)), - tleExp((float)($tle['bstar'] ?? 0)), - (int)($tle['ephemeris_type'] ?? 0), - (int)($tle['element_set_no'] ?? 0) - ); - - $line = str_pad($line, 68); - return $line . tleChecksum($line); -} - -function buildLine2(array $sat, array $tle): string -{ - $norad = (int)$sat['norad_cat_id']; - $ecc = (float)($tle['eccentricity'] ?? 0); - $eccStr = substr(sprintf('%.7f', $ecc), 2); - - $line = sprintf( - '2 %05d %8.4f %8.4f %7s %8.4f %8.4f %11.8f%5d', - $norad, - (float)($tle['inclination'] ?? 0), - (float)($tle['ra_of_asc_node'] ?? 0), - $eccStr, - (float)($tle['arg_of_pericenter'] ?? 0), - (float)($tle['mean_anomaly'] ?? 0), - (float)($tle['mean_motion'] ?? 0), - (int)($tle['rev_at_epoch'] ?? 0) - ); - - $line = str_pad($line, 68); - return $line . tleChecksum($line); -} - -$stmtTracked = $pdo->prepare(" - SELECT - s.`id`, - s.`norad_cat_id`, - s.`object_name`, - s.`object_id`, - s.`classification_type`, - s.`std_mag`, - s.`rcs_size`, - s.`rcs`, - aus.`is_favorite`, - t.`epoch`, - t.`mean_motion`, - t.`eccentricity`, - t.`inclination`, - t.`ra_of_asc_node`, - t.`arg_of_pericenter`, - t.`mean_anomaly`, - t.`ephemeris_type`, - t.`element_set_no`, - t.`rev_at_epoch`, - t.`bstar`, - t.`mean_motion_dot`, - t.`mean_motion_ddot` - FROM `app_user_satellites` aus - INNER JOIN `sat_satellites` s - ON s.`id` = aus.`satellite_id` - INNER JOIN `sat_tle_current` t - ON t.`satellite_id` = s.`id` - WHERE aus.`user_id` = :user_id - AND t.`epoch` IS NOT NULL - AND t.`mean_motion` IS NOT NULL - ORDER BY aus.`is_favorite` DESC, s.`object_name` ASC -"); -$stmtTracked->execute([ - ':user_id' => $userId, -]); -$trackedSatellites = $stmtTracked->fetchAll(); - -$satellitePayload = []; -foreach ($trackedSatellites as $row) { - $satellitePayload[] = [ - 'id' => (int)$row['id'], - 'norad_cat_id' => (int)$row['norad_cat_id'], - 'object_name' => (string)$row['object_name'], - 'is_favorite' => (int)$row['is_favorite'] === 1, - 'std_mag' => $row['std_mag'] !== null ? (float)$row['std_mag'] : null, - 'rcs_size' => $row['rcs_size'] !== null ? (string)$row['rcs_size'] : null, - 'rcs' => $row['rcs'] !== null && (float)$row['rcs'] > 0 ? (float)$row['rcs'] : null, - 'tle_line1' => buildLine1($row, $row), - 'tle_line2' => buildLine2($row, $row), - ]; -} - -$stmtStars = $pdo->query(" - SELECT `proper`, `bf`, `ra`, `dec`, `mag` - FROM `star_hipparcos` - WHERE `mag` <= 5.0 - AND `ra` IS NOT NULL - AND `dec` IS NOT NULL - ORDER BY `mag` ASC -"); -$brightStars = $stmtStars->fetchAll(); -$starPayload = array_map(fn($r) => [ - 'name' => (string)($r['proper'] ?: ($r['bf'] ?: '')), - 'ra' => (float)$r['ra'] * 15.0, - 'dec' => (float)$r['dec'], - 'mag' => (float)$r['mag'], -], $brightStars); - -// Sternbildlinien: Liniensegmente mit ra/dec je Punkt -$stmtLines = $pdo->query(" - SELECT - cl.`id` AS line_id, - clp.`point_index`, - sh.`ra` * 15.0 AS ra_deg, - sh.`dec` AS dec_deg - FROM `constellation_lines` cl - INNER JOIN `constellation_line_points` clp ON clp.`line_id` = cl.`id` - INNER JOIN `star_hipparcos` sh ON sh.`hip` = clp.`hip_number` - WHERE sh.`ra` IS NOT NULL AND sh.`dec` IS NOT NULL - ORDER BY cl.`id`, clp.`point_index` -"); -$lineRows = $stmtLines->fetchAll(); - -// Gruppieren nach line_id → Array von Linien, jede Linie = Array von {ra, dec} -$constellationLines = []; -foreach ($lineRows as $row) { - $lid = (int)$row['line_id']; - $constellationLines[$lid][] = [ - 'ra' => (float)$row['ra_deg'], - 'dec' => (float)$row['dec_deg'], - ]; -} -$constellationPayload = array_values($constellationLines); - -$stmtConstellationLabels = $pdo->query(" - SELECT - clp.`constellation_id`, - clp.`position_index`, - clp.`ra_hours` * 15.0 AS ra_deg, - clp.`dec_degrees` AS dec_deg, - cn.`german_name`, - cn.`native_name`, - cn.`byname` - FROM `constellation_label_positions` clp - LEFT JOIN `constellation_names` cn - ON cn.`constellation_id` = clp.`constellation_id` - ORDER BY clp.`constellation_id`, clp.`position_index` -"); -$constellationLabelRows = $stmtConstellationLabels->fetchAll(); -$constellationLabelPayload = array_map(static function (array $row): array { - $label = trim((string)($row['german_name'] ?: $row['native_name'] ?: $row['byname'] ?: $row['constellation_id'])); - return [ - 'id' => (string)$row['constellation_id'], - 'label' => $label, - 'ra' => (float)$row['ra_deg'], - 'dec' => (float)$row['dec_deg'], - 'position_index' => (int)$row['position_index'], - ]; -}, $constellationLabelRows); -?> - - - (string)($currentLocation['name'] ?? ''), - 'latitude' => isset($currentLocation['latitude']) ? (float)$currentLocation['latitude'] : null, - 'longitude' => isset($currentLocation['longitude']) ? (float)$currentLocation['longitude'] : null, - 'elevation' => isset($currentLocation['elevation']) && $currentLocation['elevation'] !== null ? (float)$currentLocation['elevation'] : 0.0, - 'timezone' => (string)($currentLocation['timezone'] ?? 'Europe/Berlin'), - ]; -} -?> - -
-
-

- Berechnet fuer den heutigen Tag den naechsten Ueberflug deiner ausgewaehlten Satelliten - und zeichnet deren Bahn auf einer Zenitkarte fuer deinen Standard-Standort. -

-
- - -
-

Kein Standard-Standort gesetzt

-

- Diese Seite verwendet den im Header geladenen Standard-Standort aus der Datenbank. - Bitte waehle in den Einstellungen einen Standard-Standort aus. -

-
- -
-

Keine Satelliten ausgewaehlt

-

- Es sind noch keine ausgewaehlten Satelliten mit aktuellem TLE vorhanden. - Bitte fuege in Favoriten Satelliten hinzu. -

-
- -
-
- Standort - - deg N / deg O / m -
-
- Zeitzone - - Berechnung komplett im Browser -
-
- Satelliten - - mit aktuellem TLE -
-
- -
-
Berechne Ueberfluege...
- -
- -
-
- - -
-
- - -
-
-
- -
-
- - -
-

-
- -
-
- -
-
- - - -
- - diff --git a/public/sternbedeckungen_old.php b/public/sternbedeckungen_old.php deleted file mode 100644 index 59c7a5f..0000000 --- a/public/sternbedeckungen_old.php +++ /dev/null @@ -1,1663 +0,0 @@ - $row - */ -function buildStarLabel(array $row): string -{ - $proper = trim((string)($row['proper'] ?? '')); - if ($proper !== '') { - return $proper; - } - - $bf = trim((string)($row['bf'] ?? '')); - if ($bf !== '') { - return $bf; - } - - $hip = isset($row['hip']) ? (int)$row['hip'] : 0; - if ($hip > 0) { - return 'HIP ' . $hip; - } - - return 'Unbenannter Stern'; -} - -$brightStars = []; -$detailMapStars = []; -$constellationLines = []; -$dayMeta = null; -$starCatalogLimit = 6.0; -$detailMapCatalogLimit = 8.0; - -try { - $config = require __DIR__ . '/../config/database.php'; - $dsn = sprintf( - 'mysql:host=%s;dbname=%s;charset=%s', - $config['host'], - $config['dbname'], - $config['charset'] ?? 'utf8mb4' - ); - - $pdo = new PDO( - $dsn, - $config['user'], - $config['pass'], - [ - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - ] - ); - - if ($loggedIn && isset($_SESSION['user_id'])) { - $stmtLocation = $pdo->prepare( - 'SELECT id, name, latitude, longitude, elevation, timezone - FROM app_user_locations - WHERE user_id = ? AND is_default = 1 - LIMIT 1' - ); - $stmtLocation->execute([(int)$_SESSION['user_id']]); - $defaultLocation = $stmtLocation->fetch() ?: null; - } -} catch (Throwable $exception) { - $dataLoadError = $exception->getMessage(); -} - -require __DIR__ . '/header.php'; - -$pageLocation = null; -if (!empty($currentLocation) && is_array($currentLocation)) { - $pageLocation = [ - 'name' => (string)($currentLocation['name'] ?? ''), - 'latitude' => isset($currentLocation['latitude']) ? (float)$currentLocation['latitude'] : null, - 'longitude' => isset($currentLocation['longitude']) ? (float)$currentLocation['longitude'] : null, - 'elevation' => isset($currentLocation['elevation']) && $currentLocation['elevation'] !== null ? (float)$currentLocation['elevation'] : 0.0, - 'timezone' => (string)($currentLocation['timezone'] ?? 'Europe/Berlin'), - ]; -} - -if ($dataLoadError === null && $pdo instanceof PDO && $pageLocation !== null && $pageLocation['latitude'] !== null && $pageLocation['longitude'] !== null) { - $tz = new DateTimeZone($pageLocation['timezone']); - $todayLocal = new DateTimeImmutable('now', $tz); - $dayStartLocal = $todayLocal->setTime(0, 0, 0); - $dayEndLocal = $dayStartLocal->modify('+1 day'); - $dayMeta = [ - 'localDate' => $dayStartLocal->format('Y-m-d'), - 'localDateLabel' => $dayStartLocal->format('d.m.Y'), - 'dayStartUtc' => $dayStartLocal->setTimezone(new DateTimeZone('UTC'))->format(DateTimeInterface::ATOM), - 'dayEndUtc' => $dayEndLocal->setTimezone(new DateTimeZone('UTC'))->format(DateTimeInterface::ATOM), - ]; - - try { - $stmt = $pdo->query( - "SELECT `hip`, `proper`, `bf`, `con`, `mag`, `ra`, `dec`, `dist` - FROM `star_hipparcos` - WHERE `mag` IS NOT NULL - AND `ra` IS NOT NULL - AND `dec` IS NOT NULL - AND `mag` <= 6.0 - ORDER BY `mag` ASC, `proper` ASC, `bf` ASC, `hip` ASC" - ); - - foreach ($stmt->fetchAll() as $row) { - $brightStars[] = [ - 'hip' => isset($row['hip']) ? (int)$row['hip'] : 0, - 'label' => buildStarLabel($row), - 'constellation' => trim((string)($row['con'] ?? '')), - 'mag' => isset($row['mag']) ? (float)$row['mag'] : null, - 'ra' => isset($row['ra']) ? (float)$row['ra'] : null, - 'dec' => isset($row['dec']) ? (float)$row['dec'] : null, - 'distLy' => isset($row['dist']) && $row['dist'] !== null && (float)$row['dist'] > 0.0 - ? (float)$row['dist'] * 3.26156 - : 1000.0, - ]; - } - - $stmtDetailMap = $pdo->query( - "SELECT `hip`, `proper`, `bf`, `con`, `mag`, `ra`, `dec`, `dist` - FROM `star_hipparcos` - WHERE `mag` IS NOT NULL - AND `ra` IS NOT NULL - AND `dec` IS NOT NULL - AND `mag` <= 8.0 - ORDER BY `mag` ASC, `proper` ASC, `bf` ASC, `hip` ASC" - ); - - foreach ($stmtDetailMap->fetchAll() as $row) { - $detailMapStars[] = [ - 'hip' => isset($row['hip']) ? (int)$row['hip'] : 0, - 'label' => buildStarLabel($row), - 'constellation' => trim((string)($row['con'] ?? '')), - 'mag' => isset($row['mag']) ? (float)$row['mag'] : null, - 'ra' => isset($row['ra']) ? (float)$row['ra'] : null, - 'dec' => isset($row['dec']) ? (float)$row['dec'] : null, - 'distLy' => isset($row['dist']) && $row['dist'] !== null && (float)$row['dist'] > 0.0 - ? (float)$row['dist'] * 3.26156 - : 1000.0, - ]; - } - - $stmtLines = $pdo->query( - "SELECT - cl.`id` AS line_id, - clp.`point_index`, - sh.`ra` AS ra_hours, - sh.`dec` AS dec_deg - FROM `constellation_lines` cl - INNER JOIN `constellation_line_points` clp - ON clp.`line_id` = cl.`id` - INNER JOIN `star_hipparcos` sh - ON sh.`hip` = clp.`hip_number` - WHERE sh.`ra` IS NOT NULL - AND sh.`dec` IS NOT NULL - ORDER BY cl.`id`, clp.`point_index`" - ); - - foreach ($stmtLines->fetchAll() as $row) { - $lineId = (int)$row['line_id']; - $constellationLines[$lineId][] = [ - 'ra' => isset($row['ra_hours']) ? (float)$row['ra_hours'] : null, - 'dec' => isset($row['dec_deg']) ? (float)$row['dec_deg'] : null, - ]; - } - } catch (Throwable $exception) { - $dataLoadError = $exception->getMessage(); - $brightStars = []; - $detailMapStars = []; - $constellationLines = []; - } -} -?> - - - -
- -
-

Kein Standard-Standort gesetzt

-

- Fuer die Berechnung wird der Standard-Standort aus der Datenbank verwendet. - Bitte waehle in den Einstellungen einen Standard-Standort aus. -

-
- -
-

Sterndaten nicht verfuegbar

-

- Die Hipparcos-Sterndaten oder die Datenbankverbindung konnten nicht geladen werden. - Dadurch ist die heutige Bedeckungsberechnung momentan nicht moeglich. -

- -

Technischer Hinweis:

- -
- -
-
-
- Standort - - ° / ° - -
-
- Zeitraum & Berechnung -
- - - - - -
-
- - - -
- -
-
- Sternauswahl - bis 2.0 mag -
- - -
- Hipparcos-Sterne -
-
-
- - Zeitraum und Grenzgroesse waehlen, dann Berechnung starten. - -
-
- -
-
-
- Ereignisse - -- -
-
- Naechstes Maximum - -- -
-
- Tiefste Bedeckung - -- -
-
- -
- - - - - - - - - - - - - - - - - - - -
SternmagEintrittMaximumAustrittDauerSichtbarkeitRandabstandMondhoehe
Berechnung laeuft...
-
-
- - - - - -
- -