libreria-astro-lefebvre 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +46 -46
  2. package/package.json +30 -30
  3. package/src/carbins/AstroButton.ts +34 -34
  4. package/src/carbins/CTA_2025_Formentera.ts +48 -0
  5. package/src/carbins/Cabecera_2025_Barcelona.ts +34 -0
  6. package/src/carbins/Cabecera_2025_Madrid.ts +34 -0
  7. package/src/carbins/Contenido_2025_Alcorcon.ts +76 -0
  8. package/src/carbins/Contenido_2025_Granada.ts +59 -0
  9. package/src/carbins/Contenido_2025_Malaga.ts +100 -0
  10. package/src/carbins/Footer_2025_Napoles.ts +12 -0
  11. package/src/carbins/Formulario_2025_Seul.ts +56 -0
  12. package/src/carbins/GeometricShapeCard.ts +0 -0
  13. package/src/carbins/Imagen_2025_Bogota.ts +69 -0
  14. package/src/carbins/ReactButton.ts +32 -32
  15. package/src/carbins/Repetidor_2025_Cabra.ts +12 -0
  16. package/src/carbins/Repetidor_2025_Dubai.ts +48 -0
  17. package/src/carbins/Repetidor_2025_Estocolmo.ts +12 -0
  18. package/src/carbins/Repetidor_2025_Menorca.ts +75 -0
  19. package/src/carbins/Repetidor_2025_Michigan.ts +21 -0
  20. package/src/carbins/Repetidor_2025_Orcasitas.ts +34 -0
  21. package/src/carbins/Repetidor_2025_Oslo.ts +12 -0
  22. package/src/carbins/Repetidor_2025_Quito.ts +20 -0
  23. package/src/carbins/Repetidor_2025_Seatle.ts +12 -0
  24. package/src/carbins/Repetidor_2025_Tokyo.ts +48 -0
  25. package/src/carbins/Repetidor_2025_Ubeda.ts +12 -0
  26. package/src/carbins/Repetidor_2025_Yakarta.ts +12 -0
  27. package/src/carbins/Separador_2025_Reinosa.ts +12 -0
  28. package/src/carbins/TestPadre.ts +20 -0
  29. package/src/carbins/Titulo_2025_Algeciras.ts +43 -0
  30. package/src/carbins/Titulo_2025_Santorini.ts +20 -0
  31. package/src/carbins/VueButton.ts +35 -35
  32. package/src/components/Astro/Button.astro +5 -5
  33. package/src/components/Astro/CTA_2025_Formentera.astro +20 -0
  34. package/src/components/Astro/Cabecera_2025_Barcelona.astro +17 -0
  35. package/src/components/Astro/Cabecera_2025_Madrid.astro +147 -0
  36. package/src/components/Astro/Contenido_2025_Alcorcon.astro +46 -0
  37. package/src/components/Astro/Contenido_2025_Granada.astro +67 -0
  38. package/src/components/Astro/Contenido_2025_Malaga.astro +125 -0
  39. package/src/components/Astro/Footer_2025_Napoles.astro +128 -0
  40. package/src/components/Astro/Formulario_2025_Seul.astro +63 -0
  41. package/src/components/Astro/GeometricShape.astro +0 -0
  42. package/src/components/Astro/GeometricShapeCard.astro +0 -0
  43. package/src/components/Astro/Imagen_2025_Bogota.astro +43 -0
  44. package/src/components/Astro/Repetidor_2025_Cabra.astro +121 -0
  45. package/src/components/Astro/Repetidor_2025_Dubai.astro +30 -0
  46. package/src/components/Astro/Repetidor_2025_Estocolmo.astro +34 -0
  47. package/src/components/Astro/Repetidor_2025_Menorca.astro +42 -0
  48. package/src/components/Astro/Repetidor_2025_Michigan.astro +24 -0
  49. package/src/components/Astro/Repetidor_2025_Orcasitas.astro +189 -0
  50. package/src/components/Astro/Repetidor_2025_Oslo.astro +54 -0
  51. package/src/components/Astro/Repetidor_2025_Quito.astro +43 -0
  52. package/src/components/Astro/Repetidor_2025_Seatle.astro +32 -0
  53. package/src/components/Astro/Repetidor_2025_Tokyo.astro +55 -0
  54. package/src/components/Astro/Repetidor_2025_Ubeda.astro +19 -0
  55. package/src/components/Astro/Repetidor_2025_Yakarta.astro +136 -0
  56. package/src/components/Astro/Separador_2025_Reinosa.astro +4 -0
  57. package/src/components/Astro/TestHijo.astro +5 -0
  58. package/src/components/Astro/TestPadre.astro +7 -0
  59. package/src/components/Astro/Titulo_2025_Algeciras.astro +27 -0
  60. package/src/components/Astro/Titulo_2025_Santorini.astro +9 -0
  61. package/src/components/React/ReactButton.jsx +0 -0
  62. package/src/components/Vue/VueButton.vue +0 -0
  63. package/src/generated/componentRegistry.ts +86 -36
  64. package/src/index.ts +113 -61
  65. package/src/interfaces/types.ts +1 -1
  66. package/src/lib/functions.js +0 -0
