SITEMAP
.CODE
POD-143: Relics recovered from the ruins of the old world. Proposal: Creation of a memorial
POD-23: For what purpose.
┌─────WIDGET─────┐
Widget
1
1
1
1
1
HTML
Code Code Code Code
Ligne 2
Ligne 3
HTML
Code Code Code Code
Ligne 2
Ligne 3
┌─────WIDGET─────┐
HTML
<div class="center" id="myClock">
<script>
function updateClock() {
const now = new Date();
// Format HH:MM:SS
const hours = String(now.getHours()).padStart(2, "0");
const minutes = String(now.getMinutes()).padStart(2, "0");
const seconds = String(now.getSeconds()).padStart(2, "0");
// Format date
const date = now.toLocaleDateString("fr-CH", {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric"
});
document.getElementById("myClock").innerHTML =
`${hours}:${minutes}:${seconds}<br>${date}`;
}
setInterval(updateClock, 1000);
updateClock();
</script>
</div>
┌─────WIDGET─────┐
HTML
<div id="meteo-widget">Chargement...</div>
<script>
const url = "https://api.open-meteo.com/v1/forecast?latitude=46.802&longitude=7.151¤t_weather=true";
function iconFromCode(code) {
if (code === 0) return "☀️";
if ([1,2].includes(code)) return "🌤️";
if (code === 3) return "☁️";
if ([45,48].includes(code)) return "🌫️";
if ([51,53,55,56,57].includes(code)) return "🌦️";
if ([61,63,65,66,67].includes(code)) return "🌧️";
if ([71,73,75,77].includes(code)) return "❄️";
if ([80,81,82].includes(code)) return "🌧️";
if ([95,96,99].includes(code)) return "⛈️";
return "🌡️";
}
fetch(url)
.then(r => r.json())
.then(data => {
const temp = data.current_weather.temperature;
const code = data.current_weather.weathercode;
const icon = iconFromCode(code);
document.getElementById("meteo-widget").innerHTML = `
<div class="weather-icon">${icon}</div>
<div><strong>${temp}°C</strong></div>
<div></div>
`;
})
.catch(err => {
document.getElementById("meteo-widget").innerHTML =
"Erreur météo";
console.error(err);
});
</script>
</div>
┌─────WIDGET─────┐
HTML
<div id="moon-box">
<div id="moon-emoji">🌑</div>
<div id="moon-phase" class="info"></div>
<div id="moon-illumination" class="info"></div>
<div id="moon-age" class="info"></div>
<div id="moon-quart" class="info"></div>
<div id="moon-sign" class="info"></div>
<div id="moon-sign-change" class="info"></div>
<div id="moon-next-sign" class="info"></div>
<div id="moon-distance" class="info"></div>
<div id="moon-apogee" class="info"></div>
<div id="moon-next" class="info"></div>
<div id="moon-last" class="info"></div>
<div id="moon-long" class="info"></div>
<div id="moon-lat" class="info"></div>
<div class="info">Lieu : Fribourg, Suisse</div>
</div>
SCRIPT
<script>
// ------------------------------------------------------
// CALCUL LUNAIRE — FULL DATA
// ------------------------------------------------------
function moonFullData() {
const now = new Date();
const lp = 2551443; // cycle lunaire en secondes
const new_moon_ref = new Date(1970, 0, 7, 20, 35, 0);
const phaseTime = ((now - new_moon_ref) / 1000) % lp;
const phase = phaseTime / lp;
const age = phase * 29.53;
const illumination = Math.round((1 - Math.cos(phase * 2 * Math.PI)) * 50);
let quart = "";
if (phase < 0.25) quart = "Premier Croissant";
else if (phase < 0.50) quart = "Premier Quartier";
else if (phase < 0.75) quart = "Dernier Quartier";
else quart = "Dernier Croissant";
let emoji = "🌑", name = "Nouvelle Lune";
if (phase < 0.03) { emoji = "🌑"; name = "Nouvelle Lune"; }
else if (phase < 0.22) { emoji = "🌒"; name = "Premier Croissant"; }
else if (phase < 0.28) { emoji = "🌓"; name = "Premier Quartier"; }
else if (phase < 0.47) { emoji = "🌔"; name = "Gibbeuse Croissante"; }
else if (phase < 0.53) { emoji = "🌕"; name = "Pleine Lune"; }
else if (phase < 0.72) { emoji = "🌖"; name = "Gibbeuse Décroissante"; }
else if (phase < 0.78) { emoji = "🌗"; name = "Dernier Quartier"; }
else { emoji = "🌘"; name = "Dernier Croissant"; }
const distance = Math.round(384400 + 20000 * Math.cos(phase * 2 * Math.PI));
let apogee = "Distance moyenne";
if (distance < 365000) apogee = "🌑 Périgée (Lune proche)";
if (distance > 400000) apogee = "🌕 Apogée (Lune éloignée)";
const nextNew = Math.round((1 - phase) * 29.53);
const nextFull = Math.round(Math.abs(0.5 - phase) * 29.53);
const lastNew = Math.round(phase * 29.53);
const longVal = phase * 360;
const long = longVal.toFixed(2) + "°";
const lat = (Math.sin(phase * 2 * Math.PI) * 5).toFixed(2) + "°";
const zodiac = [
"♈ Bélier", "♉ Taureau", "♊ Gémeaux", "♋ Cancer",
"♌ Lion", "♍ Vierge", "♎ Balance", "♏ Scorpion",
"♐ Sagittaire", "♑ Capricorne", "♒ Verseau", "♓ Poissons"
];
const signIndex = Math.floor((longVal % 360) / 30);
const sign = zodiac[signIndex];
return {
emoji, name, illumination, age, quart,
distance, apogee, nextNew, nextFull, lastNew,
long, lat, sign, phase
};
}
// ------------------------------------------------------
// DÉTECTION DU CHANGEMENT DE SIGNE DANS LA JOURNÉE
// ------------------------------------------------------
function zodiacSignFromLongitude(longitude) {
const zodiac = [
"♈ Bélier", "♉ Taureau", "♊ Gémeaux", "♋ Cancer",
"♌ Lion", "♍ Vierge", "♎ Balance", "♏ Scorpion",
"♐ Sagittaire", "♑ Capricorne", "♒ Verseau", "♓ Poissons"
];
return zodiac[Math.floor((longitude % 360) / 30)];
}
function signChangeToday(currentPhase) {
const now = new Date();
const lp = 2551443;
const new_moon_ref = new Date(1970, 0, 7, 20, 35, 0);
const longNow = currentPhase * 360;
const signNow = zodiacSignFromLongitude(longNow);
const future = new Date(now.getTime() + 24 * 3600 * 1000);
const phaseFuture = (((future - new_moon_ref) / 1000) % lp) / lp;
const longFuture = phaseFuture * 360;
const signFuture = zodiacSignFromLongitude(longFuture);
const changed = signNow !== signFuture;
return {
changed,
signNow,
signFuture,
hoursLeft: 24
};
}
// ------------------------------------------------------
// AFFICHAGE
// ------------------------------------------------------
const m = moonFullData();
const sc = signChangeToday(m.phase);
document.getElementById("moon-emoji").textContent = m.emoji;
document.getElementById("moon-phase").textContent = "Phase : " + m.name;
document.getElementById("moon-illumination").textContent = "Illumination : " + m.illumination + "%";
document.getElementById("moon-age").textContent = "Âge : " + m.age.toFixed(1) + " jours";
document.getElementById("moon-quart").textContent = "Quartier : " + m.quart;
document.getElementById("moon-sign").textContent = "Signe astrologique : " + m.sign;
document.getElementById("moon-sign-change").textContent =
"Changement de signe aujourd’hui : " + (sc.changed ? "Oui" : "Non");
if (sc.changed) {
document.getElementById("moon-next-sign").textContent =
"Prochain signe : " + sc.signFuture + " (dans ~" + sc.hoursLeft + "h)";
}
document.getElementById("moon-distance").textContent = "Distance : " + m.distance + " km";
document.getElementById("moon-apogee").textContent = m.apogee;
document.getElementById("moon-next").textContent = "Prochaine nouvelle lune : " + m.nextNew + " jours";
document.getElementById("moon-last").textContent = "Depuis la dernière nouvelle lune : " + m.lastNew + " jours";
document.getElementById("moon-long").textContent = "Longitude lunaire : " + m.long;
document.getElementById("moon-lat").textContent = "Latitude lunaire : " + m.lat;
</script>