Skip to content

Commit

Permalink
Staging (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg authored Sep 23, 2024
2 parents f11c197 + 49bb9bc commit 4fd7d3e
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 41 deletions.
46 changes: 34 additions & 12 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ a, a:hover {
unicode-range: U+0F00-0FFF, U+10300-1032F, U+10380-1039F, U+0FCF, U+0FD0, U+0FD1, U+0FD2, U+0FD3, U+0FD4;
}

@font-face {
/*Tibetan | Jomolhari */
font-family: 'Uchen';
src: url('/static/fonts/Uchen-Regular.ttf');
unicode-range: U+0F00-0FFF, U+10300-1032F, U+10380-1039F, U+0FCF, U+0FD0, U+0FD1, U+0FD2, U+0FD3, U+0FD4;
}
@font-face {
/*English | Arial regular*/
font-family: 'IndUni-P-Regular';
Expand All @@ -161,7 +167,7 @@ a, a:hover {
--hebrew-sans-serif-font-family: "wujin+gangbi", "Heebo", "Roboto", sans-serif;

--english-serif-font-family: "IndUni-P-Regular", "Cardo", "Meltho", "HebrewInEnglish Serif Font", "adobe-garamond-pro", "Crimson Text", Georgia, "Times New Roman", serif, "Noto Sans Samaritan";
--hebrew-serif-font-family: "jomolhari", "Noto Color Emoji", "EnglishInHebrew Serif Font", "Cardo", "Taamey Frank", "adobe-garamond-pro", "Crimson Text", "Times New Roman", serif;
--hebrew-serif-font-family: "Uchen-Regular", "Noto Color Emoji", "EnglishInHebrew Serif Font", "Cardo", "Taamey Frank", "adobe-garamond-pro", "Crimson Text", "Times New Roman", serif;

--serif-h1-font-size: 48px;
--serif-h2-font-size: 30px;
Expand Down Expand Up @@ -223,11 +229,13 @@ body, .sans-serif {
/* edited to yakpotibetanUni from wujin */

.navSidebarModule > h1 > .int-he{
font-size: 18px;
font-family: var(--hebrew-serif-font-family) !important;
color: var(--selected-option) !important;
}

.navSidebarModule > .int-he{
font-size: 19px;
font-family: var(--hebrew-serif-font-family) !important;
color: var(--selected-option) !important;
}
Expand All @@ -243,16 +251,19 @@ body, .sans-serif {
}

.navSidebarModule > .downloadTextModule > .button {
font-size: 20px;
font-family: var(--hebrew-serif-font-family) !important;
color: var(--selected-option) !important;
}

.connectionsHeaderTitle > .int-he{
font-size: 18px;
font-family: var(--hebrew-serif-font-family) !important;
color: var(--selected-option) !important;
}

.connectionPanelSectionHeaderInner > .int-he{
font-size: 16px;
font-family: var(--hebrew-serif-font-family) !important;
color: var(--selected-option) !important;
}
Expand Down Expand Up @@ -283,6 +294,7 @@ body, .sans-serif {
}

body, .en, .int-en {
font-size: 18px;
--is-hebrew: initial; /* false */
}

Expand Down Expand Up @@ -803,7 +815,7 @@ input.noselect {
}

.header .search.hebrewSearch {
font-size: 18px;
font-size: 16px;
}

.mobileNavMenu {
Expand Down Expand Up @@ -1144,7 +1156,7 @@ div:has(#bannerMessage) + .readerApp.singlePanel .mobileNavMenu {
color: #000000;
font-family: "Roboto", "Heebo", "Helvetica Neue", Ariel, sans-serif;
padding: 5px 17px 5px 17px;
font-size: 14px;
font-size: 17px;
text-decoration-color: #666666;
height: 23px;
}
Expand Down Expand Up @@ -1887,6 +1899,7 @@ div.interfaceLinks-row a {
}

.readerPanel.hebrew .he {
font-size: 16px;
display: inline;
text-align: left;
}
Expand Down Expand Up @@ -2044,6 +2057,7 @@ div.interfaceLinks-row a {
}

.navTitleTab {
font-size: 18px;
margin-inline-end: 26px;
color: #999;
}
Expand Down Expand Up @@ -2142,7 +2156,7 @@ div.interfaceLinks-row a {
.readerPanel .navSidebarModule h1,
.readerPanel .bookPage h3 {
margin: 0 0 20px;
font-size: 22px;
font-size: 28px;
text-transform: none;
letter-spacing: 0;
border-bottom: 1px solid var(--light-grey);
Expand Down Expand Up @@ -2544,7 +2558,7 @@ span .asterisk {
text-align: start;
color: #666;
position: relative;
font-size: 22px;
font-size: 17px;
font-weight: 500;
margin: 0 0px 30px 0;
height: auto;
Expand Down Expand Up @@ -3136,6 +3150,7 @@ input.resourcesLink {
}

a.navBlockTitle {
font-size: 26px;
color: #000;
margin-inline-end: 20px;
}
Expand Down Expand Up @@ -3367,6 +3382,7 @@ a.navBlockTitle:hover {
}

.featuredSheetDate {
font-size: 24px;
color: var(--medium-grey);
font-size: 14px;
}
Expand Down Expand Up @@ -3406,7 +3422,7 @@ a.navBlockTitle:hover {
background-color: white;
text-align: center;
color: #000;
font-size: 16px;
font-size: 18px;
border-top: 4px solid transparent;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
width: 100%;
Expand Down Expand Up @@ -3497,7 +3513,7 @@ a.navBlockTitle:hover {
}

.readerNavCategoryMenu h2 {
font-size: 18px;
font-size: 22px;
color: #666;
margin: 0 0 20px;
}
Expand Down Expand Up @@ -4437,6 +4453,8 @@ details .open-details::before {
}

.versionBlock .versionTitle a {
font-family: --var(--hebrew-serif-font-family);
font-size: 20px;
color: black;
}

Expand Down Expand Up @@ -8289,6 +8307,7 @@ But not to use a display block directive that might break continuous mode for ot

.toolsButton.systemTypeface .toolsButtonText span.int-he,
.toolsButton.systemTypeface .toolsButtonText span.he {
font-size: 18px;
font-family: "wujin+gangbi", "Heebo", "Roboto", "Helvetica Neue", "Helvetica", sans-serif;
}

Expand Down Expand Up @@ -9083,7 +9102,7 @@ But not to use a display block directive that might break continuous mode for ot
padding: 16px 30px;
margin: 0 2px 6px 2px;
cursor: pointer;
font-size: 16px;
font-size: 18px;
box-sizing: border-box;
line-height: 19px;
text-align: center;
Expand All @@ -9108,6 +9127,7 @@ But not to use a display block directive that might break continuous mode for ot
}

a.button {
font-size: 16px;
color: white;
}

Expand Down Expand Up @@ -9446,7 +9466,7 @@ a .button:hover {

.lexicon-instructions,
.lexicon-content .loadingMessage {
font-size: 15px;
font-size: 18px;
font-style: italic;
}

Expand Down Expand Up @@ -10304,6 +10324,7 @@ body.interface-english .publishBox .react-tags__suggestions ul {
}

.alphabeticalTopicsNav {
font-size: 26px;
color: var(--dark-grey);
margin-bottom: 5px;
}
Expand Down Expand Up @@ -10429,7 +10450,7 @@ h3.aboutSheetHeader {
}

.translationsHeader .translationsDesc {
font-size: var(--sans-serif-body-font-size);
font-size: 20px;
color: var(--dark-grey);
}

Expand Down Expand Up @@ -12536,7 +12557,7 @@ section.SheetSource .SheetOutsideBiText {
}

.tab-view .tab-list .tab {
font-size: 16px;
font-size: 20px;
color: black;
text-align: center;
padding: 10px 0;
Expand Down Expand Up @@ -12625,7 +12646,8 @@ section.SheetSource .SheetOutsideBiText {
}

.tab-view.largeTabs .tab-list .tab {
font-size: 22px;
font-size: 14px;
font-family: --var(hebrew-sans-serif-font-family);
}

.tab-view.largeTabs .tab-list .active .tab {
Expand Down
Binary file added static/fonts/Uchen-Regular.ttf
Binary file not shown.
5 changes: 5 additions & 0 deletions static/icons/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"src": "/favicon-pecha.png?v=xQzLlLp7oR",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/favicon-pecha.png?v=xQzLlLp7oR",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#273557",
Expand Down
2 changes: 1 addition & 1 deletion static/js/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Footer extends Component {

return (
<div id='version_number'>
<InterfaceText>Version: 1.2.0</InterfaceText>
<InterfaceText>Version: 1.3.0</InterfaceText>
</div>
);
}
Expand Down
37 changes: 28 additions & 9 deletions static/js/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,16 +442,35 @@ const loadFeedBucket = (e) => {

const feedbucket = document.querySelector("feedbucket-app");
if (feedbucket) {
// Remove the event listener so the script isn't loaded multiple times
feedbucket.classList.toggle('hidden');
if(feedbucket.classList.toggle('hidden')){
feedbucket.classList.remove('hidden');
crossImage.classList.remove('hidden');
}else{
feedbucket.classList.add('hidden');
crossImage.classList.add('hidden');
// Toggle visibility of feedbucket
const isHidden = feedbucket.classList.toggle('hidden');

// Update visibility of crossImage based on feedbucket's visibility
if (isHidden) {
// If feedbucket is hidden, hide crossImage
crossImage.classList.add('hidden');
} else {
// If feedbucket is visible, show crossImage
crossImage.classList.remove('hidden');
}
}
// Function to check and hide feedbucket if necessary
function checkAndHideFeedbucket() {
if (crossImage.classList.contains('hidden') && !feedbucket.classList.contains('hidden')) {
// Use setTimeout to delay the hiding of feedbucket
setTimeout(() => {
feedbucket.classList.add('hidden'); // Hide feedbucket after delay
}, 3000); // Adjust the delay as needed (3000 ms = 3 seconds)
}
}
// Example event listener for crossImage click
crossImage.addEventListener('click', function() {
// Toggle the visibility of crossImage
crossImage.classList.toggle('hidden');

// Check and hide feedbucket if conditions are met
checkAndHideFeedbucket();
});
}

};

Expand Down
12 changes: 0 additions & 12 deletions static/js/serviceWorker.js

This file was deleted.

45 changes: 45 additions & 0 deletions static/serviceWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');

const CACHE = "pwabuilder-page";

// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
const offlineFallbackPage = "ToDo-replace-this-name.html";

self.addEventListener("message", (event) => {
if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting();
}
});

self.addEventListener('install', async (event) => {
event.waitUntil(
caches.open(CACHE)
.then((cache) => cache.add(offlineFallbackPage))
);
});

if (workbox.navigationPreload.isSupported()) {
workbox.navigationPreload.enable();
}

self.addEventListener('fetch', (event) => {
if (event.request.mode === 'navigate') {
event.respondWith((async () => {
try {
const preloadResp = await event.preloadResponse;

if (preloadResp) {
return preloadResp;
}

const networkResp = await fetch(event.request);
return networkResp;
} catch (error) {

const cache = await caches.open(CACHE);
const cachedResp = await cache.match(offlineFallbackPage);
return cachedResp;
}
})());
}
});
13 changes: 6 additions & 7 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register("{% static 'js/serviceWorker.js' %}")
navigator.serviceWorker.register("{% static 'serviceWorker.js' %}")
.then(function(registration) {
console.log('Service Worker registered with scope:', registration.scope);
})
Expand Down Expand Up @@ -357,12 +357,11 @@
let container=document.getElementById('imageContainer');
feedbucket.classList.toggle('hidden');
crossImage.classList.toggle('hidden');
if(!crossImage.classList.toggle('hidden')){
feedbucket.classList.add('hidden');
crossImage.classList.add('hidden');
}else{
feedbucket.classList.remove('hidden');
feedbucket.classList.remove('hidden');
if (!crossImage.classList.toggle('hidden')) {
feedbucket.classList.add('hidden'); // Hide feedbucket
crossImage.classList.add('hidden'); // Hide crossImage
} else {
feedbucket.classList.remove('hidden'); // Show feedbucket
}
}

Expand Down

0 comments on commit 4fd7d3e

Please sign in to comment.