Skip to content

feat: video-landing-page #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
May 1, 2025
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fa6f770
link-bootstrap-icons
vishalvivekm Apr 28, 2025
e294496
add-demo-video-content
vishalvivekm Apr 28, 2025
522f32d
add-baseof-layout-for-demo-video-content
vishalvivekm Apr 28, 2025
1bfeb40
update list layout
vishalvivekm Apr 28, 2025
a61fa8d
update-content
vishalvivekm Apr 28, 2025
1f6a540
add-logic-to-switch-video-section-on-page-using-hashes
vishalvivekm Apr 28, 2025
24743dc
add-style-for-video-landing-page
vishalvivekm Apr 28, 2025
e1d4ee2
import-style-for-landing-page
vishalvivekm Apr 28, 2025
3a01b5b
add-video-placeholder-thumbnail
vishalvivekm Apr 28, 2025
b0cfe93
mobile-view-responsive
vishalvivekm Apr 28, 2025
68eacf7
extend-pattern-to-nav-initially
vishalvivekm Apr 28, 2025
d98b9d2
fix-padding-bottom-of-hero-wrapper
vishalvivekm Apr 28, 2025
dc63acc
uncomment
vishalvivekm Apr 29, 2025
d03fc9f
update style
vishalvivekm May 1, 2025
821d913
feat: add video landing page layout
vishalvivekm May 1, 2025
7cf76e1
update frontmatter for video content
vishalvivekm May 1, 2025
06785d1
Rename list.html to landing-page-videos.html
vishalvivekm May 1, 2025
b452fa2
switch to "videos" and add tags
vishalvivekm May 1, 2025
ea9c8cb
feat: add support for direct videos under a category
vishalvivekm May 1, 2025
f0190a9
resolve css classes conflict
vishalvivekm May 1, 2025
a97df81
update margins
vishalvivekm May 1, 2025
0283f01
fix partial to list direct videos as well as those in subsections
vishalvivekm May 1, 2025
4d6b10c
feat: add modal player
vishalvivekm May 1, 2025
2fe8262
fix modal player:
vishalvivekm May 1, 2025
afd91bb
cleanup: rm -rf content/en/video-content
vishalvivekm May 1, 2025
9471c17
rm hotlinking of hero image
vishalvivekm May 1, 2025
e8ad2c6
mv inline style to sheet
vishalvivekm May 1, 2025
8fba9b6
populate video content
vishalvivekm May 1, 2025
1c871f9
set max height
vishalvivekm May 1, 2025
dced53b
fix build
vishalvivekm May 1, 2025
bbe0eb0
update content
vishalvivekm May 1, 2025
a450dcb
Merge branch 'master' into master
vishalvivekm May 1, 2025
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
Prev Previous commit
Next Next commit
feat: add modal player
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
vishalvivekm authored May 1, 2025
commit 4d6b10c984ef3ab580a29cd7d6a02bda5b7b9241
72 changes: 70 additions & 2 deletions layouts/partials/landing-page-videos.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
<div class="video-group" id="video-group-{{ $mainIndex }}-{{ $subIndex }}" style="display: none;">
<div class="video-grid">
{{ range $subSection.Pages }}
<div class="video-card" >
<div class="video-card"
data-video-id="{{ .Params.video_id }}"
data-video-title="{{ .Title }}"
data-video-url="{{ .RelPermalink }}"
>
<div class="video-thumbnail">
{{ if .Params.videoType }}
{{ if eq .Params.videoType "youtube" }}
Expand Down Expand Up @@ -101,7 +105,11 @@ <h3>{{ .Title }}</h3>
<div class="video-group" id="video-group-{{ $mainIndex }}-0" style="display: none;">
<div class="video-grid">
{{ range where $mainSection.Pages "Kind" "page" }}
<div class="video-card">
<div class="video-card"
data-video-id="{{ .Params.video_id }}"
data-video-title="{{ .Title }}"
data-video-url="{{ .RelPermalink }}"
>
<div class="video-thumbnail">
{{ if .Params.videoType }}
{{ if eq .Params.videoType "youtube" }}
Expand Down Expand Up @@ -146,6 +154,30 @@ <h3>{{ .Title }}</h3>
</div>
</div>

<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content" style="padding: 20px 20px 0;background-color: #333;">
<div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" style="background-color: #00d3a9;"></button>
</div>
<div class="modal-body p-0">
<div class="ratio ratio-16x9">
<iframe
id="vidIframee"
src=""
title=""
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
<a href="" id="videoPageLink"><h4 id="videoModalDetailTitle" style="padding: 1rem 0 2rem !important;"></h4></a>
</div>
</div>

</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const categoryTabs = document.querySelectorAll('.category-tab');
Expand Down Expand Up @@ -231,3 +263,39 @@ <h3>{{ .Title }}</h3>
});

</script>

<script>
document.addEventListener('DOMContentLoaded', function () {
const modalElement = document.getElementById('videoModal');
const modal = new bootstrap.Modal(modalElement);
const iframe = document.getElementById('vidIframee');
const videoTitleElem = document.getElementById('videoModalTitle');
const linkElem = document.getElementById('videoPageLink');

const videoCards = document.querySelectorAll('.video-card');

videoCards.forEach(card => {
card.addEventListener('click', function () {
const videoId = card.getAttribute('data-video-id');
const videoTitle = card.getAttribute('data-video-title');
const videoUrl = card.getAttribute('data-video-url');

// prep the modal
videoTitleElem.textContent = videoTitle;
linkElem.href = videoUrl;
iframe.src = `https://www.youtube.com/embed/${videoId}?autoplay=1&modestbranding=1&showinfo=0`; // autoplay=1 starts playing the vid

modal.show();
});
});

// on modal close, clear iframe src to stop the vid
modalElement.addEventListener('hidden.bs.modal', function () {
iframe.src = '';
});
});

document.getElementById('videoModal').addEventListener('hidden.bs.modal', () => {
console.log('Modal closed event fired');
});
</script>