Files seperated

This commit is contained in:
2026-03-09 06:21:55 +05:45
parent 168d71f8c1
commit c1fef74add
3 changed files with 90 additions and 45 deletions

11
css.css
View File

@@ -139,3 +139,14 @@
padding: 3px 6px;
}
}
.segment-label{
position:absolute;
font-weight:bold;
font-size:18px;
color:#facc15;
transform:translate(-50%,-50%);
background:rgba(0,0,0,0.35);
padding:6px 10px;
border-radius:6px;
border:1px solid rgba(255,255,255,0.2);
}

View File

@@ -9,31 +9,36 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="css.css" rel="stylesheet">
<style>
</style>
</head>
<body>
<div class="container py-5">
<div class="text-center mb-5">
<h1 class="fw-bold text-warning">Prajwal's Astro Analysis</h1>
<p class="text-light">Analyze planetary positioning, nakshatra, and horoscope from selected date, time, and location.</p>
<p class="text-light">
Analyze planetary positioning, nakshatra, and horoscope from selected date, time, and location.
</p>
</div>
<div class="main-card p-4 p-md-5">
<div class="row g-4 align-items-start">
<div class="row g-4">
<div class="col-lg-12">
<div class="row">
<div class="row g-3">
<div class="col-lg-4">
<label class="form-label">Select Date</label>
<input type="date" class="form-control" id="datePicker">
</div>
<div class="col-lg-4">
<label class="form-label">Select Time</label>
<input type="time" class="form-control" id="timePicker">
</div>
<div class="col-lg-4">
<label class="form-label">Select Location</label>
<select class="form-select" id="locationSelector">
@@ -48,62 +53,44 @@
</select>
</div>
</div>
<div class="col-lg-12">
<button class="btn btn-custom w-100 mt-2">Analyze</button>
</div>
<button class="btn btn-custom w-100 mt-2">Analyze</button>
</div>
</div>
<div class="col-lg-12">
<div class="row g-3 mb-4">
<div class="info-box">
<div class="section-title">Geocentric Positioning of Planets</div>
</div>
<div class="info-box">
<div class="section-title">
Geocentric Positioning of Planets, Nakshatra, and Horoscope
</div>
<div class="chart-wrapper">
<div class="astro-circle" id="astroCircle">
<div class="earth-center">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg" alt="Earth">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
const astroCircle = document.getElementById("astroCircle");
</div>
<script src="js.js"></script>
const centerX = 260;
const centerY = 260;
const radius = 220;
for (let i = 0; i < 12; i++) {
const angleDeg = i * 30;
const angleRad = (angleDeg - 90) * Math.PI / 180;
// segment lines
const line = document.createElement("div");
line.classList.add("segment-line");
line.style.transform = `translateX(-50%) rotate(${angleDeg}deg)`;
astroCircle.appendChild(line);
// segment number positions
const number = document.createElement("div");
number.classList.add("segment-number");
number.innerText = i + 1;
const numberRadius = radius - 25;
const x = centerX + numberRadius * Math.cos(angleRad);
const y = centerY + numberRadius * Math.sin(angleRad);
number.style.left = `${x}px`;
number.style.top = `${y}px`;
astroCircle.appendChild(number);
}
</script>
</body>

47
js.js Normal file
View File

@@ -0,0 +1,47 @@
document.addEventListener("DOMContentLoaded", function() {
const astroCircle = document.getElementById("astroCircle");
const labels = [
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"
];
const circleSize = astroCircle.offsetWidth;
const centerX = circleSize / 2;
const centerY = circleSize / 2;
const radius = circleSize / 2;
// numbers will be placed OUTSIDE the circle
const numberRadius = radius + 25;
for (let i = 0; i < 12; i++) {
const angleDeg = i * 30;
const angleRad = (angleDeg - 90) * Math.PI / 180;
// draw segment divider
const line = document.createElement("div");
line.classList.add("segment-line");
line.style.transform = `translateX(-50%) rotate(${angleDeg}deg)`;
astroCircle.appendChild(line);
// place number in center of segment
const midAngle = angleDeg + 15;
const midRad = (midAngle - 90) * Math.PI / 180;
const x = centerX + numberRadius * Math.cos(midRad);
const y = centerY + numberRadius * Math.sin(midRad);
const number = document.createElement("div");
number.classList.add("segment-number");
number.innerText = labels[i];
number.style.left = `${x}px`;
number.style.top = `${y}px`;
astroCircle.appendChild(number);
}
});