Added support to show PDF files.
This commit is contained in:
parent
c55e0c7920
commit
c862dcb5e1
7
src/resources/AI_Agro_Support.pdf
Normal file
7
src/resources/AI_Agro_Support.pdf
Normal file
@ -0,0 +1,7 @@
|
||||
ario 1 Germogli 10 cm
|
||||
Giorno in corso
|
||||
|
||||
Giorno in corso
|
||||
2
|
||||
ario 3
|
||||
|
||||
@ -206,3 +206,11 @@ h2 {
|
||||
border-radius: 6px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#modal-pdf {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
Binary file not shown.
@ -52,7 +52,7 @@
|
||||
<h3 class="card-title">{{ t.card3_title }}</h3>
|
||||
<p class="card-text">{{ t.card3_text }}</p>
|
||||
</div>
|
||||
<div class="action-card" data-action="video" data-src="/resources/videos/assistant.mp4">
|
||||
<div class="action-card" data-action="pdf" data-src="/resources/AI_Agro_Support.pdf">
|
||||
<div class="card-icon">
|
||||
<img src="/resources/assistente-virtuale.png" alt="Assistente Virtuale Icon" width="100%" height="100%"/>
|
||||
</div>
|
||||
@ -67,6 +67,7 @@
|
||||
<button class="modal-close" id="modal-close" aria-label="{{ t.close_label }}">×</button>
|
||||
<video id="modal-video" controls></video>
|
||||
<iframe id="modal-iframe" src="" allowfullscreen></iframe>
|
||||
<iframe id="modal-pdf" src=""></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -74,20 +75,25 @@
|
||||
const modal = document.getElementById('modal');
|
||||
const modalVideo = document.getElementById('modal-video');
|
||||
const modalIframe = document.getElementById('modal-iframe');
|
||||
const modalPdf = document.getElementById('modal-pdf');
|
||||
const closeBtn = document.getElementById('modal-close');
|
||||
|
||||
function openModal(action, src) {
|
||||
if (action === 'video') {
|
||||
modalVideo.src = src;
|
||||
modalVideo.style.display = 'block';
|
||||
modalIframe.style.display = 'none';
|
||||
modalIframe.src = '';
|
||||
modalIframe.style.display = 'none'; modalIframe.src = '';
|
||||
modalPdf.style.display = 'none'; modalPdf.src = '';
|
||||
} else if (action === 'pdf') {
|
||||
modalPdf.src = src;
|
||||
modalPdf.style.display = 'block';
|
||||
modalVideo.style.display = 'none'; modalVideo.pause(); modalVideo.src = '';
|
||||
modalIframe.style.display = 'none'; modalIframe.src = '';
|
||||
} else {
|
||||
modalIframe.src = src;
|
||||
modalIframe.style.display = 'block';
|
||||
modalVideo.style.display = 'none';
|
||||
modalVideo.pause();
|
||||
modalVideo.src = '';
|
||||
modalVideo.style.display = 'none'; modalVideo.pause(); modalVideo.src = '';
|
||||
modalPdf.style.display = 'none'; modalPdf.src = '';
|
||||
}
|
||||
modal.classList.remove('hidden');
|
||||
}
|
||||
@ -97,6 +103,7 @@
|
||||
modalVideo.pause();
|
||||
modalVideo.src = '';
|
||||
modalIframe.src = '';
|
||||
modalPdf.src = '';
|
||||
}
|
||||
|
||||
document.querySelectorAll('[data-action]').forEach(btn => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user