Skip to content

Commit

Permalink
FEAT: Subscribe to calendar link
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdoc committed Jan 6, 2024
1 parent ff7a740 commit 5aa586e
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/_assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import Alpine from 'alpinejs';
import coreNav from './alpine/navigation.js';

window.Alpine = Alpine;
Alpine.data('coreNav', coreNav)
Alpine.data('coreNav', coreNav);
Alpine.start();
7 changes: 7 additions & 0 deletions src/_assets/svg/icon-apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/_assets/svg/icon-googlecalendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/_assets/svg/icon-microsoft365.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/_assets/svg/icon-outlook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
{% for event in eventList %}

{% if event.startDate | formatDate('MMMM') !== m %}
<h2 class="glbHeading px-4 mt-8 col-span-full">{{ event.startDate | formatDate('MMMM') }}</h2>
{% set m = event.startDate | formatDate('MMMM') %}
<div class="col-span-full px-4 flex justify-between items-baseline">
<h2 class="glbHeading mt-8">
{{ event.startDate | formatDate('MMMM') }}
</h2>

{% include 'blocks/cal/subscribe.njk' %}
{% set m = event.startDate | formatDate('MMMM') %}
</div>
{% endif %}

{% if event.startDate | formatDate !== d %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% set featuredEvent = events | eventsFuture | eventsFeatured | eventsSort | limit(1) | first %}
{% if featuredEvent %}
{% set event = featuredEvent %}
{% include 'blocks/simpleEvent.njk' %}
{% include 'blocks/cal/simpleEvent.njk' %}
{% set eventCount = 3 %}
{% endif %}

Expand All @@ -20,7 +20,7 @@
{% if event.title == featuredEvent.title or displayedEvents == eventCount%}
{# nothing to see here #}
{% else %}
{% include 'blocks/simpleEvent.njk' %}
{% include 'blocks/cal/simpleEvent.njk' %}
{% set displayedEvents = displayedEvents + 1 %}
{% endif %}

Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions src/_includes/blocks/cal/subscribe.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<div x-data="{ open: false }">
<a href="#subscribe" class="text-black no-underline inline-flex gap-1 items-center group" @click.prevent="open = ! open" @keyup.escape="open = ! open">
{% svgIcon "icon-calendar", "h-4 w-4 inline-block transition" %}
<span class="underline hover:no-underline">Subscribe to the church calendar</span>
</a>

<div id="subscribe" x-show="open" x-transition class="fixed inset-0 z-50 flex items-center justify-center overflow-auto bg-black bg-opacity-90" >
<ul class="divide-y" @click.outside="open = ! open">
<li class="p-2">
<p class="glbHeading text-white py-4">Select your calendar</p>
</li>
<li class="p-2">
<a class="text-white no-underline flex gap-2 items-center group" href="webcal://www.globe.church/calendar/globeCal.ics">
{% svgIcon "icon-apple", "h-4 w-4 inline-block transition group-hover:-translate-x-1" %}
<span class="underline hover:no-underline">Apple Calendar</span>
</a>
</li>
<li class="p-2">
<a class="text-white no-underline flex gap-2 items-center group" href="https://calendar.google.com/calendar/r?cid=webcal://www.globe.church/calendar/globeCal.ics">
{% svgIcon "icon-googlecalendar", "h-4 w-4 inline-block transition group-hover:-translate-x-1" %}
<span class="underline hover:no-underline">Google Calendar</span>
</a>
</li>
<li class="p-2">
<a class="text-white no-underline flex gap-2 items-center group" href="https://outlook.office.com/calendar/0/addfromweb?url=webcal://www.globe.church/calendar/globeCal.ics">
{% svgIcon "icon-microsoft365", "h-4 w-4 inline-block transition group-hover:-translate-x-1" %}
<span class="underline hover:no-underline">Microsoft365</span>
</a>
</li>
<li class="p-2">
<a class="text-white no-underline flex gap-2 items-center group" href="webcal://www.globe.church/calendar/globeCal.ics">
{% svgIcon "icon-outlook", "h-4 w-4 inline-block transition group-hover:-translate-x-1" %}
<span class="underline hover:no-underline">Outlook</span>
</a>
</li>
<li class="p-2">
<a class="text-white no-underline flex gap-2 items-center group" href="https://www.globe.church/calendar/globeCal.ics">
{% svgIcon "icon-calendar", "h-4 w-4 inline-block transition group-hover:-translate-x-1" %}
<span class="underline hover:no-underline">iCal Feed</span>
</a>
</li>
</ul>
</div>
</div>
2 changes: 1 addition & 1 deletion src/calendar/event.njk
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ eleventyComputed:

</main>

{% include 'blocks/eventsUpcoming.njk' %}
{% include 'blocks/cal/eventsUpcoming.njk' %}
6 changes: 3 additions & 3 deletions src/calendar/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ featuredImage: "./src/_assets/img/core/the-globe-church-people.jpg"

<p class="my-4"><a href="/sundays" class="glbBtn bg-blue hover:bg-white hover:text-orange">Join us this Sunday</a></p>

<p>
<p class="py-2">
<a href="#thisWeek" class="text-white no-underline inline-flex gap-2 items-center group">
{% svgIcon "icon-arrowDown", "h-6 w-6 inline-block transition group-hover:translate-y-1" %}
<span class="underline hover:no-underline">All events</span>
Expand All @@ -50,7 +50,7 @@ featuredImage: "./src/_assets/img/core/the-globe-church-people.jpg"
<div class="mx-auto lg:container mb-4 scroll-mt-4 lg:scroll-mt-12" id="thisWeek">
{% set eventList = events | eventsFuture | eventsSort %}
{# <h2 class="glbHeading px-4 mb-4">Events this week</h2> #}
{% include 'blocks/eventList.njk' %}
{% include 'blocks/cal/eventList.njk' %}
</div>


Expand Down Expand Up @@ -88,6 +88,6 @@ featuredImage: "./src/_assets/img/core/the-globe-church-people.jpg"
{# <div class="mx-auto lg:container mb-4 scroll-mt-4" id="futureEvents">
{% set eventList = events | eventsFuture(8, 'day') | eventsSort %}
<h2 class="glbHeading px-4 mb-4">Future events</h2>
{% include 'blocks/eventList.njk' %}
{% include 'blocks/cal/eventList.njk' %}
</div> #}
</main>
2 changes: 1 addition & 1 deletion src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ eleventyComputed:
</div>
</section>

{% include 'blocks/eventsUpcoming.njk' %}
{% include 'blocks/cal/eventsUpcoming.njk' %}

<div class="mx-auto lg:container mb-4">
{% include 'blocks/latestSermon.njk' %}
Expand Down

0 comments on commit 5aa586e

Please sign in to comment.