diff --git a/content/camp-form.md b/content/camp-form.md index 2c5c603..c736b9a 100644 --- a/content/camp-form.md +++ b/content/camp-form.md @@ -8,7 +8,7 @@ template: "simple_page.html" {{ floating_button(icon="chevron-down" text="To the form!" link="#form")}} -{{ pt(src="https://videos.tfcconnection.org/videos/embed/757dc0dd-9bdc-4d79-8f81-754249ff23d2" width="700" height="576")}} +{{ pt(src="https://videos.tfcconnection.org/videos/embed/0e6378c4-bb58-4fb1-8edf-72b73efc5ad2" width="700" height="576") }} {{ spacing(height="h-4")}} We hope you are as excited about camp as we are! If there is anything we can do to answer your questions and help you to get signed up for camp, please let us know! You can email any of us by going to the [contact page](/contact). diff --git a/content/ministries/camp/2024/index.md b/content/ministries/camp/2024/index.md new file mode 100644 index 0000000..dcf8e9b --- /dev/null +++ b/content/ministries/camp/2024/index.md @@ -0,0 +1,26 @@ +--- +title: 2024 TFC Camp - Anchors Aweigh +date: 2024-07-16 +description: Join us for an adventure diving deep into the sea! We are studying the anchors of sin that weigh us down. Come find out more! +--- + +# Make Sure You Are Ready! + +To come to camp, you should make sure you are ready! Follow this checklist to make sure you are ready: + +- Have my money for camp! (If you haven't paid the full amount, you likely owe $100. We also have a snack shop you may want to bring some more for!) +- Health form! If you haven't filled it out you can do so [here](file:///camp-health-form)! +- Packed and ready? +- Bible: Bring a paper Bible! +- Leave your phone and other electronics at home! + + +## Pray for open hearts and lives changed + +Camp is one of those times of the year where God works in incredible ways. Often times the sheer amount of time and intentionality of diving into God's Word and seeing ourselves reflected there helps to change us. Please be praying for the campers who will be there! + + +## Donations + +If you have any donations you'd like to give toward camp please go [here](https://secure.myvanco.com/L-Z772/campaign/C-13PK8) to give a monetary donation. If you'd like to give a food donation of some sort, please bring it by the TFC Office! + diff --git a/content/ministries/camp/2024/index.org b/content/ministries/camp/2024/index.org deleted file mode 100644 index 669de2d..0000000 --- a/content/ministries/camp/2024/index.org +++ /dev/null @@ -1,35 +0,0 @@ ---- -#+TITLE: 2024 TFC Camp - Anchors Aweigh -TITLE: 2024 TFC Camp - Anchors Aweigh -#+DATE: 2024-07-16 -DATE: 2024-07-16 -tags: - - Camp - - Anchors Aweigh -featured_image: "featured.jpg" -description: Anchors Aweigh -summary: Join us for an adventure diving deep into the sea! We are studying the anchors of sin that weigh us down. Come find out more! -showAuthor: false -showAuthorsBadge: true -showTaxonomies: true -showReadingTime: true -showWordCount: true -showDate: true -layout: hero -heroStyle: background -showTableOfContents: false ---- - -* Make Sure You Are Ready! -To come to camp, you should make sure you are ready! Follow this checklist to make sure you are ready: -- Have my money for camp! (If you haven't paid the full amount, you likely owe $100. We also have a snack shop you may want to bring some more for!) -- Health form! If you haven't filled it out you can do so [[/camp-health-form][here]]! -- Packed and ready? -- Bible: Bring a paper Bible! -- Leave your phone and other electronics at home! - -** Pray for open hearts and lives changed -Camp is one of those times of the year where God works in incredible ways. Often times the sheer amount of time and intentionality of diving into God's Word and seeing ourselves reflected there helps to change us. Please be praying for the campers who will be there! - -** Donations -If you have any donations you'd like to give toward camp please go [[https://secure.myvanco.com/L-Z772/campaign/C-13PK8][here]] to give a monetary donation. If you'd like to give a food donation of some sort, please bring it by the TFC Office! diff --git a/content/staff/chris-and-abbie-cochrun/2024-07/index.md b/content/staff/chris-and-abbie-cochrun/2024-07/index.md index 12a7215..7fa6e37 100644 --- a/content/staff/chris-and-abbie-cochrun/2024-07/index.md +++ b/content/staff/chris-and-abbie-cochrun/2024-07/index.md @@ -1,23 +1,17 @@ --- title: The Mystery of Camp - date: 2024-08-09 - -taxonomies: - tags: - - Chris & Abbie Cochrun - - Camp - - Newsletter - -featured~image~: \"featured.jpg\" -description: More than anything I\'ve yet to experience, TFC Camp is a magical place. I have loved it so much since I was a teenager and went myself. It was the place God changed my life... +description: More than anything I've yet to experience, TFC Camp is a magical place. I have loved it so much since I was a teenager and went myself. It was the place God changed my life... +extra: + image: "featured.jpg" + tags: ["Staff", "Northern Valley"] --- -# The Mystery of Camp {#the-mystery-of-camp-1} +# The Mystery of Camp -More than anything I\'ve yet to experience, TFC Camp is a magical place. I have loved it so much since I was a teenager and went myself. It was the place God changed my life, and the place where I found so many incredible friends that shaped who I became. I\'ve never been able to put into words quite how astounding camp is and what God has done there. This year, I was blessed with having some remarkable conversations with kids and volunteers alike about their experience at camp, and their joy as God did His thing there yet again. I thought I would share some of the cool things they said in this months newsletter. Check them our below! +More than anything I've yet to experience, TFC Camp is a magical place. I have loved it so much since I was a teenager and went myself. It was the place God changed my life, and the place where I found so many incredible friends that shaped who I became. I've never been able to put into words quite how astounding camp is and what God has done there. This year, I was blessed with having some remarkable conversations with kids and volunteers alike about their experience at camp, and their joy as God did His thing there yet again. I thought I would share some of the cool things they said in this months newsletter. Check them our below! -{{\< figure src=asa.jpg alt=\"Asa and the kid he poured hours into!\" caption=\"Asa and the kid he poured hours into!\" \>}} +{{ img(path="asa.jpg" alt="Asa and the kid he poured hours into!" caption="Asa and the kid he poured hours into!")}} > "This week has been incredible. I got to help in the kitchen at the first week of TFC camp and I am SO thankful for that!! This year my kids attended their second year and I was invited to help serve in the kitchen and got to bring my littles. It was hard work. It was exhausting. It was NOT enough sleep. But it was also one of the biggest blessings to myself and my children. The staff are unparalleled. Exceptional. More than my vocabulary can describe. The way they pour out love on every single person in their path. The way they spread the gospel and Jesus' love on anything that moves. The respect, appreciation, encouragement, love, kindness and joy that they spread thicker than sand at the beach. Our week at TFC camp was beyond the words that I can express. It was such a blessing to me, and I truly believe that every moment my kids get to spend at TFC camp will bless them and change them for the rest of their lives." > @@ -25,7 +19,7 @@ More than anything I\'ve yet to experience, TFC Camp is a magical place. I have How cool is that!! -{{\< figure src=devo.jpg alt=\"It\'s amazing watching kids do their devos in front of the cross!!\" caption=\"It\'s amazing watching kids do their devos in front of the cross!!\" \>}} +{{ img(path="devo.jpg" alt="It's amazing watching kids do their devos in front of the cross!!" caption="It's amazing watching kids do their devos in front of the cross!!")}} And here is a text my wife received after the first week of camp: @@ -33,13 +27,13 @@ And here is a text my wife received after the first week of camp: Larry was on staff with us several years ago, and went to be with Jesus in 2017. He's someone we loved very dearly, he even helped officiate our wedding! Larry had a personality and gift for just chatting with kids and loving on them well. He had many conversations about Jesus with kids that changed lives all over the place. He, more than anyone I know, was all about Jesus. Furthermore, he loved teenagers well, and loved talking with kids about life and Jesus. It's an honor to be compared to him! -{{\< figure src=skit.jpg alt=\"The kids who did a powerful skit on our last night praying for their peers!\" caption=\"The kids who did a powerful skit on our last night praying for their peers!\" \>}} +{{ img(path="skit.jpg" alt="The kids who did a powerful skit on our last night praying for their peers!" caption="The kids who did a powerful skit on our last night praying for their peers!")}} -Finally, here is a message from Jack Hager, whom we\'ve had speak at camp for years and has spoke at tons of other camps too. He and his wife Jane visited these last two weeks to help out. +Finally, here is a message from Jack Hager, whom we've had speak at camp for years and has spoke at tons of other camps too. He and his wife Jane visited these last two weeks to help out. -> "Just a written reminder that you guys are amazing. As you know, I\'ve spoken at a few camps over the decades...and although \"Camp Joy\" in and of itself is not on the top ten, TFC Connection camp is number one. +> "Just a written reminder that you guys are amazing. As you know, I've spoken at a few camps over the decades...and although "Camp Joy" in and of itself is not on the top ten, TFC Connection camp is number one. > Why? -> The blood, sweat, and tears of the months of preparation that are brought to fruition during the two weeks. It was a privilege and joy to sit in on one of the planning meetings for \"Cave\" week, so I know a bit of what goes on. But just a bit. All I know for sure is that the programming fleshes out to opportunities to steer the thinking of campers and thus impact them with the message of hope in a wide variety of ways. I do not believe there is anything like TFC anywhere in the country. There may be, but not known to me." +> The blood, sweat, and tears of the months of preparation that are brought to fruition during the two weeks. It was a privilege and joy to sit in on one of the planning meetings for "Cave" week, so I know a bit of what goes on. But just a bit. All I know for sure is that the programming fleshes out to opportunities to steer the thinking of campers and thus impact them with the message of hope in a wide variety of ways. I do not believe there is anything like TFC anywhere in the country. There may be, but not known to me." > > - Jack Hager @@ -49,19 +43,19 @@ Reading what other people thought about camp, is so affirming of what I believe ### Struggles -One kid I talked to had been struggling with some things for many years and was wanting to set things right. After he and I chatted about his struggles being all too common, you could just see his shoulders straightening. We talked about how God wants nothing more than to forgive him and give him strength to overcome it. We prayed, cried, and chatted. He called me the next week asking me to keep praying for him, and while I\'m sure he\'ll continue to struggle, as I mentioned to him, the desire to stop this thing means God is changing his heart! +One kid I talked to had been struggling with some things for many years and was wanting to set things right. After he and I chatted about his struggles being all too common, you could just see his shoulders straightening. We talked about how God wants nothing more than to forgive him and give him strength to overcome it. We prayed, cried, and chatted. He called me the next week asking me to keep praying for him, and while I'm sure he'll continue to struggle, as I mentioned to him, the desire to stop this thing means God is changing his heart! ### Caden -Caden and I had so many talks throughout this last week too that I can\'t even count them! He had questions about friendships, working in ministry, and bible questions galore! We chatted every day I believe and all of them I found myself just amazed at what God was doing in Caden\'s heart. In fact I\'m not even sure which thing to really tell you about because we just chatted so much!! But what I do know is that God was doing something in him. On our campfire night Caden sat with Theo and I and just broken by feeling lost as to what God is calling him to do in life, and feeling afraid that he\'d get it wrong. We comforted him, prayed with him, and reminded him over and over that God is big and nothing Caden does would ever stop him from accomplishing his mission, so when Caden is prayerfully doing what God wants him to do, he\'ll be just fine. +Caden and I had so many talks throughout this last week too that I can't even count them! He had questions about friendships, working in ministry, and bible questions galore! We chatted every day I believe and all of them I found myself just amazed at what God was doing in Caden's heart. In fact I'm not even sure which thing to really tell you about because we just chatted so much!! But what I do know is that God was doing something in him. On our campfire night Caden sat with Theo and I and just broken by feeling lost as to what God is calling him to do in life, and feeling afraid that he'd get it wrong. We comforted him, prayed with him, and reminded him over and over that God is big and nothing Caden does would ever stop him from accomplishing his mission, so when Caden is prayerfully doing what God wants him to do, he'll be just fine. ### Others -If I had pages and pages of newsletter, I might be able to tell you about most of the conversations I had with kids, and many too with interns. I wish I had the space to tell you all about Jeremy, Theo, Will, or Dorian, I wish I could share the heart-to-heart deep stuff about Kaylee or Cash, I wish I could tell you more about this family who sent their kids because they wanted to show their kids how they can learn about Jesus without bells and whistles at camp, and now they keep coming! Some things we hear at camp can\'t be repeated because it isn\'t our story to share, some things are just too sad, and some things are so incredible I\'m not sure anyone would believe it! Despite all that, I know this, God is good, and like He has for so long, He uses camp to do some remarkable things in the lives of kids. +If I had pages and pages of newsletter, I might be able to tell you about most of the conversations I had with kids, and many too with interns. I wish I had the space to tell you all about Jeremy, Theo, Will, or Dorian, I wish I could share the heart-to-heart deep stuff about Kaylee or Cash, I wish I could tell you more about this family who sent their kids because they wanted to show their kids how they can learn about Jesus without bells and whistles at camp, and now they keep coming! Some things we hear at camp can't be repeated because it isn't our story to share, some things are just too sad, and some things are so incredible I'm not sure anyone would believe it! Despite all that, I know this, God is good, and like He has for so long, He uses camp to do some remarkable things in the lives of kids. ### Thank You -Thank you guys for supporting us at TFC, I pray God is doing good things around your world too. If you aren\'t a part of our support team but want to be, just let me know! If you are, thank you so much for financially supporting us, it makes all this possible. And for everyone who prays for our ministry, thank you that we can rely on you to go to battle with us in prayer against much of the hard things we hear at camp. Most importantly, though, know that God is doing some cool things because you are praying! +Thank you guys for supporting us at TFC, I pray God is doing good things around your world too. If you aren't a part of our support team but want to be, just let me know! If you are, thank you so much for financially supporting us, it makes all this possible. And for everyone who prays for our ministry, thank you that we can rely on you to go to battle with us in prayer against much of the hard things we hear at camp. Most importantly, though, know that God is doing some cool things because you are praying! # Cochrun Happenings @@ -71,6 +65,6 @@ The boys got to enjoy the fair while I was at camp and loved the cotton candy an And at the end of July, Josiah turned 6 and Luke turned 4! I was at camp for their birthdays, but they came up to visit both days so it was fun to celebrate with them a bit! -{{\< figure src=fam.png alt=\"Family Happenings\" caption=\"Family Happenings\" \>}} +{{ img(path="fam.png" alt="Family Happenings" caption="Family Happenings" height=900)}} > Remember that you can help by donating [here](https://secure.myvanco.com/L-Z772/campaign/C-12WG5)! We love how God provides so we can serve this community!! diff --git a/src/api/camp_form.rs b/src/api/camp_form.rs index 4235c3e..6ed7425 100644 --- a/src/api/camp_form.rs +++ b/src/api/camp_form.rs @@ -43,7 +43,7 @@ impl From<&CampForm> for HashMap<&str, String> { fn from(form: &CampForm) -> Self { let mut map = HashMap::new(); map.insert( - "Full_Name", + "Student_Name", format!("{} {}", form.first_name.0, form.last_name.0), ); map.insert( @@ -52,15 +52,15 @@ impl From<&CampForm> for HashMap<&str, String> { ); map.insert("Parent_Phone", form.parent_phone.0.clone()); map.insert("Parent_Email", form.parent_email.0.clone().clone()); - map.insert("Birth_Date", form.birthdate.0.clone()); + map.insert("Birthdate", form.birthdate.0.clone()); map.insert("Gender", form.gender.0.clone()); - map.insert("Street_Address", form.street.0.clone()); + map.insert("Street", form.street.0.clone()); map.insert("City", form.city.0.clone()); map.insert("State", form.state.0.clone()); - map.insert("Zipcode", form.zip.0.clone().to_string()); + map.insert("Zip", form.zip.0.clone().to_string()); map.insert("Grade", form.grade.0.clone()); - map.insert("Week_Chosen", form.week.0.clone()); - map.insert("Shirt_Size", form.shirt.0.clone()); + map.insert("Week", form.week.0.clone()); + map.insert("Shirt", form.shirt.0.clone()); map.insert("Registration", form.registration.0.clone()); map.insert("Health_Form", form.health_form.0.clone()); map @@ -302,7 +302,7 @@ async fn store_camp_form(map: HashMap<&str, String>) -> Result { fields.insert("fields", map); json.insert("records", vec![fields]); let response = request - .post("https://table.tfcconnection.org/api/docs/opaHfFbgoZzdPYXhrUt2S8/tables/Camp_Data/records") + .post("https://table.tfcconnection.org/api/docs/opaHfFbgoZzdPYXhrUt2S8/tables/Camp_Process/records") .bearer_auth("b8189d1b315548aa610db2fd3a43177a967cd41f") .header("Content-Type", "application/json") .json(&json) diff --git a/src/css/main.css b/src/css/main.css deleted file mode 100644 index 7784083..0000000 --- a/src/css/main.css +++ /dev/null @@ -1,76 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - - -@layer base { - h1 { - @apply text-2xl; - } - h2 { - @apply text-xl; - } - - p { - @apply pb-4; - } - - ul, ol { - @apply list-outside; - @apply pl-6; /* Indent the list elements. */ - @apply mb-4; /* The bottom of the list should have a margin, like the paragraphs. */ - - /* Lists within a list, however, should not have a bottom margin. */ - ul, ol { - @apply mb-0; - } - } - - ul { - @apply list-disc; - } - - ol { - @apply list-decimal; - } - - blockquote { - p { - @apply py-0; - } - - @apply italic; - @apply border-l-2; - @apply border-neutral-500; - @apply pl-4; - @apply mb-4; - @apply text-neutral-600; - @apply dark:text-neutral-400; - } - - img { - @apply py-0; - @apply rounded-lg; - @apply shadow-xl; - @apply object-cover; - } -} - -/* Global default styles */ -html { - scroll-behavior: smooth; -} - -/* Default Pages content styles */ -#page-content a { - @apply underline; -} -#page-content p, h2 { - @apply py-4; -} -#page-content :is(h1, h2, h3, h4, h5, h6) { - @apply underline; -} -#page-content pre { - @apply p-4 my-4 overflow-x-auto; -} diff --git a/src/js/lang.js b/src/js/lang.js deleted file mode 100644 index 752a8b3..0000000 --- a/src/js/lang.js +++ /dev/null @@ -1,7 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - document.getElementById('switch-lang')?.addEventListener('click', switchLang); -}) - -function switchLang(event) { - document.getElementById('switch-lang-panel').classList.toggle('hidden') -} diff --git a/src/js/main.js b/src/js/main.js deleted file mode 100644 index bceef6d..0000000 --- a/src/js/main.js +++ /dev/null @@ -1,78 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - // ---------------- Selected Navbar Link ------------------------- - let navbar_links = document.querySelectorAll('.nav-links a'); - let trim_last_slash = window.location.href.replace(/\/$/, ''); - let selected_navbar_link = [...navbar_links].filter((item) => { - return ((item.href === trim_last_slash) || (item.href === window.location.href)) - }) - if (selected_navbar_link.length !== 0) { - for (let element of selected_navbar_link) { - element.className = "bg-gray-900 text-white px-3 py-2 rounded-md text-sm font-medium" - } - } - - // ---------------- Switch Theme ------------------------- - // On page load or when changing themes, best to add inline in `head` to avoid FOUC - if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { - document.documentElement.classList.add('dark') - document.getElementById('dark').classList.add('hidden'); - document.getElementById("syntax_highlight").href = "/syntax-dark.css"; - } else { - document.documentElement.classList.remove('dark') - document.getElementById('light').classList.add('hidden'); - document.getElementById("syntax_highlight").href = "/syntax-light.css"; - } - // Switch theme action - document.getElementById('switch-theme')?.addEventListener('click', switchTheme); - - // ---------------- Toggle Sidebar ------------------------- - document.getElementById('toggle-sidebar')?.addEventListener('click', toggleSidebar); - - // ---------------- Toggle Mobile menu ------------------------- - document.getElementById('toggle-mobile-menu')?.addEventListener('click', toggleMobileMenu); -}); - -function switchTheme() { - let current_theme = ([...document.documentElement.classList].includes('dark')) ? 'dark' : 'light'; - if (current_theme === 'dark') { - localStorage.theme = 'light'; - document.documentElement.classList.remove('dark'); - document.getElementById('light').classList.add('hidden'); - document.getElementById('dark').classList.remove('hidden'); - document.getElementById("syntax_highlight").href = "/syntax-light.css"; - } else { - localStorage.theme = 'dark'; - document.documentElement.classList.add('dark'); - document.getElementById('dark').classList.add('hidden'); - document.getElementById('light').classList.remove('hidden'); - document.getElementById("syntax_highlight").href = "/syntax-dark.css"; - } -} - -function toggleSidebar() { - let sidebar = document.getElementById('sidebar'); - if ([...sidebar.classList].includes('translate-x-0')) { - document.body.style.removeProperty("overflow") - sidebar.classList.remove('translate-x-0') - sidebar.classList.add('-translate-x-full') - } else { - document.body.style.setProperty("overflow", "hidden") - sidebar.classList.remove('-translate-x-full') - sidebar.classList.add('translate-x-0') - } -} - -function toggleMobileMenu() { - let menu = document.querySelector('#mobile-menu div.nav-links'); - if ([...menu.classList].includes('h-screen')) { - document.body.classList.remove("overflow-hidden", "relative") - document.documentElement.classList.remove("overscroll-none",) - menu.classList.remove('h-screen') - menu.classList.add('h-0') - } else { - document.body.classList.add("overflow-hidden", "relative") - document.documentElement.classList.add("overscroll-none",) - menu.classList.remove('h-0') - menu.classList.add('h-screen') - } -} diff --git a/src/js/page.js b/src/js/page.js deleted file mode 100644 index ce5d1af..0000000 --- a/src/js/page.js +++ /dev/null @@ -1,38 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - // ---------------- TOC Scrollspy -------------------- - if (document.getElementById('toc') !== null) { - - const table_of_content_links = document.querySelectorAll('#toc li a') - - let page_titles_ids = []; - [...table_of_content_links].forEach((item)=> { - page_titles_ids.push(item.href.substring(item.href.indexOf("#"))) - }) - const page_titles_elements = document.querySelectorAll(page_titles_ids.join(',')); - - let reversed_title_elements = [...page_titles_elements].reverse(); - let elem = getActiveTocElement(reversed_title_elements) || page_titles_elements[0]; //If no element has gone outside of viewport on y axis - findCorrespondingTocTitle(elem).classList.add('bg-blue-700') //page load - var previous_elem = elem - - window.addEventListener('scroll', () => { - let element = getActiveTocElement(reversed_title_elements) || page_titles_elements[0]; - - if (element !== previous_elem) { - findCorrespondingTocTitle(previous_elem).classList.remove('bg-blue-700') - findCorrespondingTocTitle(element).classList.add('bg-blue-700') - previous_elem = element - } - }) - } -}); -function getActiveTocElement(elements) { - return [...elements].find((item) => { - return (item.getBoundingClientRect().y <= 0) - }) -} -function findCorrespondingTocTitle(element) { - return [...document.querySelectorAll('#toc li a')].find((item) => { - return item.href.substring(item.href.indexOf("#")) === `#${element.id}` - }) -} diff --git a/src/js/search.js b/src/js/search.js deleted file mode 100644 index 6313310..0000000 --- a/src/js/search.js +++ /dev/null @@ -1,121 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - // let search_input = document.getElementById('search').addEventListener('click', openSearch) - - // var openmodal = document.querySelectorAll('.modal-open') - // for (var i = 0; i < openmodal.length; i++) { - // openmodal[i].addEventListener('click', function(event){ - // event.preventDefault() - // toggleSearchModal() - // }) - // } - let nav_search_input = document.getElementById('search'); - nav_search_input.addEventListener('click', function(event){ - event.preventDefault() - toggleSearchModal() - }) - - const overlay = document.querySelector('.modal-overlay') - overlay.addEventListener('click', toggleSearchModal) - - let closemodal = document.querySelectorAll('.modal-close') - // closemodal.addEventListener('click', toggleSearchModal) - for (var i = 0; i < closemodal.length; i++) { - closemodal[i].addEventListener('click', toggleSearchModal) - } - - document.onkeydown = function(evt) { - evt = evt || window.event - let isEscape = false - let isCmdK = false - if ("key" in evt) { - isEscape = (evt.key === "Escape" || evt.key === "Esc") - isCmdK = (evt.key === "k" && evt.metaKey === true) - } else { - isCmdK = (evt.keyCode === 75 && evt.metaKey) - isEscape = (evt.keyCode === 27) - } - if (isCmdK) { evt.preventDefault() } - if ((isEscape && document.body.classList.contains('search-active')) || isCmdK) { - toggleSearchModal(); - } - }; - - let search_index = elasticlunr.Index.load(window.searchIndex); - let elasticlunr_options = { - bool: "AND", - fields: { - title: {boost: 2}, - body: {boost: 1}, - } - }; - let search_term = ""; - let search_results = ""; - let search_input = document.getElementById('search-input'); - let search_results_container = document.getElementById('search-results'); - search_input.addEventListener('keyup', function(event) { - // Trigger search - if ([...document.body.classList].includes('search-active') && search_input.value.trim().length > 3) { - // console.log('search') - search_term = search_input.value.trim(); - // console.log(search_term) - search_results = search_index.search(search_term, elasticlunr_options); - // console.log(search_results) - if (Array.isArray(search_results) && search_results.length > 0) { - let result_list = document.getElementById('results-list'); - result_list.replaceChildren(); - let item = ""; - for (i = 0; i < search_results.length; i++) { - let item = formatResultItem(search_results[i]); - result_list.appendChild(item); - } - } - // if (results.length === 0) { - // $searchResults.style.display = "none"; - // return; - // } - } - }) -}); - -function toggleSearchModal () { - const modal = document.getElementById('search-modal') - modal.classList.toggle('opacity-0') - modal.classList.toggle('pointer-events-none') - document.body.classList.toggle('search-active') - if ([...document.body.classList].includes('search-active')) { - // window.setTimeout(function() { - document.getElementById('search-input').value = "" - document.getElementById('search-input').focus() - // }, 500); - } -} - -function formatResultItem(search_result) { - console.log(search_result) - let formatted_result = `
  • - - ${search_result.doc.title} - ${search_result.doc.description} - -
  • ` - return htmlToElement(formatted_result) -} - -// Credits : https://stackoverflow.com/a/35385518/7098666 -function htmlToElement(html) { - let template = document.createElement('template'); - html = html.trim(); - template.innerHTML = html; - return template.content.firstChild; -} - -// function openSearch() { -// console.log("open modal"); -// let search_modal = document.getElementById('search-modal'); -// search_modal.classList.remove('hidden'); -// console.log(search_modal); -// } - -// function search() { -// let index = elasticlunr.Index.load(window.searchIndex); -// } diff --git a/static/css/main.css b/static/css/main.css index f501db4..03bc691 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -310,9 +310,6 @@ .m-300 { margin: calc(var(--spacing) * 300); } - .mx-5 { - margin-inline: calc(var(--spacing) * 5); - } .mx-8 { margin-inline: calc(var(--spacing) * 8); } @@ -542,9 +539,6 @@ .flex-1 { flex: 1; } - .flex-2 { - flex: 2; - } .flex-3 { flex: 3; } @@ -718,13 +712,9 @@ border-style: var(--tw-border-style); border-width: 2px; } - .border-t-2 { - border-top-style: var(--tw-border-style); - border-top-width: 2px; - } - .border-b-2 { - border-bottom-style: var(--tw-border-style); - border-bottom-width: 2px; + .border-y-2 { + border-block-style: var(--tw-border-style); + border-block-width: 2px; } .border-black { border-color: var(--color-black); @@ -819,9 +809,6 @@ .px-4 { padding-inline: calc(var(--spacing) * 4); } - .px-5 { - padding-inline: calc(var(--spacing) * 5); - } .px-6 { padding-inline: calc(var(--spacing) * 6); } @@ -1532,11 +1519,6 @@ height: calc(var(--spacing) * 72); } } - .md\:w-1\/3 { - @media (width >= 48rem) { - width: calc(1/3 * 100%); - } - } .md\:w-full { @media (width >= 48rem) { width: 100%; @@ -1547,11 +1529,6 @@ max-width: var(--container-md); } } - .md\:flex-1 { - @media (width >= 48rem) { - flex: 1; - } - } .md\:flex-2 { @media (width >= 48rem) { flex: 2; @@ -1567,11 +1544,6 @@ flex-basis: calc(3/4 * 100%); } } - .md\:basis-full { - @media (width >= 48rem) { - flex-basis: 100%; - } - } .md\:grid-cols-2 { @media (width >= 48rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -1591,11 +1563,40 @@ } } } + .md\:border { + @media (width >= 48rem) { + border-style: var(--tw-border-style); + border-width: 1px; + } + } + .md\:border-2 { + @media (width >= 48rem) { + border-style: var(--tw-border-style); + border-width: 2px; + } + } + .md\:border-gray-200 { + @media (width >= 48rem) { + border-color: var(--color-gray-200); + } + } .md\:px-0 { @media (width >= 48rem) { padding-inline: calc(var(--spacing) * 0); } } + .md\:text-sm { + @media (width >= 48rem) { + font-size: var(--text-sm); + line-height: var(--tw-leading, var(--text-sm--line-height)); + } + } + .md\:shadow-2xl { + @media (width >= 48rem) { + --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25)); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + } .lg\:block { @media (width >= 64rem) { display: block; @@ -1661,11 +1662,6 @@ background-color: var(--color-blue-800); } } - .dark\:bg-gray-500 { - @media (prefers-color-scheme: dark) { - background-color: var(--color-gray-500); - } - } .dark\:bg-gray-700 { @media (prefers-color-scheme: dark) { background-color: var(--color-gray-700); @@ -1742,6 +1738,13 @@ } } } + .md\:dark\:border-black { + @media (width >= 48rem) { + @media (prefers-color-scheme: dark) { + border-color: var(--color-black); + } + } + } .\[\&\>\*\]\:py-4 { &>* { padding-block: calc(var(--spacing) * 4); diff --git a/static/js/main.js b/static/js/main.js index e481134..aecf287 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1 +1,91 @@ -function switchTheme(){"dark"==([...document.documentElement.classList].includes("dark")?"dark":"light")?(localStorage.theme="light",document.documentElement.classList.remove("dark"),document.getElementById("light").classList.add("hidden"),document.getElementById("dark").classList.remove("hidden"),document.getElementById("syntax_highlight").href="/syntax-light.css"):(localStorage.theme="dark",document.documentElement.classList.add("dark"),document.getElementById("dark").classList.add("hidden"),document.getElementById("light").classList.remove("hidden"),document.getElementById("syntax_highlight").href="/syntax-dark.css")}function toggleSidebar(){var e=document.getElementById("sidebar");[...e.classList].includes("translate-x-0")?(document.body.style.removeProperty("overflow"),e.classList.remove("translate-x-0"),e.classList.add("-translate-x-full")):(document.body.style.setProperty("overflow","hidden"),e.classList.remove("-translate-x-full"),e.classList.add("translate-x-0"))}function toggleMobileMenu(){var e=document.querySelector("#mobile-menu div.nav-links");[...e.classList].includes("h-screen")?(document.body.classList.remove("overflow-hidden","relative"),document.documentElement.classList.remove("overscroll-none"),e.classList.remove("h-screen"),e.classList.add("h-0")):(document.body.classList.add("overflow-hidden","relative"),document.documentElement.classList.add("overscroll-none"),e.classList.remove("h-0"),e.classList.add("h-screen"))}document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll(".nav-links a");let t=window.location.href.replace(/\/$/,"");e=[...e].filter(e=>e.href===t||e.href===window.location.href);if(0!==e.length)for(var d of e)d.className="bg-gray-900 text-white px-3 py-2 rounded-md text-sm font-medium";"dark"===localStorage.theme||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?(document.documentElement.classList.add("dark"),document.getElementById("dark").classList.add("hidden"),document.getElementById("syntax_highlight").href="/syntax-dark.css"):(document.documentElement.classList.remove("dark"),document.getElementById("light").classList.add("hidden"),document.getElementById("syntax_highlight").href="/syntax-light.css"),document.getElementById("switch-theme")?.addEventListener("click",switchTheme),document.getElementById("toggle-sidebar")?.addEventListener("click",toggleSidebar),document.getElementById("toggle-mobile-menu")?.addEventListener("click",toggleMobileMenu)}); \ No newline at end of file +document.addEventListener("DOMContentLoaded", function() { + // ---------------- Selected Navbar Link ------------------------- + let navbar_links = document.querySelectorAll('.nav-links a'); + let trim_last_slash = window.location.href.replace(/\/$/, ''); + let selected_navbar_link = [...navbar_links].filter((item) => { + return ((item.href === trim_last_slash) || (item.href === window.location.href)) + }) + if (selected_navbar_link.length !== 0) { + for (let element of selected_navbar_link) { + element.className = "bg-gray-900 text-white px-3 py-2 rounded-md md:text-sm text-3xl font-medium" + } + } + + // ---------------- Image Zoom ------------------------- + // Probably should only grab the images we want but whatever + const images = document.querySelectorAll('img'); + for (let img of images){ + img.addEventListener('click', zoomImage(img)); + } + + // ---------------- Switch Theme ------------------------- + // On page load or when changing themes, best to add inline in `head` to avoid FOUC + if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { + document.documentElement.classList.add('dark') + document.getElementById('dark').classList.add('hidden'); + document.getElementById("syntax_highlight").href = "/syntax-dark.css"; + } else { + document.documentElement.classList.remove('dark') + document.getElementById('light').classList.add('hidden'); + document.getElementById("syntax_highlight").href = "/syntax-light.css"; + } + // Switch theme action + document.getElementById('switch-theme')?.addEventListener('click', switchTheme); + + // ---------------- Toggle Sidebar ------------------------- + document.getElementById('toggle-sidebar')?.addEventListener('click', toggleSidebar); + + // ---------------- Toggle Mobile menu ------------------------- + document.getElementById('toggle-mobile-menu')?.addEventListener('click', toggleMobileMenu); +}); + +function zoomImage(img) { + const zoom = mediumZoom(img, { + background: "#282a36dd" + }); +} + +function switchTheme() { + let current_theme = ([...document.documentElement.classList].includes('dark')) ? 'dark' : 'light'; + if (current_theme === 'dark') { + localStorage.theme = 'light'; + document.documentElement.classList.remove('dark'); + document.getElementById('light').classList.add('hidden'); + document.getElementById('dark').classList.remove('hidden'); + document.getElementById("syntax_highlight").href = "/syntax-light.css"; + } else { + localStorage.theme = 'dark'; + document.documentElement.classList.add('dark'); + document.getElementById('dark').classList.add('hidden'); + document.getElementById('light').classList.remove('hidden'); + document.getElementById("syntax_highlight").href = "/syntax-dark.css"; + } +} + +function toggleSidebar() { + let sidebar = document.getElementById('sidebar'); + if ([...sidebar.classList].includes('translate-x-0')) { + document.body.style.removeProperty("overflow") + sidebar.classList.remove('translate-x-0') + sidebar.classList.add('-translate-x-full') + } else { + document.body.style.setProperty("overflow", "hidden") + sidebar.classList.remove('-translate-x-full') + sidebar.classList.add('translate-x-0') + } +} + +function toggleMobileMenu() { + let menu = document.querySelector('#mobile-menu div.nav-links'); + if ([...menu.classList].includes('h-screen')) { + document.body.classList.remove("overflow-hidden", "relative") + document.documentElement.classList.remove("overscroll-none",) + menu.classList.remove('h-screen') + menu.classList.add('h-0') + } else { + document.body.classList.add("overflow-hidden", "relative") + document.documentElement.classList.add("overscroll-none",) + menu.classList.remove('h-0') + menu.classList.add('h-screen') + } +} diff --git a/static/js/page.js b/static/js/page.js index 81e88ef..ce5d1af 100644 --- a/static/js/page.js +++ b/static/js/page.js @@ -1 +1,38 @@ -function getActiveTocElement(e){return[...e].find(e=>e.getBoundingClientRect().y<=0)}function findCorrespondingTocTitle(n){return[...document.querySelectorAll("#toc li a")].find(e=>e.href.substring(e.href.indexOf("#"))==="#"+n.id)}document.addEventListener("DOMContentLoaded",function(){if(null!==document.getElementById("toc")){var e=document.querySelectorAll("#toc li a");let n=[],t=([...e].forEach(e=>{n.push(e.href.substring(e.href.indexOf("#")))}),document.querySelectorAll(n.join(","))),i=[...t].reverse();var e=getActiveTocElement(i)||t[0],o=(findCorrespondingTocTitle(e).classList.add("bg-blue-700"),e);window.addEventListener("scroll",()=>{var e=getActiveTocElement(i)||t[0];e!==o&&(findCorrespondingTocTitle(o).classList.remove("bg-blue-700"),findCorrespondingTocTitle(e).classList.add("bg-blue-700"),o=e)})}}); \ No newline at end of file +document.addEventListener("DOMContentLoaded", function() { + // ---------------- TOC Scrollspy -------------------- + if (document.getElementById('toc') !== null) { + + const table_of_content_links = document.querySelectorAll('#toc li a') + + let page_titles_ids = []; + [...table_of_content_links].forEach((item)=> { + page_titles_ids.push(item.href.substring(item.href.indexOf("#"))) + }) + const page_titles_elements = document.querySelectorAll(page_titles_ids.join(',')); + + let reversed_title_elements = [...page_titles_elements].reverse(); + let elem = getActiveTocElement(reversed_title_elements) || page_titles_elements[0]; //If no element has gone outside of viewport on y axis + findCorrespondingTocTitle(elem).classList.add('bg-blue-700') //page load + var previous_elem = elem + + window.addEventListener('scroll', () => { + let element = getActiveTocElement(reversed_title_elements) || page_titles_elements[0]; + + if (element !== previous_elem) { + findCorrespondingTocTitle(previous_elem).classList.remove('bg-blue-700') + findCorrespondingTocTitle(element).classList.add('bg-blue-700') + previous_elem = element + } + }) + } +}); +function getActiveTocElement(elements) { + return [...elements].find((item) => { + return (item.getBoundingClientRect().y <= 0) + }) +} +function findCorrespondingTocTitle(element) { + return [...document.querySelectorAll('#toc li a')].find((item) => { + return item.href.substring(item.href.indexOf("#")) === `#${element.id}` + }) +} diff --git a/static/js/zoom.js b/static/js/zoom.js index b1214b7..0ec4681 100644 --- a/static/js/zoom.js +++ b/static/js/zoom.js @@ -1,2 +1,484 @@ -/*! medium-zoom 1.0.6 | MIT License | https://github.com/francoischalifour/medium-zoom */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).mediumZoom=t()}(this,(function(){"use strict";var e=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},c=window.Promise||function(e){function t(){}e(t,t)},u=function(e){var t=e.target;t!==N?-1!==O.indexOf(t)&&w({target:t}):E()},s=function(){if(!A&&T.original){var e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(k-e)>S.scrollOffset&&setTimeout(E,150)}},f=function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||E()},p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t;if(t.background&&(N.style.background=t.background),t.container&&t.container instanceof Object&&(n.container=e({},S.container,t.container)),t.template){var i=o(t.template)?t.template:document.querySelector(t.template);n.template=i}return S=e({},S,n),O.forEach((function(e){e.dispatchEvent(m("medium-zoom:update",{detail:{zoom:j}}))})),j},g=function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(e({},S,o))},v=function(){for(var e=arguments.length,t=Array(e),o=0;o0?t.reduce((function(e,t){return[].concat(e,i(t))}),[]):O;return n.forEach((function(e){e.classList.remove("medium-zoom-image"),e.dispatchEvent(m("medium-zoom:detach",{detail:{zoom:j}}))})),O=O.filter((function(e){return-1===n.indexOf(e)})),j},z=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O.forEach((function(n){n.addEventListener("medium-zoom:"+e,t,o)})),x.push({type:"medium-zoom:"+e,listener:t,options:o}),j},y=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return O.forEach((function(n){n.removeEventListener("medium-zoom:"+e,t,o)})),x=x.filter((function(o){return!(o.type==="medium-zoom:"+e&&o.listener.toString()===t.toString())})),j},b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.target,r=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},i=void 0,r=void 0;if(S.container)if(S.container instanceof Object)i=(t=e({},t,S.container)).width-t.left-t.right-2*S.margin,r=t.height-t.top-t.bottom-2*S.margin;else{var d=(o(S.container)?S.container:document.querySelector(S.container)).getBoundingClientRect(),m=d.width,a=d.height,l=d.left,c=d.top;t=e({},t,{width:m,height:a,left:l,top:c})}i=i||t.width-2*S.margin,r=r||t.height-2*S.margin;var u=T.zoomedHd||T.original,s=n(u)?i:u.naturalWidth||i,f=n(u)?r:u.naturalHeight||r,p=u.getBoundingClientRect(),g=p.top,v=p.left,h=p.width,z=p.height,y=Math.min(s,i)/h,b=Math.min(f,r)/z,E=Math.min(y,b),w="scale("+E+") translate3d("+((i-h)/2-v+S.margin+t.left)/E+"px, "+((r-z)/2-g+S.margin+t.top)/E+"px, 0)";T.zoomed.style.transform=w,T.zoomedHd&&(T.zoomedHd.style.transform=w)};return new c((function(e){if(i&&-1===O.indexOf(i))e(j);else{if(T.zoomed)e(j);else{if(i)T.original=i;else{if(!(O.length>0))return void e(j);var t=O;T.original=t[0]}if(T.original.dispatchEvent(m("medium-zoom:open",{detail:{zoom:j}})),k=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,A=!0,T.zoomed=d(T.original),document.body.appendChild(N),S.template){var n=o(S.template)?S.template:document.querySelector(S.template);T.template=document.createElement("div"),T.template.appendChild(n.content.cloneNode(!0)),document.body.appendChild(T.template)}if(document.body.appendChild(T.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),T.original.classList.add("medium-zoom-image--hidden"),T.zoomed.classList.add("medium-zoom-image--opened"),T.zoomed.addEventListener("click",E),T.zoomed.addEventListener("transitionend",(function t(){A=!1,T.zoomed.removeEventListener("transitionend",t),T.original.dispatchEvent(m("medium-zoom:opened",{detail:{zoom:j}})),e(j)})),T.original.getAttribute("data-zoom-src")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("srcset"),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.src=T.zoomed.getAttribute("data-zoom-src"),T.zoomedHd.onerror=function(){clearInterval(a),console.warn("Unable to reach the zoom image target "+T.zoomedHd.src),T.zoomedHd=null,r()};var a=setInterval((function(){T.zoomedHd.complete&&(clearInterval(a),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",E),document.body.appendChild(T.zoomedHd),r())}),10)}else if(T.original.hasAttribute("srcset")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.removeAttribute("loading");var l=T.zoomedHd.addEventListener("load",(function(){T.zoomedHd.removeEventListener("load",l),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",E),document.body.appendChild(T.zoomedHd),r()}))}else r()}}}))},E=function(){return new c((function(e){if(!A&&T.original){A=!0,document.body.classList.remove("medium-zoom--opened"),T.zoomed.style.transform="",T.zoomedHd&&(T.zoomedHd.style.transform=""),T.template&&(T.template.style.transition="opacity 150ms",T.template.style.opacity=0),T.original.dispatchEvent(m("medium-zoom:close",{detail:{zoom:j}})),T.zoomed.addEventListener("transitionend",(function t(){T.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(T.zoomed),T.zoomedHd&&document.body.removeChild(T.zoomedHd),document.body.removeChild(N),T.zoomed.classList.remove("medium-zoom-image--opened"),T.template&&document.body.removeChild(T.template),A=!1,T.zoomed.removeEventListener("transitionend",t),T.original.dispatchEvent(m("medium-zoom:closed",{detail:{zoom:j}})),T.original=null,T.zoomed=null,T.zoomedHd=null,T.template=null,e(j)}))}else e(j)}))},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target;return T.original?E():b({target:t})},L=function(){return S},H=function(){return O},C=function(){return T.original},O=[],x=[],A=!1,k=0,S=l,T={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(a)?S=a:(a||"string"==typeof a)&&v(a),S=e({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},S);var N=r(S.background);document.addEventListener("click",u),document.addEventListener("keyup",f),document.addEventListener("scroll",s),window.addEventListener("resize",E);var j={open:b,close:E,toggle:w,update:p,clone:g,attach:v,detach:h,on:z,off:y,getOptions:L,getImages:H,getZoomedImage:C};return j}})); +/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */ +(function(global, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, + global.mediumZoom = factory()); +})(this, function() { + "use strict"; + var _extends = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + var isSupported = function isSupported(node) { + return node.tagName === "IMG"; + }; + var isNodeList = function isNodeList(selector) { + return NodeList.prototype.isPrototypeOf(selector); + }; + var isNode = function isNode(selector) { + return selector && selector.nodeType === 1; + }; + var isSvg = function isSvg(image) { + var source = image.currentSrc || image.src; + return source.substr(-4).toLowerCase() === ".svg"; + }; + var getImagesFromSelector = function getImagesFromSelector(selector) { + try { + if (Array.isArray(selector)) { + return selector.filter(isSupported); + } + if (isNodeList(selector)) { + return [].slice.call(selector).filter(isSupported); + } + if (isNode(selector)) { + return [ selector ].filter(isSupported); + } + if (typeof selector === "string") { + return [].slice.call(document.querySelectorAll(selector)).filter(isSupported); + } + return []; + } catch (err) { + throw new TypeError("The provided selector is invalid.\n" + "Expects a CSS selector, a Node element, a NodeList or an array.\n" + "See: https://github.com/francoischalifour/medium-zoom"); + } + }; + var createOverlay = function createOverlay(background) { + var overlay = document.createElement("div"); + overlay.classList.add("medium-zoom-overlay"); + overlay.style.background = background; + return overlay; + }; + var cloneTarget = function cloneTarget(template) { + var _template$getBounding = template.getBoundingClientRect(), top = _template$getBounding.top, left = _template$getBounding.left, width = _template$getBounding.width, height = _template$getBounding.height; + var clone = template.cloneNode(); + var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; + var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; + clone.removeAttribute("id"); + clone.style.position = "absolute"; + clone.style.top = top + scrollTop + "px"; + clone.style.left = left + scrollLeft + "px"; + clone.style.width = width + "px"; + clone.style.height = height + "px"; + clone.style.transform = ""; + return clone; + }; + var createCustomEvent = function createCustomEvent(type, params) { + var eventParams = _extends({ + bubbles: false, + cancelable: false, + detail: undefined + }, params); + if (typeof window.CustomEvent === "function") { + return new CustomEvent(type, eventParams); + } + var customEvent = document.createEvent("CustomEvent"); + customEvent.initCustomEvent(type, eventParams.bubbles, eventParams.cancelable, eventParams.detail); + return customEvent; + }; + var mediumZoom = function mediumZoom(selector) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var Promise = window.Promise || function Promise(fn) { + function noop() {} + fn(noop, noop); + }; + var _handleClick = function _handleClick(event) { + var target = event.target; + if (target === overlay) { + close(); + return; + } + if (images.indexOf(target) === -1) { + return; + } + toggle({ + target: target + }); + }; + var _handleScroll = function _handleScroll() { + if (isAnimating || !active.original) { + return; + } + var currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; + if (Math.abs(scrollTop - currentScroll) > zoomOptions.scrollOffset) { + setTimeout(close, 150); + } + }; + var _handleKeyUp = function _handleKeyUp(event) { + var key = event.key || event.keyCode; + if (key === "Escape" || key === "Esc" || key === 27) { + close(); + } + }; + var update = function update() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var newOptions = options; + if (options.background) { + overlay.style.background = options.background; + } + if (options.container && options.container instanceof Object) { + newOptions.container = _extends({}, zoomOptions.container, options.container); + } + if (options.template) { + var template = isNode(options.template) ? options.template : document.querySelector(options.template); + newOptions.template = template; + } + zoomOptions = _extends({}, zoomOptions, newOptions); + images.forEach(function(image) { + image.dispatchEvent(createCustomEvent("medium-zoom:update", { + detail: { + zoom: zoom + } + })); + }); + return zoom; + }; + var clone = function clone() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return mediumZoom(_extends({}, zoomOptions, options)); + }; + var attach = function attach() { + for (var _len = arguments.length, selectors = Array(_len), _key = 0; _key < _len; _key++) { + selectors[_key] = arguments[_key]; + } + var newImages = selectors.reduce(function(imagesAccumulator, currentSelector) { + return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector)); + }, []); + newImages.filter(function(newImage) { + return images.indexOf(newImage) === -1; + }).forEach(function(newImage) { + images.push(newImage); + newImage.classList.add("medium-zoom-image"); + }); + eventListeners.forEach(function(_ref) { + var type = _ref.type, listener = _ref.listener, options = _ref.options; + newImages.forEach(function(image) { + image.addEventListener(type, listener, options); + }); + }); + return zoom; + }; + var detach = function detach() { + for (var _len2 = arguments.length, selectors = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + selectors[_key2] = arguments[_key2]; + } + if (active.zoomed) { + close(); + } + var imagesToDetach = selectors.length > 0 ? selectors.reduce(function(imagesAccumulator, currentSelector) { + return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector)); + }, []) : images; + imagesToDetach.forEach(function(image) { + image.classList.remove("medium-zoom-image"); + image.dispatchEvent(createCustomEvent("medium-zoom:detach", { + detail: { + zoom: zoom + } + })); + }); + images = images.filter(function(image) { + return imagesToDetach.indexOf(image) === -1; + }); + return zoom; + }; + var on = function on(type, listener) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + images.forEach(function(image) { + image.addEventListener("medium-zoom:" + type, listener, options); + }); + eventListeners.push({ + type: "medium-zoom:" + type, + listener: listener, + options: options + }); + return zoom; + }; + var off = function off(type, listener) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + images.forEach(function(image) { + image.removeEventListener("medium-zoom:" + type, listener, options); + }); + eventListeners = eventListeners.filter(function(eventListener) { + return !(eventListener.type === "medium-zoom:" + type && eventListener.listener.toString() === listener.toString()); + }); + return zoom; + }; + var open = function open() { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, target = _ref2.target; + var _animate = function _animate() { + var container = { + width: document.documentElement.clientWidth, + height: document.documentElement.clientHeight, + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + var viewportWidth = void 0; + var viewportHeight = void 0; + if (zoomOptions.container) { + if (zoomOptions.container instanceof Object) { + container = _extends({}, container, zoomOptions.container); + viewportWidth = container.width - container.left - container.right - zoomOptions.margin * 2; + viewportHeight = container.height - container.top - container.bottom - zoomOptions.margin * 2; + } else { + var zoomContainer = isNode(zoomOptions.container) ? zoomOptions.container : document.querySelector(zoomOptions.container); + var _zoomContainer$getBou = zoomContainer.getBoundingClientRect(), _width = _zoomContainer$getBou.width, _height = _zoomContainer$getBou.height, _left = _zoomContainer$getBou.left, _top = _zoomContainer$getBou.top; + container = _extends({}, container, { + width: _width, + height: _height, + left: _left, + top: _top + }); + } + } + viewportWidth = viewportWidth || container.width - zoomOptions.margin * 2; + viewportHeight = viewportHeight || container.height - zoomOptions.margin * 2; + var zoomTarget = active.zoomedHd || active.original; + var naturalWidth = isSvg(zoomTarget) ? viewportWidth : zoomTarget.naturalWidth || viewportWidth; + var naturalHeight = isSvg(zoomTarget) ? viewportHeight : zoomTarget.naturalHeight || viewportHeight; + var _zoomTarget$getBoundi = zoomTarget.getBoundingClientRect(), top = _zoomTarget$getBoundi.top, left = _zoomTarget$getBoundi.left, width = _zoomTarget$getBoundi.width, height = _zoomTarget$getBoundi.height; + var scaleX = Math.min(Math.max(width, naturalWidth), viewportWidth) / width; + var scaleY = Math.min(Math.max(height, naturalHeight), viewportHeight) / height; + var scale = Math.min(scaleX, scaleY); + var translateX = (-left + (viewportWidth - width) / 2 + zoomOptions.margin + container.left) / scale; + var translateY = (-top + (viewportHeight - height) / 2 + zoomOptions.margin + container.top) / scale; + var transform = "scale(" + scale + ") translate3d(" + translateX + "px, " + translateY + "px, 0)"; + active.zoomed.style.transform = transform; + if (active.zoomedHd) { + active.zoomedHd.style.transform = transform; + } + }; + return new Promise(function(resolve) { + if (target && images.indexOf(target) === -1) { + resolve(zoom); + return; + } + var _handleOpenEnd = function _handleOpenEnd() { + isAnimating = false; + active.zoomed.removeEventListener("transitionend", _handleOpenEnd); + active.original.dispatchEvent(createCustomEvent("medium-zoom:opened", { + detail: { + zoom: zoom + } + })); + resolve(zoom); + }; + if (active.zoomed) { + resolve(zoom); + return; + } + if (target) { + active.original = target; + } else if (images.length > 0) { + var _images = images; + active.original = _images[0]; + } else { + resolve(zoom); + return; + } + active.original.dispatchEvent(createCustomEvent("medium-zoom:open", { + detail: { + zoom: zoom + } + })); + scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; + isAnimating = true; + active.zoomed = cloneTarget(active.original); + document.body.appendChild(overlay); + if (zoomOptions.template) { + var template = isNode(zoomOptions.template) ? zoomOptions.template : document.querySelector(zoomOptions.template); + active.template = document.createElement("div"); + active.template.appendChild(template.content.cloneNode(true)); + document.body.appendChild(active.template); + } + if (active.original.parentElement && active.original.parentElement.tagName === "PICTURE" && active.original.currentSrc) { + active.zoomed.src = active.original.currentSrc; + } + document.body.appendChild(active.zoomed); + window.requestAnimationFrame(function() { + document.body.classList.add("medium-zoom--opened"); + }); + active.original.classList.add("medium-zoom-image--hidden"); + active.zoomed.classList.add("medium-zoom-image--opened"); + active.zoomed.addEventListener("click", close); + active.zoomed.addEventListener("transitionend", _handleOpenEnd); + if (active.original.getAttribute("data-zoom-src")) { + active.zoomedHd = active.zoomed.cloneNode(); + active.zoomedHd.removeAttribute("srcset"); + active.zoomedHd.removeAttribute("sizes"); + active.zoomedHd.removeAttribute("loading"); + active.zoomedHd.src = active.zoomed.getAttribute("data-zoom-src"); + active.zoomedHd.onerror = function() { + clearInterval(getZoomTargetSize); + console.warn("Unable to reach the zoom image target " + active.zoomedHd.src); + active.zoomedHd = null; + _animate(); + }; + var getZoomTargetSize = setInterval(function() { + if (active.zoomedHd.complete) { + clearInterval(getZoomTargetSize); + active.zoomedHd.classList.add("medium-zoom-image--opened"); + active.zoomedHd.addEventListener("click", close); + document.body.appendChild(active.zoomedHd); + _animate(); + } + }, 10); + } else if (active.original.hasAttribute("srcset")) { + active.zoomedHd = active.zoomed.cloneNode(); + active.zoomedHd.removeAttribute("sizes"); + active.zoomedHd.removeAttribute("loading"); + var loadEventListener = active.zoomedHd.addEventListener("load", function() { + active.zoomedHd.removeEventListener("load", loadEventListener); + active.zoomedHd.classList.add("medium-zoom-image--opened"); + active.zoomedHd.addEventListener("click", close); + document.body.appendChild(active.zoomedHd); + _animate(); + }); + } else { + _animate(); + } + }); + }; + var close = function close() { + return new Promise(function(resolve) { + if (isAnimating || !active.original) { + resolve(zoom); + return; + } + var _handleCloseEnd = function _handleCloseEnd() { + active.original.classList.remove("medium-zoom-image--hidden"); + document.body.removeChild(active.zoomed); + if (active.zoomedHd) { + document.body.removeChild(active.zoomedHd); + } + document.body.removeChild(overlay); + active.zoomed.classList.remove("medium-zoom-image--opened"); + if (active.template) { + document.body.removeChild(active.template); + } + isAnimating = false; + active.zoomed.removeEventListener("transitionend", _handleCloseEnd); + active.original.dispatchEvent(createCustomEvent("medium-zoom:closed", { + detail: { + zoom: zoom + } + })); + active.original = null; + active.zoomed = null; + active.zoomedHd = null; + active.template = null; + resolve(zoom); + }; + isAnimating = true; + document.body.classList.remove("medium-zoom--opened"); + active.zoomed.style.transform = ""; + if (active.zoomedHd) { + active.zoomedHd.style.transform = ""; + } + if (active.template) { + active.template.style.transition = "opacity 150ms"; + active.template.style.opacity = 0; + } + active.original.dispatchEvent(createCustomEvent("medium-zoom:close", { + detail: { + zoom: zoom + } + })); + active.zoomed.addEventListener("transitionend", _handleCloseEnd); + }); + }; + var toggle = function toggle() { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, target = _ref3.target; + if (active.original) { + return close(); + } + return open({ + target: target + }); + }; + var getOptions = function getOptions() { + return zoomOptions; + }; + var getImages = function getImages() { + return images; + }; + var getZoomedImage = function getZoomedImage() { + return active.original; + }; + var images = []; + var eventListeners = []; + var isAnimating = false; + var scrollTop = 0; + var zoomOptions = options; + var active = { + original: null, + zoomed: null, + zoomedHd: null, + template: null + }; + if (Object.prototype.toString.call(selector) === "[object Object]") { + zoomOptions = selector; + } else if (selector || typeof selector === "string") { + attach(selector); + } + zoomOptions = _extends({ + margin: 0, + background: "#fff", + scrollOffset: 40, + container: null, + template: null + }, zoomOptions); + var overlay = createOverlay(zoomOptions.background); + document.addEventListener("click", _handleClick); + document.addEventListener("keyup", _handleKeyUp); + document.addEventListener("scroll", _handleScroll); + window.addEventListener("resize", close); + var zoom = { + open: open, + close: close, + toggle: toggle, + update: update, + clone: clone, + attach: attach, + detach: detach, + on: on, + off: off, + getOptions: getOptions, + getImages: getImages, + getZoomedImage: getZoomedImage + }; + return zoom; + }; + function styleInject(css, ref) { + if (ref === void 0) ref = {}; + var insertAt = ref.insertAt; + if (!css || typeof document === "undefined") { + return; + } + var head = document.head || document.getElementsByTagName("head")[0]; + var style = document.createElement("style"); + style.type = "text/css"; + if (insertAt === "top") { + if (head.firstChild) { + head.insertBefore(style, head.firstChild); + } else { + head.appendChild(style); + } + } else { + head.appendChild(style); + } + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } + } + var css = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}"; + styleInject(css); + return mediumZoom; +}); diff --git a/static/processed_images/asa.3e1c92d2b35ab483.jpg b/static/processed_images/asa.3e1c92d2b35ab483.jpg new file mode 100644 index 0000000..c7c0e5b Binary files /dev/null and b/static/processed_images/asa.3e1c92d2b35ab483.jpg differ diff --git a/static/processed_images/devo.5190fd960186aa24.jpg b/static/processed_images/devo.5190fd960186aa24.jpg new file mode 100644 index 0000000..1c14e07 Binary files /dev/null and b/static/processed_images/devo.5190fd960186aa24.jpg differ diff --git a/static/processed_images/fam.918bfd9084eaec6a.png b/static/processed_images/fam.918bfd9084eaec6a.png new file mode 100644 index 0000000..55bf4c2 Binary files /dev/null and b/static/processed_images/fam.918bfd9084eaec6a.png differ diff --git a/static/processed_images/featured.111be8f23839e624.jpg b/static/processed_images/featured.111be8f23839e624.jpg deleted file mode 100644 index 0c18ec0..0000000 Binary files a/static/processed_images/featured.111be8f23839e624.jpg and /dev/null differ diff --git a/static/processed_images/featured.18fb537b958235f3.jpg b/static/processed_images/featured.18fb537b958235f3.jpg deleted file mode 100644 index e3e08ad..0000000 Binary files a/static/processed_images/featured.18fb537b958235f3.jpg and /dev/null differ diff --git a/static/processed_images/featured.29bff564d29b21a3.jpg b/static/processed_images/featured.29bff564d29b21a3.jpg deleted file mode 100644 index 597879b..0000000 Binary files a/static/processed_images/featured.29bff564d29b21a3.jpg and /dev/null differ diff --git a/static/processed_images/featured.34a4014f41f502c7.jpg b/static/processed_images/featured.34a4014f41f502c7.jpg deleted file mode 100644 index 17bd944..0000000 Binary files a/static/processed_images/featured.34a4014f41f502c7.jpg and /dev/null differ diff --git a/static/processed_images/featured.375b9732e0f9e6c8.jpg b/static/processed_images/featured.375b9732e0f9e6c8.jpg deleted file mode 100644 index b31b414..0000000 Binary files a/static/processed_images/featured.375b9732e0f9e6c8.jpg and /dev/null differ diff --git a/static/processed_images/featured.426b8fb90a2c60bb.jpg b/static/processed_images/featured.426b8fb90a2c60bb.jpg deleted file mode 100644 index ba9dea2..0000000 Binary files a/static/processed_images/featured.426b8fb90a2c60bb.jpg and /dev/null differ diff --git a/static/processed_images/featured.46f1036c31e4117e.jpg b/static/processed_images/featured.46f1036c31e4117e.jpg deleted file mode 100644 index 59a4617..0000000 Binary files a/static/processed_images/featured.46f1036c31e4117e.jpg and /dev/null differ diff --git a/static/processed_images/featured.4bb62331e076aa73.jpg b/static/processed_images/featured.4bb62331e076aa73.jpg deleted file mode 100644 index d7e069d..0000000 Binary files a/static/processed_images/featured.4bb62331e076aa73.jpg and /dev/null differ diff --git a/static/processed_images/featured.5b90aa13fecb6acd.jpg b/static/processed_images/featured.5b90aa13fecb6acd.jpg new file mode 100644 index 0000000..daedd10 Binary files /dev/null and b/static/processed_images/featured.5b90aa13fecb6acd.jpg differ diff --git a/static/processed_images/featured.6ebeb6dc35906470.jpg b/static/processed_images/featured.6ebeb6dc35906470.jpg deleted file mode 100644 index fa4a37f..0000000 Binary files a/static/processed_images/featured.6ebeb6dc35906470.jpg and /dev/null differ diff --git a/static/processed_images/featured.71d624c69d0c9404.jpg b/static/processed_images/featured.71d624c69d0c9404.jpg deleted file mode 100644 index 11215e2..0000000 Binary files a/static/processed_images/featured.71d624c69d0c9404.jpg and /dev/null differ diff --git a/static/processed_images/featured.72e27b98d32648b6.jpg b/static/processed_images/featured.72e27b98d32648b6.jpg deleted file mode 100644 index acbb920..0000000 Binary files a/static/processed_images/featured.72e27b98d32648b6.jpg and /dev/null differ diff --git a/static/processed_images/featured.790577e73fadd322.jpg b/static/processed_images/featured.790577e73fadd322.jpg deleted file mode 100644 index 17ee15b..0000000 Binary files a/static/processed_images/featured.790577e73fadd322.jpg and /dev/null differ diff --git a/static/processed_images/featured.7c176df3a4bb4fa0.jpg b/static/processed_images/featured.7c176df3a4bb4fa0.jpg deleted file mode 100644 index 28dc63c..0000000 Binary files a/static/processed_images/featured.7c176df3a4bb4fa0.jpg and /dev/null differ diff --git a/static/processed_images/featured.a7d8f670102420b9.jpg b/static/processed_images/featured.a7d8f670102420b9.jpg deleted file mode 100644 index 560217f..0000000 Binary files a/static/processed_images/featured.a7d8f670102420b9.jpg and /dev/null differ diff --git a/static/processed_images/featured.c572a82cda8226b3.jpg b/static/processed_images/featured.c572a82cda8226b3.jpg deleted file mode 100644 index 5389233..0000000 Binary files a/static/processed_images/featured.c572a82cda8226b3.jpg and /dev/null differ diff --git a/static/processed_images/featured.c900a7a47bef6a56.jpg b/static/processed_images/featured.c900a7a47bef6a56.jpg deleted file mode 100644 index 04fb7a1..0000000 Binary files a/static/processed_images/featured.c900a7a47bef6a56.jpg and /dev/null differ diff --git a/static/processed_images/featured.db116493d18ce017.jpg b/static/processed_images/featured.db116493d18ce017.jpg deleted file mode 100644 index 524329e..0000000 Binary files a/static/processed_images/featured.db116493d18ce017.jpg and /dev/null differ diff --git a/static/processed_images/featured.db915beeaa05d62c.jpg b/static/processed_images/featured.db915beeaa05d62c.jpg deleted file mode 100644 index 9a9a1ca..0000000 Binary files a/static/processed_images/featured.db915beeaa05d62c.jpg and /dev/null differ diff --git a/static/processed_images/featured.dbc61599a5385ccf.jpg b/static/processed_images/featured.dbc61599a5385ccf.jpg deleted file mode 100644 index 4a1883a..0000000 Binary files a/static/processed_images/featured.dbc61599a5385ccf.jpg and /dev/null differ diff --git a/static/processed_images/featured.e0e37bf9a0a49613.jpg b/static/processed_images/featured.e0e37bf9a0a49613.jpg deleted file mode 100644 index a04d85b..0000000 Binary files a/static/processed_images/featured.e0e37bf9a0a49613.jpg and /dev/null differ diff --git a/static/processed_images/featured.e4f2190cfc887935.jpg b/static/processed_images/featured.e4f2190cfc887935.jpg deleted file mode 100644 index 4790c16..0000000 Binary files a/static/processed_images/featured.e4f2190cfc887935.jpg and /dev/null differ diff --git a/static/processed_images/featured.e50d9e64504ccffb.jpg b/static/processed_images/featured.e50d9e64504ccffb.jpg deleted file mode 100644 index b26bcfa..0000000 Binary files a/static/processed_images/featured.e50d9e64504ccffb.jpg and /dev/null differ diff --git a/static/processed_images/featured.e72a674252bb943f.jpg b/static/processed_images/featured.e72a674252bb943f.jpg deleted file mode 100644 index acbb920..0000000 Binary files a/static/processed_images/featured.e72a674252bb943f.jpg and /dev/null differ diff --git a/static/processed_images/featured.e7dce5f42d8a059b.jpg b/static/processed_images/featured.e7dce5f42d8a059b.jpg deleted file mode 100644 index 7d8e7fa..0000000 Binary files a/static/processed_images/featured.e7dce5f42d8a059b.jpg and /dev/null differ diff --git a/static/processed_images/skit.e93c73420cfbe001.jpg b/static/processed_images/skit.e93c73420cfbe001.jpg new file mode 100644 index 0000000..0a8c89a Binary files /dev/null and b/static/processed_images/skit.e93c73420cfbe001.jpg differ diff --git a/templates/layout.html b/templates/layout.html index cb7886f..c5f7e94 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -268,7 +268,7 @@ -