Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
letterly authored Apr 2, 2024
1 parent d2cb508 commit 391f4bd
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 16 deletions.
14 changes: 13 additions & 1 deletion calendar-changelog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
changelog.innerHTML =
`<h3>30 March 2024</h3>
`<pre><h3>1 April 2024</h3>
>Added April Fools' Day as a global holiday
>Separate Braille conversion website is now linked
>Fixed date of Laetare Sunday
>Fixed some issues with how the changelog was displayed
>Modified the "return to menu" button
<h3>31 March 2024</h3>
>AM/PM times are now an option in settings
>My separate numeral converter website is now linked in the menu, full integration coming soon
>Updated the time zones of European countries and Israel (I promise this will eventually be automatic... someday)
<h3>30 March 2024</h3>
>Website renamed Internationalization Project from Universal Calendar Project
>The updates are now on the main website not a separate page
>Name Day Today and Find Name Day are now combined into a single Name Day section
Expand Down
9 changes: 8 additions & 1 deletion calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ body{
width: 100%;
}

#changelog{
font-size: 28px;
}
#changelog pre{
white-space: pre-wrap;
}

td{
font-size: 24px;
width: 30%;
Expand Down Expand Up @@ -349,7 +356,7 @@ h3{
h1{
text-align: center;
font-weight: 700;
font-size: 48px;
font-size: 60px;
margin-bottom: 0px;
}
h2{
Expand Down
10 changes: 6 additions & 4 deletions calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<h1 id="header" onclick="reveal('menu')"">Internationalization Project</h1>
<div id="menu">
<h3>Select a section:</h3>
<button><a href="interbraille.html" target="_blank" style="text-decoration: none;">Braille Converter</a></button>
<button onclick="reveal('calendar')">Calendar Converter</button>
<button onclick="reveal('date')">Date Formatter</button>
<button><a href="uninumber.html" target="_blank" style="text-decoration: none;">Numeral Converter</a></button>
Expand Down Expand Up @@ -133,16 +134,16 @@ <h2 id="findany">Find any day between 1900 and 2060 CE</h2>
<div id="dayname"></div>
<div class="selectblock" id="selectblockfive">
<select id="loc" onchange="locationChange()">
<option value="33;35;2">Akko 🇮🇱</option>
<option value="33;35;3">Akko 🇮🇱</option>
<option value="51.2;71.4;5">Astana 🇰🇿</option>
<option value="30;31;2">Cairo 🇪🇬</option>
<option value="6.9;79.9;5.5">Colombo 🇱🇰</option>
<option value="14.7;-17.5;0">Dakar 🇸🇳</option>
<option value="36.2;44;3">Erbil 🇮🇶</option>
<option value="-6;107;7">Jakarta 🇮🇩</option>
<option value="31.7683;35.2137;2">Jerusalem 🇮🇱</option>
<option value="31.7683;35.2137;3">Jerusalem 🇮🇱</option>
<option value="-4;15;1">Kinshasa 🇨🇩</option>
<option value="50.5;30.5;2">Kyiv 🇺🇦</option>
<option value="50.5;30.5;3">Kyiv 🇺🇦</option>
<option value="21.5;40;3">Mecca 🇸🇦</option>
<option value="24.5;39.6;3">Medina 🇸🇦</option>
<option value="-38;145;11">Melbourne 🇦🇺</option>
Expand All @@ -158,7 +159,7 @@ <h2 id="findany">Find any day between 1900 and 2060 CE</h2>
<option value="43.5;-79;-4">Toronto 🇨🇦</option>
<option value="-23.5;-46.5;-3">São Paulo 🇧🇷</option>
<option value="31;121.5;8">Shanghai 🇨🇳</option>
<option value="52;21;1">Warsaw 🇵🇱</option>
<option value="52;21;2">Warsaw 🇵🇱</option>
<option value="38.89;-77.01;-4" selected>Washington DC 🇺🇸</option>
</select>
<!--
Expand Down Expand Up @@ -247,6 +248,7 @@ <h3>Email me <a href="mailto:[email protected]">here</a> with any question
</div>
<div id="settings">
<button id="gregera" onclick="adce()">AD/<b>CE</b></button>
<button id="twelvetwenty" onclick="twelve()">AM|PM/<b>24 Hour</b></button>
</div>
<div id="changelog"></div>
</body>
Expand Down
83 changes: 73 additions & 10 deletions calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jmlist = ["January", "February", "March", "April", "May", "June", "July", "Augus

preferences = {
gregEra: "CE",
time: "24",
}


Expand Down Expand Up @@ -357,23 +358,37 @@ function suntimes(lat, lng, tz, angl, relativehours) {

function julianhourize(juliandecimal){ //REWRITE
hours = Math.floor(juliandecimal)
appendage = ""
if(preferences.time == "12"){
if(hours > 12){
hours -= 12
appendage = " p.m."
}
else if(hours == 0){
hours = 12
appendage = " a.m."
}
else{
appendage = " a.m."
}
}
minutes = Math.floor(juliandecimal % 1 * 60)
if(minutes < 10) minutes = "0" + minutes
return `${hours}:${minutes}`
return `${hours}:${minutes}${appendage}`
}

function locationChange(){
city = loc.options[loc.selectedIndex].text
locinfo = loc.value.split(";")
astrotwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -18.833)[0] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[0]
nauticaltwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[0] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[0]
civiltwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[0] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[0]
astrotwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -18.833)[0] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[0]
nauticaltwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[0] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[0]
civiltwilight1.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[0] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[0]
snrs.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[0]
mddy.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -15)[2]
snst.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[1]
civiltwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[1] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[1]
nauticaltwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[1] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[1]
astrotwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[1] + "-" + suntimes(locinfo[0], locinfo[1], locinfo[2], -18.833)[1]
civiltwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -0.833)[1] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[1]
nauticaltwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -6.833)[1] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[1]
astrotwilight2.innerHTML = suntimes(locinfo[0], locinfo[1], locinfo[2], -12.833)[1] + " - " + suntimes(locinfo[0], locinfo[1], locinfo[2], -18.833)[1]
//
zmanim.innerHTML = "<a style='font-weight:700;color:black' href='https://en.wikipedia.org/wiki/Zmanim' target='_blank'>Zmanim</a>: "
zmanim.innerHTML += `<a class="hebrew" href="https://en.wikipedia.org/wiki/Zmanim#Daybreak" target="_blank">Daybreak</a>: ${suntimes(locinfo[0], locinfo[1], locinfo[2], -16.1)[0]} | `
Expand Down Expand Up @@ -805,6 +820,17 @@ function adce(){
}
reset()
}
function twelve(){
if(preferences.time == "12"){
preferences.time = "24"
twelvetwenty.innerHTML = "AM|PM/<b>24 Hour</b>"
}
else{
preferences.time = "12"
twelvetwenty.innerHTML = "<b>AM|PM</b>/24 Hour"
}
reset()
}

