Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-D8xJLSBX.js",
"file": "assets/app-Np9HQlJr.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true,
Expand Down
116 changes: 78 additions & 38 deletions public/js/ext/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2233,44 +2233,84 @@ var SEMICOLON = SEMICOLON || {};

// AUTO STICKY CHALLENGE LEFT COLUMN
const handleChallengeLeftColSticky = () => {
const startPositionY = 150;

const leftCol = document.getElementById('challenge-left-col');
if (!leftCol) return;

// Add new wrapper for Left Column
const parent = leftCol.parentNode.closest('div');
const leftColWrapper = document.createElement('div');
leftColWrapper.append(leftCol);
parent.insertBefore(leftColWrapper, parent.firstChild);

const handleStickLeftColumn = () => {
// reset all computed css
leftColWrapper.style.paddingTop = '';
leftCol.style.height = '';
leftCol.style.overflow = '';

if (window.innerWidth < 1024) return;

// make left Column fit with screen
leftCol.style.maxHeight = `calc(100dvh - ${startPositionY + 20}px)`;
leftCol.style.overflow = 'auto';

// compute padding top for wrapper
const wrapperTop = leftColWrapper.getBoundingClientRect().top;
const maxPaddingTop = Math.max(parent.clientHeight - leftCol.clientHeight, 0);

let paddingTop = Math.abs(Math.min(wrapperTop - startPositionY, 0));
paddingTop = Math.min(paddingTop, maxPaddingTop);

leftColWrapper.style.paddingTop = `${paddingTop}px`;
}

handleStickLeftColumn();
document.addEventListener('scroll', handleStickLeftColumn);
window.addEventListener('resize', handleStickLeftColumn);
};
handleChallengeLeftColSticky();
const startPositionY = 150;
const minWidth = 1024;
const guard = 16;

const leftCol = document.getElementById('challenge-left-col');
if (!leftCol) return;

const parent = leftCol.parentNode.closest('div') || leftCol.parentElement;
if (!parent) return;

let leftColWrapper = document.createElement('div');
leftColWrapper.append(leftCol);
parent.insertBefore(leftColWrapper, parent.firstChild);

const footer = document.getElementById('page-footer') || document.querySelector('footer');

let ticking = false;
const apply = () => {
ticking = false;

leftColWrapper.style.paddingTop = '';
leftCol.style.height = '';
leftCol.style.overflow = '';
leftCol.style.maxHeight = '';

if (window.innerWidth < minWidth) return;

leftCol.style.maxHeight = `calc(100dvh - ${startPositionY + 20}px)`;
leftCol.style.overflow = 'auto';

const wrapperRect = leftColWrapper.getBoundingClientRect();
const parentRect = parent.getBoundingClientRect();

const wrapperTopDoc = wrapperRect.top + window.scrollY;
const parentHeight = parent.clientHeight;
const leftColHeight = leftCol.clientHeight;

if (parentHeight <= leftColHeight + 8) {
leftColWrapper.style.paddingTop = '0px';
leftCol.style.maxHeight = '';
leftCol.style.overflow = '';
return;
}

let paddingTop = Math.max(window.scrollY + startPositionY - wrapperTopDoc, 0);
const maxPaddingByParent = Math.max(parentHeight - leftColHeight, 0);
paddingTop = Math.min(paddingTop, maxPaddingByParent);

if (footer) {
const footerTopDoc = footer.getBoundingClientRect().top + window.scrollY;
const leftColBottomDoc = wrapperTopDoc + paddingTop + leftColHeight;
const limit = footerTopDoc - guard;
if (leftColBottomDoc > limit) {
paddingTop = Math.max(paddingTop - (leftColBottomDoc - limit), 0);
}
}

leftColWrapper.style.paddingTop = `${Math.round(paddingTop)}px`;
};

const onScrollResize = () => {
if (!ticking) {
window.requestAnimationFrame(apply);
ticking = true;
}
};

apply();
document.addEventListener('scroll', onScrollResize, { passive: true });
window.addEventListener('resize', onScrollResize);

const ro = new ResizeObserver(onScrollResize);
ro.observe(leftCol);
ro.observe(parent);
if (footer) ro.observe(footer);
};

handleChallengeLeftColSticky();

// VIDEO MODAL
$('#video-modal-trigger-show').click(function() {
Expand Down
12 changes: 12 additions & 0 deletions resources/js/components/EventDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@
</p>
</div>

<div v-if="event.event_url" class="mb-6">
<p class="p-0 mb-2 font-semibold text-slate-500">
{{ $t('eventdetails.more_info') }}
</p>
<a
:href="event.event_url"
class="p-0 mb-6 font-normal text-dark-blue"
>
{{ event.event_url }}
</a>
</div>

<div
ref="mapContainerRef"
class="w-full h-[520px] top-0 left-0 mb-6 rounded-lg overflow-hidden"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/2021/_thumbnail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class="flex flex-col rounded-lg bg-white overflow-hidden cursor-pointer"
{{__('challenges-content.'.$slug.'.title')}}
</div>
<p class="text-slate-500 text-default p-0 font-bold font-['Blinker']">
{{$author}}
{{ strip_tags($author) }}
</p>
</div>
</div>