Skip to content

Commit

Permalink
Event templates
Browse files Browse the repository at this point in the history
  • Loading branch information
shivangi1422 committed Apr 18, 2024
1 parent 54b7c66 commit bff2d8c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions templates/event/event.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.event main .section > div,
.event main .section div + .default-content-wrapper {
padding-top: 0;
}

.event main .section .default-content-wrapper h2:only-child {
padding-bottom: 20px;
}

.event main .section .default-content-wrapper {
padding-top: 15px;
padding-bottom: 15px;
}

.event .event-title {
font-size: 36px;
}

.event .find-out-more {
padding: 30px 0;
margin-right: 8px;
}

.event .find-out-more .fa-external-link {
color: inherit;
}

.event main .event-container p:last-of-type {
padding-bottom: 100px;
}
22 changes: 22 additions & 0 deletions templates/event/event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
div,
} from '../../scripts/dom-builder.js';

async function renderDetails(insertAfterElement) {
const summary = div({ class: 'event-summary' });
insertAfterElement.parentNode.insertBefore(summary, insertAfterElement.nextSibling);
}

export default async function buildAutoBlocks() {
const title = document.getElementById('event-details');
if (title) title.classList.add('event-title');

const moreBtn = document.querySelector('main strong > a:last-of-type');
if (moreBtn) {
moreBtn.setAttribute('target', '_blank');
const par = moreBtn.closest('p');
par.classList.add('find-out-more');
}

renderDetails(title);
}

0 comments on commit bff2d8c

Please sign in to comment.