function dateify(){
moji = loc.options[loc.selectedIndex].text.split(" ").slice(-1)[0]
Expand Down Expand Up @@ -2571,6 +2597,13 @@ function holidaycheck(thatday){
link: "https://en.wikipedia.org/wiki/International_Women's_Day",
name: "International Women's Day",
},
{
country: "Global",
cal: "Gregorian",
day: ["1 April"],
link: "https://en.wikipedia.org/wiki/April_Fools'_Day",
name: "April Fools' Day",
},
{
country: "Global",
cal: "Gregorian",
Expand Down Expand Up @@ -3939,14 +3972,44 @@ function holidaycheck(thatday){
link: "https://en.wikipedia.org/wiki/Laetare_Sunday",
cal: "Gregorian",
name: "Laetare Sunday",
day: [makeGregorianDate(2)],
day: [makeGregorianDate(-21)],
},
{
link: "https://en.wikipedia.org/wiki/Easter_Monday",
cal: "Gregorian",
name: "Easter Monday",
day: [makeGregorianDate(2)],
},
{
link: "https://en.wikipedia.org/wiki/Presentation_of_Mary",
cal: "Gregorian",
name: "Presentation of Mary",
day: ["21 November"],
},
{
link: "https://en.wikipedia.org/wiki/Presentation_of_Mary",
cal: "Julian",
name: "The Entry of the Most Holy Theotokos into the Temple",
day: ["21 November"],
},
{
link: "https://en.wikipedia.org/wiki/Saint_John%27s_Eve",
cal: "Gregorian",
name: "Saint John's Eve",
day: ["23 June"],
},
{
link: "https://en.wikipedia.org/wiki/Nativity_of_John_the_Baptist",
cal: "Gregorian",
name: "Nativity of Saint John the Baptist",
day: ["24 June"],
},
{
link: "https://en.wikipedia.org/wiki/Nativity_of_John_the_Baptist",
cal: "Julian",
name: "Nativity of Saint John the Baptist",
day: ["24 June"],
},
{
link: "https://en.wikipedia.org/wiki/Allhallowtide",
name: "Allhallowtide",
Expand Down Expand Up @@ -4904,11 +4967,11 @@ reset()

function reveal(subject){
if(subject != "menu"){
header.textContent = "<= Return to menu"
header.textContent = "🔙"
menu.style.display = "none"
}
else{
header.textContent = "Universal Calendar Project"
header.textContent = "Internationalization Project"
menu.style.display = "block"
for(oooo of "selection, #settings, #changelog, #timenow, #namesearch, #zmanim, #format, #sunrisesunset, #prayertimes, #mandaictimes, #angles, #nationalholidays, #holidays, #observances, #monthly, #weekly, #answer, #selectblockfive, #contactinfo, #namediv".split(", #")) document.getElementById(oooo).style.display = "none"
}
Expand Down

0 comments on commit 391f4bd

Please sign in to comment.