@@ -0,0 +1,63 @@
1
+ ---
2
+
3
+ const {
4
+ title,
5
+ description = "",
6
+ showImage = false,
7
+ orientation = "left",
8
+ imageSrc,
9
+ lf2FormTitle = "Formulario de contacto",
10
+ } = Astro.props;
11
+
12
+ const idTargetLf2 = 'lf2-form-' + Math.random().toString(36).substring(2, 15);
13
+ ---
14
+
15
+
16
+
17
+ <div class="w-full flex flex-col md:flex-row px-6 md:px-4 lg:px-0 gap-8">
18
+ <div class="max-w-7xl w-full mx-auto flex justify-start mb-8 flex-col">
19
+ {showImage ? (
20
+ <article class="flex flex-col items-center justify-center py-6">
21
+ <div class={`flex-col md:flex ${orientation === 'left' ? 'flex-row' : 'flex-row-reverse'} w-full items-start gap-4 justify-center`}>
22
+ <div class="w-full md:w-1/3 flex justify-start mb-8 flex-col">
23
+ <div id={idTargetLf2} class="w-full flex flex-col mx-auto gap-3"></div>
24
+ </div>
25
+ <div class={`w-full md:w-1/2 p-0 md:p-4 flex items-center ${orientation === 'left' ? 'justify-end' : 'justify-start'}`}>
26
+ <img src={imageSrc} alt={title} class="w-full md:w-4/5 h-auto rounded-lg" />
27
+ </div>
28
+ </div>
29
+ </article>
30
+ ) : (
31
+ <article class="flex flex-col items-center justify-center py-6">
32
+ <div class={`flex-col md:flex ${orientation === 'left' ? 'flex-row' : 'flex-row-reverse'} w-full items-start gap-4 justify-center`}>
33
+ <div class="w-full md:w-1/3 flex justify-start mb-8 flex-col">
34
+ <p class="font-poppins text-[#262626] text-[32px] font-semibold text-left leading-[40px] mb-[16px] text-wrap md:text-nowrap">{title}</p>
35
+ <p>{description}</p>
36
+ </div>
37
+ <div class={`w-full md:w-1/2 p-0 md:p-4 flex items-center ${orientation === 'left' ? 'justify-end' : 'justify-start'}`}>
38
+ <div id={idTargetLf2} class="w-full flex flex-col mx-auto gap-3"></div>
39
+ </div>
40
+ </div>
41
+ </article>
42
+ )}
43
+ </div>
44
+ </div>
45
+
46
+
47
+ <script is:client define:vars={{ idTargetLf2 , lf2FormTitle}}>
48
+ document.addEventListener('DOMContentLoaded', () => {
49
+ let configLf2 = {
50
+ fake: true,
51
+ formulario: lf2FormTitle,
52
+ bootstrap: false,
53
+ target: '#'+idTargetLf2,
54
+ defaultparameters: {},
55
+ };
56
+ try {
57
+ apiManager.pintarFormularioAutogestionado(configLf2);
58
+ } catch (error) {
59
+ var apiManager = new LeadformApiManagerClass();
60
+ apiManager.pintarFormularioAutogestionado(configLf2);
61
+ }
62
+ });
63
+ </script>
File without changes
File without changes
@@ -0,0 +1,43 @@
1
+ ---
2
+ const {
3
+ title,
4
+ description,
5
+ txtBtn,
6
+ linkBtn,
7
+ alt,
8
+ src,
9
+ iframeSrc,
10
+ showBtn = true
11
+ } = Astro.props;
12
+
13
+ ---
14
+
15
+ <section class="w-full flex items-center justify-center">
16
+
17
+ <article class="w-full flex flex-col items-center justify-center p-6 h-full lg:h-[384px]">
18
+
19
+ <div class="max-w-7xl h-full flex justify-center items-center aspect-auto relative md:w-4/5 lg:aspect-video">
20
+ <div class="absolute inset-0">
21
+
22
+ {src && src !== "" ? (
23
+ <img src={src} alt={alt} title={title} class="object-cover object-center w-full h-full rounded-2xl">
24
+ ) : (
25
+ <video autoplay loop muted playsinline class="object-cover object-center w-full h-full rounded-2xl">
26
+ <source src={iframeSrc} type="video/mp4" />
27
+ </video>
28
+ )}
29
+ </div>
30
+
31
+ <div class="w-4/5 relative z-10 flex flex-col justify-center items-center h-full text-center p-0 py-8 md:p-6">
32
+ <h3 class="text-[#ffffff] font-poppins text-[40px] font-semibold text-center leading-[48px] mb-[32px]">{title}</h3>
33
+ <div class="text-[#ffffff] font-inter text-xl font-normal leading-[28px] mb-8 text-center" set:html={description}></div>
34
+
35
+ {showBtn ? (
36
+ <a href={linkBtn} class="text-[#ffffff] font-poppins font-semibold bg-transparent px-[28px] py-[14px] border border-[#ffffff] rounded-xl hover:bg-[#ffffff] transition-all duration-300 hover:text-[#262626] hover:border border-[#262626]">{txtBtn}</a>
37
+ ) : (
38
+ <div class="flex justify-center"></div>
39
+ )}
40
+ </div>
41
+ </div>
42
+ </article>
43
+ </section>
@@ -0,0 +1,121 @@
1
+ ---
2
+
3
+ import Repetidor_2025_Menorca from './Repetidor_2025_Menorca.astro';
4
+ import Titulo_2025_Algeciras from './Titulo_2025_Algeciras.astro';
5
+
6
+ const {
7
+ items = [],
8
+ } = Astro.props;
9
+
10
+ const identifier = 'js-megablock'+ Math.random().toString(36).substring(2, 15);
11
+
12
+ ---
13
+
14
+
15
+ <section class="w-full flex items-center justify-center">
16
+ <article class="w-full flex flex-col items-center justify-center">
17
+ <div class="w-full flex justify-center items-center relative text-[56px] text-center font-poppins font-normal leading-[64px] mt-[40px]">
18
+ <div class="flex bg-transparent md:bg-gray-50 md:border md:border-[#B6B7BB] rounded-lg">
19
+ <div class="flex gap-4 md:gap-0 items-center">
20
+ {items.map((item, index) => (
21
+ <p class="text-base">
22
+ {/* <a href={`#accordion${index + 1}`} class="btn py-[20px] px-[16px]">{item}</a> */}
23
+ <button data-linkedto={`${identifier}${index + 1}`}
24
+ class={`
25
+ btn py-[14px] px-[20px]
26
+ cursor-pointer border border-transparent
27
+ hover:border hover:border-[#5F6168]
28
+ hover:bg-white rounded-lg ${identifier}button
29
+ ${item.default ? 'active' : ''}
30
+ bg-gray-100 text-gray-100 max-w-[40px] max-h-[20px] text-[0px]
31
+ md:bg-gray-100 md:text-black md:max-w-none md:max-h-none md:text-[16px]
32
+ `}
33
+ >{item.name}</button>
34
+ </p>
35
+ ))}
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div class="lg:max-w-7xl md:w-full px-6 md:w-4/5 md:px-[0] col my-[40px]">
40
+ {items.map((item, index) => (
41
+ <div id={`${identifier}${index + 1}`} class={`${item.default ? '' : 'hidden'} collapse-arrow ${identifier}item`}>
42
+
43
+
44
+ <div class="w-full flex-col flex md:flex-row gap-[16px] md:gap-[48px]">
45
+ <div class="w-full md:w-1/2">
46
+ <Titulo_2025_Algeciras
47
+ title={item.name}
48
+ tipo="h3-mb32"
49
+ flexJustify="justify-start"
50
+ />
51
+ <Repetidor_2025_Menorca
52
+ flexOrientationIcoText = "flex-row"
53
+ flexOrientationBlockIcoText = "flex-col"
54
+ positionFlex = 'items-start'
55
+ positionBtnFlex = 'justify-start'
56
+ items = {item.items}
57
+ headingType = 'h3'
58
+ showBtn = {true}
59
+ btnLabel = "Ver experiencias de uso"
60
+ buttonUrl={item.buttonUrl}
61
+ />
62
+ </div>
63
+ <div class="w-full md:w-1/2 p-0 md:pr-2">
64
+ <img src={item.image} alt="Imagen" class="w-full h-auto rounded-xl" />
65
+ </div>
66
+ </div>
67
+
68
+ </div>
69
+ ))}
70
+ </div>
71
+ </article>
72
+ </section>
73
+
74
+
75
+
76
+ <style>
77
+ .active{
78
+ background-color: #ffffff;
79
+ border: 1px solid #5F6168;
80
+ color: black;
81
+ max-width: none;
82
+ max-height: none;
83
+ font-size: 16px;
84
+
85
+ &:hover{
86
+ background-color: #ffffff;
87
+ border: 1px solid #5F6168;
88
+ }
89
+ }
90
+ </style>
91
+
92
+ <script is:inline define:vars={{ identifier }}>
93
+
94
+ document.querySelectorAll(`.${identifier}button`).forEach(btn => {
95
+
96
+ btn.addEventListener('click', (e) => {
97
+ const linkedId = btn.getAttribute('data-linkedto');
98
+ const targetItem = document.getElementById(linkedId);
99
+ if (targetItem) {
100
+
101
+ const collapseCount = document.querySelectorAll(`.${identifier}item.collapse`).length;
102
+ const hiddenCount = document.querySelectorAll(`.${identifier}item.hidden`).length;
103
+ const desiredClass = collapseCount > hiddenCount ? 'collapse' : 'hidden';
104
+
105
+ document.querySelectorAll(`.${identifier}item`).forEach(item => {
106
+ if (item === targetItem) return;
107
+ if (item.classList.contains(desiredClass)) return;
108
+ item.classList.add(desiredClass);
109
+ });
110
+ targetItem.classList.toggle(desiredClass);
111
+
112
+
113
+ document.querySelectorAll(`.${identifier}button`).forEach(item => {
114
+ if (item === btn) return;
115
+ item.classList.remove('active');
116
+ });
117
+ btn.classList.toggle('active');
118
+ }
119
+ });
120
+ });
121
+ </script>
@@ -0,0 +1,30 @@
1
+ ---
2
+ const {
3
+ title,
4
+ description,
5
+ buttonText,
6
+ buttonUrl,
7
+ showBtn,
8
+ items
9
+ } = Astro.props;
10
+
11
+ import Repetidor_2025_Orcasitas from './Repetidor_2025_Orcasitas.astro';
12
+ ---
13
+ <article class="w-full flex flex-col text-center items-center justify-center p-12 pb-4 bg-[#ffffff] rounded-2xl">
14
+ <h2 class="text-[2.625em] leading-[47px] mb-[23px] text-[#262626] font-semibold not-italic">{title}</h2>
15
+ <div class="max-w-[900px] text-[#363942] font-inter font-normal text-[1.125em] not-italic leading-[28px] flex flex-col gap-4 mb-8">
16
+ <p set:html={description}></p>
17
+ </div>
18
+ <div class="max-w-7xl flex-wrap md:flex-nowrap w-full flex items-center ">
19
+ <Repetidor_2025_Orcasitas items={items} />
20
+ </div>
21
+ <div class="w-full flex justify-center">
22
+ {showBtn ? (
23
+ <div class="flex justify-center">
24
+ <a href={buttonUrl} class="px-5 py-3 font-inter font-semibold text-base border-1 border-[#2134F1] text-[#2134F1] hover:text-[#262626] hover:border-[#262626] transition-all duration-300 rounded-lg cursor-pointer shadow-sm">{buttonText}</a>
25
+ </div>
26
+ ) : (
27
+ <div class="flex justify-center"></div>
28
+ )}
29
+ </div>
30
+ </article>
@@ -0,0 +1,34 @@
1
+ ---
2
+ const {
3
+ items,
4
+ } = Astro.props;
5
+
6
+ import Titulo_2025_Santorini from './Titulo_2025_Santorini.astro';
7
+
8
+ ---
9
+ <div class="w-full flex flex-row flex-wrap items-center justify-center mb-4">
10
+ <div class="max-w-7xl flex flex-col md:flex-row flex-nowrap items-stretch justify-center mb-0">
11
+ {items.map(item => (
12
+ <a href={item.link} class="w-full flex flex-col cursor-pointer">
13
+ <article class="w-full p-[12px] h-full">
14
+ <div class="w-full h-full flex flex-col rounded-lg border border-gray-200 hover:items-center shadow-sm hover:bg-gradient-to-r from-[#001978] via-[#2134F1] to-[#F81BBD] transition-all duration-300">
15
+ <div class="bg-white hover:h-[calc(100%-12px)] hover:w-[calc(100%-1px)] mt-[1px] rounded-tl-[7px] rounded-tr-[7px]">
16
+ <div class="w-full">
17
+ <img class="cursor-pointer rounded-tr-lg rounded-tl-lg mx-auto h-full" src={item.image} alt={item.altImage} />
18
+ </div>
19
+ <div class="p-6 flex-grow flex flex-col">
20
+ <Titulo_2025_Santorini description={item.tag} />
21
+ <div class="mt-2 flex items-center gap-2 flex-grow">
22
+ <div class="flex flex-col text-[#262626] h-full">
23
+ <p class="text-lg font-semibold leading-tight mb-[8px]">{item.title}</p>
24
+ <p class="text-base font-normal leading-tight mb-[8px]">{item.description}</p>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </article>
31
+ </a>
32
+ ))}
33
+ </div>
34
+ </div>
@@ -0,0 +1,42 @@
1
+ ---
2
+ import Contenido_2025_Granada from "./Contenido_2025_Granada.astro";
3
+ import CTA_2025_Formentera from "./CTA_2025_Formentera.astro";
4
+
5
+
6
+ const {
7
+ flexOrientationBlockIcoText = "flex-row",
8
+ flexOrientationIcoText = "flex-row",
9
+ positionFlex = "items-center",
10
+ positionBtnFlex = "justify-center",
11
+ headingType = 'h3',
12
+ items = [],
13
+ btnLabel = "Ver más",
14
+ buttonUrl = "#",
15
+ showBtn = false,
16
+ } = Astro.props;
17
+
18
+ ---
19
+
20
+ <article class={`${positionFlex === 'items-center' ? 'items-center' : 'items-start'} flex flex-col justify-center mb-4`}>
21
+ <div class={`flex ${flexOrientationBlockIcoText} items-start flex-wrap px-6`}>
22
+ {items.map(item => (
23
+ <Contenido_2025_Granada
24
+ title={item.title}
25
+ tipo={headingType}
26
+ description={item.description}
27
+ flexOrientationBlock={flexOrientationBlockIcoText}
28
+ flexOrientationIcoText={flexOrientationIcoText}
29
+ positionFlex={positionFlex}
30
+ icon={item.icon}
31
+ />
32
+ ))}
33
+ </div>
34
+ <div class={`${positionBtnFlex === 'justify-center' ? 'justify-center' : 'justify-start'} pl-0 md:pl-[16px] lg:pl-[32px] w-full flex`}>
35
+ {showBtn ? (
36
+ <CTA_2025_Formentera buttonText={btnLabel} buttonUrl={buttonUrl} />
37
+ ) : (
38
+ <div class="flex justify-center"></div>
39
+ )}
40
+
41
+ </div>
42
+ </article>
@@ -0,0 +1,24 @@
1
+ ---
2
+ const {
3
+ orientation = 'left',
4
+ items
5
+ } = Astro.props;
6
+ ---
7
+ <section class="w-full flex flex-col items-center justify-center">
8
+ {items.map(item => (
9
+ <article class="w-full flex flex-col items-center justify-center border-b-1 border-b-[#B6B7BB]" style={items.indexOf(item) === items.length - 1 ? 'border-bottom: none;' : ''} >
10
+ <div class={`flex-col flex md:${orientation === 'left' ? 'flex-row' : 'flex-row-reverse'} items-center gap-4`}>
11
+ <div class="w-full md:w-1/2 p-4 flex flex-col flex-wrap ">
12
+ <h2 class="text-[32px] leading-[40px] mb-[24px] text-[#363942] font-poppins font-semibold">{item.title}</h2>
13
+ <div
14
+ class="text-[#363942] font-inter font-normal text-base leading-[28px] flex flex-col gap-4 mb-8"
15
+ set:html={item.description}
16
+ />
17
+ </div>
18
+ <div class={`w-full md:w-1/2 p-4 flex items-center ${orientation === 'left' ? 'justify-end' : 'justify-start'}`}>
19
+ <img src={item.image} alt={item.title} class="w-full md:w-1/2 rounded" />
20
+ </div>
21
+ </div>
22
+ </article>
23
+ ))}
24
+ </section>
@@ -0,0 +1,189 @@
1
+ ---
2
+ const {
3
+ loadScript = true,
4
+ items,
5
+ slidesToShow = 5,
6
+ slidesToScroll = 1,
7
+ } = Astro.props;
8
+
9
+ const carouselId = "glider-carousel-"+Math.floor(Math.random()*1000);
10
+ const buttonsId = "glider-carousel-buttons-"+Math.floor(Math.random()*1000);
11
+ const prevId = "glider-carousel-prev-"+Math.floor(Math.random()*1000);
12
+ const nextId = "glider-carousel-next-"+Math.floor(Math.random()*1000);
13
+
14
+ const randomId = Math.floor(Math.random() * 1000);
15
+
16
+ ---
17
+
18
+ {loadScript &&
19
+ <div>
20
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.css"/>
21
+ <script src="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.js"></script>
22
+ </div>
23
+ }
24
+
25
+ <div class="w-full">
26
+ <div id={carouselId} class="glider w-full">
27
+ {items.map((item, idx) => (
28
+ <div class="p-10 bg-white" key={idx}>
29
+ {item.iframeSrc ? (
30
+ <div class="w-full">
31
+ <span class={`popup-iframe-trigger-${randomId} cursor-pointer`} data-iframesrc={item.iframeSrc}>
32
+ <img src={item.imageSrc} class="w-full h-full rounded-xl p-2 transition-transform hover:scale-105 cursor-pointer"/>
33
+ </span>
34
+ </div>
35
+ <div class="p-6 flex-grow flex flex-col">
36
+ <div class="mt-2 flex items-center gap-2 flex-grow">
37
+ <div class="flex flex-col text-[#262626] h-full">
38
+ <p class="text-base font-inter font-normal leading-[24px] mb-[24px]">{item.description}</p>
39
+ <p class="text-[14px] font-semibold leading-[20px]">{item.author}<br />{item.positionCompany}</p>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ ) : (
44
+ <img src={item.image} alt={item.altImage} />
45
+ <p>{item.descriptionImage}</p>
46
+ )}
47
+ </div>
48
+ ))}
49
+ </div>
50
+ <div id={buttonsId} class="carouselGlider hidden md:flex"></div>
51
+ </div>
52
+
53
+ <div id={"popup-iframe-modal-" + randomId } class="fixed w-full h-full top-0 left-0 z-9999 hidden">
54
+ <div class="flex flex-col justify-center items-center w-full h-full bg-blue-100/90 p-4">
55
+ <div class="w-full flex justify-end">
56
+ <button class="js-close-popup w-auto m-4 p-2 bg-white rounded transition-transform hover:scale-125 cursor-pointer">❌</button>
57
+ </div>
58
+ <div class="w-full h-full flex items-center justify-center">
59
+ <iframe
60
+ class="rounded-xl shadow-lg max-w-3/4 aspect-video"
61
+ src=""
62
+ frameborder="0"
63
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
64
+ allowfullscreen=""></iframe>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <script is:inline define:vars={{ randomId }}>
70
+
71
+ const iframePopup = document.getElementById(`popup-iframe-modal-${randomId}`);
72
+ document.querySelectorAll(`.popup-iframe-trigger-${randomId}`).forEach(btn => {
73
+ btn.addEventListener('click', (e) => {
74
+ const iframeSrc = btn.getAttribute('data-iframesrc');
75
+ iframePopup.classList.remove('hidden');
76
+ iframePopup.querySelector('iframe').setAttribute('src', iframeSrc);
77
+ });
78
+ });
79
+
80
+ iframePopup.querySelector('.js-close-popup').addEventListener('click', () => {
81
+ iframePopup.classList.add('hidden');
82
+ iframePopup.querySelector('iframe').setAttribute('src', '');
83
+ });
84
+
85
+ </script>
86
+
87
+
88
+ <script is:inline define:vars={{carouselId, buttonsId, prevId, nextId, slidesToShow, slidesToScroll}}>
89
+ document.addEventListener('DOMContentLoaded', function() {
90
+
91
+ new Glider(document.querySelector('#' + carouselId), {
92
+
93
+ // `auto` allows automatic responsive
94
+ // width calculations
95
+ slidesToShow: slidesToShow,
96
+ slidesToScroll: '1',
97
+
98
+ // should have been named `itemMinWidth`
99
+ // slides grow to fit the container viewport
100
+ // ignored unless `slidesToShow` is set to `auto`
101
+ itemWidth: undefined,
102
+
103
+ // if true, slides wont be resized to fit viewport
104
+ // requires `itemWidth` to be set
105
+ // * this may cause fractional slides
106
+ exactWidth: false,
107
+
108
+ // speed aggravator - higher is slower
109
+ duration: .5,
110
+
111
+ // dot container element or selector
112
+ dots: '#' + buttonsId,
113
+
114
+ // arrow container elements or selector
115
+ arrows: {
116
+ prev: '#' + prevId,
117
+ // may also pass element directly
118
+ next: '#' + nextId
119
+ },
120
+
121
+ // allow mouse dragging
122
+ draggable: true,
123
+ // how much to scroll with each mouse delta
124
+ dragVelocity: 3.3,
125
+
126
+ // use any custom easing function
127
+ // compatible with most easing plugins
128
+ easing: function (x, t, b, c, d) {
129
+ return c*(t/=d)*t + b;
130
+ },
131
+
132
+ // event control
133
+ scrollPropagate: false,
134
+ eventPropagate: true,
135
+
136
+ // Force centering slide after scroll event
137
+ scrollLock: false,
138
+ // how long to wait after scroll event before locking
139
+ // if too low, it might interrupt normal scrolling
140
+ scrollLockDelay: 150,
141
+
142
+ // Force centering slide after resize event
143
+ resizeLock: true,
144
+
145
+ // Glider.js breakpoints are mobile-first
146
+ responsive: [
147
+ {
148
+ breakpoint: 1400,
149
+ settings: {
150
+ slidesToShow: slidesToShow,
151
+ slidesToScroll: 1
152
+ }
153
+ },
154
+ {
155
+ breakpoint: 1200,
156
+ settings: {
157
+ slidesToShow: (slidesToShow >= 5)? slidesToShow - 1 : slidesToShow,
158
+ slidesToScroll: 1
159
+ }
160
+ },
161
+ {
162
+ breakpoint: 900,
163
+ settings: {
164
+ slidesToShow: 3,
165
+ slidesToScroll: 1
166
+ }
167
+ },
168
+ {
169
+ breakpoint: 767,
170
+ settings: {
171
+ slidesToShow: 3,
172
+ slidesToScroll: 3
173
+ }
174
+ },
175
+ {
176
+ breakpoint: 575,
177
+ settings: {
178
+ slidesToShow: 1,
179
+ slidesToScroll: 1
180
+ }
181
+ }
182
+ ]
183
+ });
184
+
185
+ });
186
+ </script>
187
+
188
+
189
+
@@ -0,0 +1,54 @@
1
+ ---
2
+ const {
3
+ items
4
+ } = Astro.props;
5
+
6
+ const randomId = Math.floor(Math.random() * 1000);
7
+
8
+ ---
9
+ <div class="max-w-7xl w-full flex flex-row flex-wrap items-center justify-center">
10
+ <div class="w-full flex flex-row flex-wrap items-center justify-center">
11
+ {items.map(item => (
12
+ <article class="w-full md:w-1/3 h-full aspect-video relative">
13
+ <span class={`popup-iframe-trigger-${randomId} cursor-pointer`} data-iframesrc={item.iframeSrc}>
14
+ <img src={item.imageSrc} class="w-full h-full rounded-xl p-2 transition-transform hover:scale-105 cursor-pointer"/>
15
+ </span>
16
+ </article>
17
+ ))}
18
+ </div>
19
+ </div>
20
+
21
+ <div id={"popup-iframe-modal-" + randomId } class="fixed w-full h-full top-0 left-0 z-9999 hidden">
22
+ <div class="flex flex-col justify-center items-center w-full h-full bg-blue-100/90 p-4">
23
+ <div class="w-full flex justify-end">
24
+ <button class="js-close-popup w-auto m-4 p-2 bg-white rounded transition-transform hover:scale-125 cursor-pointer">❌</button>
25
+ </div>
26
+ <div class="w-full h-full flex items-center justify-center">
27
+ <iframe
28
+ class="rounded-xl shadow-lg max-w-3/4 aspect-video"
29
+ src=""
30
+ frameborder="0"
31
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
32
+ allowfullscreen=""></iframe>
33
+ </div>
34
+ </div>
35
+ </div>
36
+
37
+
38
+ <script is:inline define:vars={{ randomId }}>
39
+
40
+ const iframePopup = document.getElementById(`popup-iframe-modal-${randomId}`);
41
+ document.querySelectorAll(`.popup-iframe-trigger-${randomId}`).forEach(btn => {
42
+ btn.addEventListener('click', (e) => {
43
+ const iframeSrc = btn.getAttribute('data-iframesrc');
44
+ iframePopup.classList.remove('hidden');
45
+ iframePopup.querySelector('iframe').setAttribute('src', iframeSrc);
46
+ });
47
+ });
48
+
49
+ iframePopup.querySelector('.js-close-popup').addEventListener('click', () => {
50
+ iframePopup.classList.add('hidden');
51
+ iframePopup.querySelector('iframe').setAttribute('src', '');
52
+ });
53
+
54
+ </script>