Skip to content

Commit

Permalink
Add pomona TV wall
Browse files Browse the repository at this point in the history
  • Loading branch information
NightScript370 committed Aug 8, 2024
1 parent d5aead4 commit 6e267a0
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 121 deletions.
6 changes: 3 additions & 3 deletions _includes/modals/chaiTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">ChaiTables Downloader</h3>
<h3 class="modal-title">Visual Sunrise times</h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>ChaiTables is what the אור החיים calendar uses to get visible sunrise times (as explained in the description for sunrise). Use this modal to scrape the website's listed times of the Jewish years <span class="hb-start-year"></span>-<span class="hb-end-year"></span>.so that you could </p>
<p>To use ChaiTables' Netz data, please insert your country as well as the metropolitan area (MA for short) you reside in:</p>
<p>Abiding by the times for sunrise recommended by our poskim involves using a specific calendar called לוח בכורי יוסף. The algorithm behind it is on a website called ChaiTables, made by the same author.</p>
<p>To get this data, please proceed through our minimal-setup derivative of the main ChaiTables setup, involving selecting your country & metropolitan area (MA for short) you reside in:</p>
<md-outlined-select id="MAIndex" required label="Country Selector">
<md-select-option selected aria-label="blank"></md-select-option>
{% for location in site.data.chaiTable %}
Expand Down
68 changes: 68 additions & 0 deletions assets/css/marquee.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* Marquee styles */
.marquee {
position: relative;
overflow: hidden;
user-select: none;
}

.marquee__content {
flex-shrink: 0;
min-width: 100%;
}

@keyframes scroll {
from {
transform: translateY(0);
}
to {
transform: translateY(-100%);
}
}

/* Pause animation when reduced-motion is set */
@media (prefers-reduced-motion: reduce) {
.marquee__content {
animation-play-state: paused !important;
}
}

/* Enable animation */
.marquee .marquee__content {
animation: scroll var(--length, 10s) linear infinite;
}

/* Reverse animation */
.marquee--reverse .marquee__content {
animation-direction: reverse;
}

/* Pause on hover */
.marquee--hover-pause:hover .marquee__content {
animation-play-state: paused;
}

/* Attempt to size parent based on content. Keep in mind that the parent width is equal to both content containers that stretch to fill the parent. */
.marquee--fit-content {
max-width: fit-content;
}

/* A fit-content sizing fix: Absolute position the duplicate container. This will set the size of the parent wrapper to a single child container. Shout out to Olavi's article that had this solution 👏 @link: https://olavihaapala.fi/2021/02/23/modern-marquee.html */
.marquee--pos-absolute .marquee__content:last-child {
position: absolute;
top: 0;
left: 0;
}

/* Enable position absolute animation on the duplicate content (last-child) */
.enable-animation .marquee--pos-absolute .marquee__content:last-child {
animation-name: scroll-abs;
}

@keyframes scroll-abs {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
35 changes: 18 additions & 17 deletions assets/js/shul-wall/limud.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ const jCal = new KosherZmanim.JewishCalendar(todayDate);

const hNum = new HebrewNumberFormatter();

const daf = document.querySelector('[data-zfReplace="dafBavli"]');
const dafYerushalmi = document.querySelector('[data-zfReplace="DafYerushalmi"]');

if (jCal.getJewishYear() < 5684) {
daf.innerHTML = "N/A. Daf Yomi (Bavli) was only created on Rosh Hashanah 5684 and continues onto this day"
} else {
const dafObject = jCal.getDafYomiBavli();
daf.innerHTML =
dafObject.getMasechta() + " " +
hNum.formatHebrewNumber(dafObject.getDaf());
for (const daf of document.querySelectorAll('[data-zfReplace="dafBavli"]')) {
if (jCal.getJewishYear() < 5684) {
daf.innerHTML = "N/A. Daf Yomi (Bavli) was only created on Rosh Hashanah 5684 and continues onto this day"
} else {
const dafObject = jCal.getDafYomiBavli();
daf.innerHTML =
dafObject.getMasechta() + " " +
hNum.formatHebrewNumber(dafObject.getDaf());
}
}

const dafYerushalmiObject = jCal.getDafYomiYerushalmi();
if (!dafYerushalmiObject || dafYerushalmiObject.getDaf() == 0) {
dafYerushalmi.innerHTML = "N/A";
} else {
dafYerushalmi.innerHTML = dafYerushalmiObject.getMasechta() + " " + hNum.formatHebrewNumber(dafYerushalmiObject.getDaf());
for (const dafYerushalmi of document.querySelectorAll('[data-zfReplace="DafYerushalmi"]')) {
const dafYerushalmiObject = jCal.getDafYomiYerushalmi();
if (!dafYerushalmiObject || dafYerushalmiObject.getDaf() == 0) {
dafYerushalmi.innerHTML = "N/A";
} else {
dafYerushalmi.innerHTML = dafYerushalmiObject.getMasechta() + " " + hNum.formatHebrewNumber(dafYerushalmiObject.getDaf());
}
}

const chafetzChayimYomi = jCal.getChafetzChayimYomi();
document.querySelector('[data-zfReplace="ccYomi"]').innerHTML = (chafetzChayimYomi.title + (chafetzChayimYomi.section ? (": " + chafetzChayimYomi.section) : "")) || "N/A";
for (const ccYomi of document.querySelectorAll('[data-zfReplace="ccYomi"]'))
ccYomi.innerHTML = (chafetzChayimYomi.title + (chafetzChayimYomi.section ? (": " + chafetzChayimYomi.section) : "")) || "N/A";

const leilouNishmat = await hiloulahIndex.getHiloulah(jCal)
for (let leilouNishmatList of document.querySelectorAll('[data-zfFind="hiloulah"]')) {
Expand Down
26 changes: 26 additions & 0 deletions assets/js/shul-wall/preSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,32 @@ switch (window.location.href.split('/').at(-1)) {
tzeithIssurMelakha: () => ({ minutes: 30, degree: 7.14 })
}
});
break;
case 'pomona':
preSetSettings = Object.freeze({
seconds: () => false,
timeFormat: () => 'h12',
language: () => 'en',
location: {
name: () => "Ohel Michael",
lat: () => 41.198124,
long: () => -74.055571,
elevation: () => 0,
timezone: () => "America/New_York"
},
calendarToggle: {
hourCalculators: () => 'degrees',
rtKulah: () => true,
tzeitTaanitHumra: () => false,
tekufaMidpoint: () => 'hatzoth',
tekufaCalc: () => 'shemuel'
},
customTimes: {
candleLighting: () => 20,
tzeithIssurMelakha: () => ({ minutes: 30, degree: 7.14 })
}
});
break;
}

export default preSetSettings || settings;
14 changes: 7 additions & 7 deletions assets/js/shul-wall/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ function writeMourningPeriod(mourningDiv) {
}

for (const [key, value] of Object.entries(jCal.mourningHalachot())) {
/** @type {HTMLElement} */
const halachaIndex = mourningDiv.querySelector(`[data-zfFind="${key}"]`);

if (value)
halachaIndex.style.removeProperty("display")
else
halachaIndex.style.display = "none"
mourningDiv.querySelectorAll(`[data-zfFind="${key}"]`)
.forEach((/** @type {HTMLElement} */ halachaIndex) => {
if (value)
halachaIndex.style.removeProperty("display")
else
halachaIndex.style.display = "none"
})
}
}

Expand Down
Loading

0 comments on commit 6e267a0

Please sign in to comment.