html
This blog post highlights a free feature from GPC that's worth checking out. On our Today Page, you'll find an elegant widget displaying the current date, a day counter, and GPC Sun Time. Head over to the About page to dive into how it all works—it's the result of extensive collaboration with AI. Hopefully, this process will help refine artificial intelligence, making it easier for me to connect with developers, entrepreneurs, and other talented folks. Together, we can build a more efficient system to benefit the world.
Consider this analogy: A man works hard and buys a 1,500-square-foot home, proudly thinking, "Look what I've acquired!" But I point out he can't choose his neighbors. Meanwhile, the man in the boat declares, "The whole world is my backyard." I'm like that boatman—the entire world is my backyard. All of human history is mine to draw from. Everything on this planet is my responsibility to care for and improve. There's no corner of Earth I don't want to make better.
With that in mind, here's some HTML code that bloggers, web developers, and anyone building an online presence can use for free. Incorporate GPC into your blog, business site, or personal project to enhance what's associated with your name.
Consider this analogy: A man works hard and buys a 1,500-square-foot home, proudly thinking, "Look what I've acquired!" But I point out he can't choose his neighbors. Meanwhile, the man in the boat declares, "The whole world is my backyard." I'm like that boatman—the entire world is my backyard. All of human history is mine to draw from. Everything on this planet is my responsibility to care for and improve. There's no corner of Earth I don't want to make better.
With that in mind, here's some HTML code that bloggers, web developers, and anyone building an online presence can use for free. Incorporate GPC into your blog, business site, or personal project to enhance what's associated with your name.
Also here is the Pahar Clock that changes the color of hours and minutes according to the Indian Pahar system.
Copy the GPC Date HTML Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GPC Date</title>
<style>
body {
background: linear-gradient(to bottom, gold, black);
color: #BB8FCE;
font-family: sans-serif;
text-align: center;
padding: 20px;
}
.date {
text-shadow:
-1px -1px 0 white,
1px -1px 0 white,
-1px 1px 0 white,
1px 1px 0 white;
font-size: 36px;
font-weight: bold;
line-height: 1.5;
text-decoration: none;
color: #BB8FCE;
}
</style>
</head>
<body>
<a id="gpc-link" href="https://fixedcal.blogspot.com/p/today.html?m=1" class="date">
Loading...
</a>
<script>
// Epoch: GPC 6019 day 1 = March 23, 2022
const epoch = new Date(2022, 2, 23); // Month is 0-based
// Months
const months = [
{name: 'Unspring', days: 30, emoji: '🌼'},
{name: 'Duspring', days: 30, emoji: '🌼'},
{name: 'Trispring', days: 31, emoji: '🌼'},
{name: 'Quadsum', days: 30, emoji: '☀️'},
{name: 'Fivesum', days: 30, emoji: '☀️'},
{name: 'Sixsum', days: 31, emoji: '☀️'},
{name: 'Sepafall', days: 30, emoji: '🍂'},
{name: 'Oktafall', days: 30, emoji: '🍂'},
{name: 'Novafall', days: 31, emoji: '🍂'},
{name: 'Dekawint', days: 30, emoji: '❄️'},
{name: 'Elvawint', days: 30, emoji: '❄️'},
{name: 'Dozawint', days: 31, emoji: '❄️'}
];
// Weekday emojis, offset for epoch March 23, 2022 (Wednesday)
const weekdays = ['🟠', '🟤', '🌺', '⚫', '🟢', '🔵', '🟣'];
function isLeap(year) {
return year % 7 === 4;
}
function getSuffix(n) {
if (n % 10 === 1 && n % 100 !== 11) return 'st';
if (n % 10 === 2 && n % 100 !== 12) return 'nd';
if (n % 10 === 3 && n % 100 !== 13) return 'rd';
return 'th';
}
// Current date and time
const now = new Date();
let total_ms = now - epoch;
let total_days = Math.floor(total_ms / (1000 * 3600 * 24)) + 1;
let year = 6019;
let day = total_days - 1; // 0-based
while (true) {
const leap = isLeap(year);
const year_length = 364 + (leap ? 7 : 0);
if (day < year_length) break;
day -= year_length;
year++;
}
const day_of_year = day + 1;
// Find month and date
let current_day = day_of_year;
let month_obj = {name: 'Leap Week', emoji: '❄️'}; // Default for leap week
let month_date = current_day - 364;
if (day_of_year <= 364 || !isLeap(year)) {
let cum_days = 0;
for (let m of months) {
if (current_day <= cum_days + m.days) {
month_obj = m;
month_date = current_day - cum_days;
break;
}
cum_days += m.days;
}
}
// Weekday
const weekday_index = day % 7;
const weekday_emoji = weekdays[weekday_index];
// Time
let hour = now.getHours() - 6;
if (hour < 0) hour += 24;
const min = now.getMinutes();
const time_str = (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min);
// Format
const gpc_date = `${year}.${day_of_year}<br>${weekday_emoji} ${month_obj.name} ${month_date}${getSuffix(month_date)}<br>${month_obj.emoji} ${time_str}`;
// Set to element
document.getElementById('gpc-link').innerHTML = gpc_date;
</script>
</body>
</html>
Comments
Post a Comment