Compare commits
No commits in common. "99c6494fb2c555cdd6d8c899381b064b80bc51c8" and "b794e64f3c0d221898a20ad621434d8f13223123" have entirely different histories.
99c6494fb2
...
b794e64f3c
11
package-lock.json
generated
11
package-lock.json
generated
@ -30,7 +30,6 @@
|
|||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"escape-goat": "^4.0.0",
|
"escape-goat": "^4.0.0",
|
||||||
"get-port": "^7.0.0",
|
"get-port": "^7.0.0",
|
||||||
"glightbox": "^3.3.1",
|
|
||||||
"glob": "^11.0.3",
|
"glob": "^11.0.3",
|
||||||
"js-convert-case": "^4.2.0",
|
"js-convert-case": "^4.2.0",
|
||||||
"koa-mount": "^4.2.0",
|
"koa-mount": "^4.2.0",
|
||||||
@ -6065,11 +6064,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
||||||
},
|
},
|
||||||
"node_modules/glightbox": {
|
|
||||||
"version": "3.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/glightbox/-/glightbox-3.3.1.tgz",
|
|
||||||
"integrity": "sha512-nXoKfJRnQTDaAFAw5799hjpfAAHx5aLvOLG0SIGudeMCwtHgO3P2/avNYapJ+SL4UEZxO2YNBPtq6pzMhSx42g=="
|
|
||||||
},
|
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "11.0.3",
|
"version": "11.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
||||||
@ -19521,11 +19515,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||||
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
"integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
|
||||||
},
|
},
|
||||||
"glightbox": {
|
|
||||||
"version": "3.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/glightbox/-/glightbox-3.3.1.tgz",
|
|
||||||
"integrity": "sha512-nXoKfJRnQTDaAFAw5799hjpfAAHx5aLvOLG0SIGudeMCwtHgO3P2/avNYapJ+SL4UEZxO2YNBPtq6pzMhSx42g=="
|
|
||||||
},
|
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "11.0.3",
|
"version": "11.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz",
|
||||||
|
|||||||
@ -82,10 +82,6 @@
|
|||||||
{
|
{
|
||||||
"from": "node_modules/@sealcode/sealcodemirror/mode/javascript/javascript.js",
|
"from": "node_modules/@sealcode/sealcodemirror/mode/javascript/javascript.js",
|
||||||
"to": "dist/codemirror-javascript-mode.js"
|
"to": "dist/codemirror-javascript-mode.js"
|
||||||
},
|
|
||||||
{
|
|
||||||
"from": "node_modules/glightbox/dist",
|
|
||||||
"to": "dist/glightbox"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -113,7 +109,6 @@
|
|||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"escape-goat": "^4.0.0",
|
"escape-goat": "^4.0.0",
|
||||||
"get-port": "^7.0.0",
|
"get-port": "^7.0.0",
|
||||||
"glightbox": "^3.3.1",
|
|
||||||
"glob": "^11.0.3",
|
"glob": "^11.0.3",
|
||||||
"js-convert-case": "^4.2.0",
|
"js-convert-case": "^4.2.0",
|
||||||
"koa-mount": "^4.2.0",
|
"koa-mount": "^4.2.0",
|
||||||
|
|||||||
@ -75,7 +75,7 @@ export default class TheApp extends App {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
manifest = {
|
manifest = {
|
||||||
name: "Strona Czynna — nieformalna grupa aktywistyczna",
|
name: "Strona Czynna",
|
||||||
logo: locreq.resolve("assets/logotyp.svg"),
|
logo: locreq.resolve("assets/logotyp.svg"),
|
||||||
version: "0.0.1",
|
version: "0.0.1",
|
||||||
default_language: "en",
|
default_language: "en",
|
||||||
|
|||||||
@ -69,13 +69,6 @@
|
|||||||
max-width: 100cqw;
|
max-width: 100cqw;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
& > span {
|
|
||||||
display: grid;
|
|
||||||
max-height: min(75vh, 700px);
|
|
||||||
grid-template-rows: 1fr min-content;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&,
|
&,
|
||||||
picture,
|
picture,
|
||||||
img {
|
img {
|
||||||
@ -87,45 +80,6 @@
|
|||||||
); /* at just 100cqw it breaks the scroller when the images are very horizontal */
|
); /* at just 100cqw it breaks the scroller when the images are very horizontal */
|
||||||
}
|
}
|
||||||
|
|
||||||
.caption {
|
|
||||||
font-style: italic;
|
|
||||||
text-align: justify;
|
|
||||||
grid-row: 2/3;
|
|
||||||
grid-column: 1/2;
|
|
||||||
z-index: 1;
|
|
||||||
padding: 8px;
|
|
||||||
background-color: color-mix(
|
|
||||||
in srgb,
|
|
||||||
var(--color-brand-text-bg) 70%,
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
backdrop-filter: blur(5px);
|
|
||||||
will-change: backdrop-filter background-color;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: color-mix(
|
|
||||||
in srgb,
|
|
||||||
var(--color-brand-text-bg) 90%,
|
|
||||||
transparent
|
|
||||||
);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-wrapper {
|
|
||||||
grid-row: 1/3;
|
|
||||||
grid-column: 1/2;
|
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:has(picture:hover) + .caption:not(:hover) {
|
|
||||||
opacity: 0.1;
|
|
||||||
}
|
|
||||||
|
|
||||||
picture {
|
picture {
|
||||||
height: auto;
|
height: auto;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
@ -133,4 +87,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -7,15 +7,13 @@ import type {
|
|||||||
} from "@sealcode/jdd";
|
} from "@sealcode/jdd";
|
||||||
import { Component, ComponentArguments, insert_nbsp } from "@sealcode/jdd";
|
import { Component, ComponentArguments, insert_nbsp } from "@sealcode/jdd";
|
||||||
import { horizontalScroller } from "../../routes/common/horizontal-scroller/horizontal-scroller.js";
|
import { horizontalScroller } from "../../routes/common/horizontal-scroller/horizontal-scroller.js";
|
||||||
import { htmlEscape } from "escape-goat";
|
|
||||||
|
|
||||||
const component_arguments = {
|
const component_arguments = {
|
||||||
title: new ComponentArguments.ShortText(),
|
title: new ComponentArguments.ShortText(),
|
||||||
images: new ComponentArguments.List(
|
images: new ComponentArguments.List(
|
||||||
new ComponentArguments.Structured({
|
new ComponentArguments.Structured({
|
||||||
image: new ComponentArguments.Image(),
|
image: new ComponentArguments.Image(),
|
||||||
alt: new ComponentArguments.ShortText().setExampleValues([""]),
|
alt: new ComponentArguments.ShortText(),
|
||||||
caption: new ComponentArguments.ShortText().setExampleValues([""]),
|
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
} as const;
|
} as const;
|
||||||
@ -42,33 +40,15 @@ export class HorizontalGallery extends Component<typeof component_arguments> {
|
|||||||
<div
|
<div
|
||||||
class={["horizontal-gallery", ...classes]}
|
class={["horizontal-gallery", ...classes]}
|
||||||
style={`--jdd-index: ${index}`}
|
style={`--jdd-index: ${index}`}
|
||||||
data-controller="glightbox"
|
|
||||||
>
|
>
|
||||||
{horizontalScroller({
|
{horizontalScroller({
|
||||||
elements: (images || []).map((image) => (
|
elements: (images || []).map((image) =>
|
||||||
<>
|
render_image(image.image, {
|
||||||
<div
|
|
||||||
class="image-wrapper"
|
|
||||||
data-glightbox-target="pictureWrapper"
|
|
||||||
data-glightbox-caption={htmlEscape(image.caption)}
|
|
||||||
>
|
|
||||||
{render_image(image.image, {
|
|
||||||
sizesAttr: "100vw",
|
sizesAttr: "100vw",
|
||||||
container: {
|
container: { width: 800, height: 500, objectFit: "contain" },
|
||||||
width: 800,
|
|
||||||
height: 500,
|
|
||||||
objectFit: "contain",
|
|
||||||
},
|
|
||||||
alt: image.alt,
|
alt: image.alt,
|
||||||
})}
|
})
|
||||||
</div>
|
),
|
||||||
{image.caption.trim() ? (
|
|
||||||
<div class="caption">{image.caption}</div>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)),
|
|
||||||
render: async ({ scroller, markers }) => (
|
render: async ({ scroller, markers }) => (
|
||||||
<div>
|
<div>
|
||||||
<div class="horizontal-gallery__top-bar">
|
<div class="horizontal-gallery__top-bar">
|
||||||
|
|||||||
@ -16,9 +16,6 @@ application.register("map-with-pins", MapWithPins);
|
|||||||
import { default as HorizontalScroller } from "./../back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.js";
|
import { default as HorizontalScroller } from "./../back/routes/common/horizontal-scroller/horizontal-scroller.stimulus.js";
|
||||||
application.register("horizontal-scroller", HorizontalScroller);
|
application.register("horizontal-scroller", HorizontalScroller);
|
||||||
|
|
||||||
import { default as Glightbox } from "./controllers/glightbox.stimulus.js";
|
|
||||||
application.register("glightbox", Glightbox);
|
|
||||||
|
|
||||||
import { default as AutogrowTextarea } from "./../../node_modules/@sealcode/jdd-editor/src/controllers/autogrow-textarea.stimulus.js";
|
import { default as AutogrowTextarea } from "./../../node_modules/@sealcode/jdd-editor/src/controllers/autogrow-textarea.stimulus.js";
|
||||||
application.register("autogrow-textarea", AutogrowTextarea);
|
application.register("autogrow-textarea", AutogrowTextarea);
|
||||||
|
|
||||||
|
|||||||
@ -1,55 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any */
|
|
||||||
/* ^ necessary until https://github.com/biati-digital/glightbox/pull/577 waits for merge */
|
|
||||||
import { Controller } from "stimulus";
|
|
||||||
import { addCSS, addJS } from "@sealcode/add-to-head";
|
|
||||||
import type { default as GL } from "glightbox";
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
GLightbox: typeof GL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const settings = { touchNavigation: true };
|
|
||||||
|
|
||||||
export default class GlightboxController extends Controller {
|
|
||||||
static targets = ["pictureWrapper"];
|
|
||||||
|
|
||||||
id: string;
|
|
||||||
gallery: ReturnType<typeof GL>;
|
|
||||||
declare pictureWrapperTargets: HTMLDivElement[];
|
|
||||||
|
|
||||||
async connect() {
|
|
||||||
await this.initGallery();
|
|
||||||
}
|
|
||||||
|
|
||||||
async initGallery() {
|
|
||||||
await Promise.all([
|
|
||||||
addJS("/dist/glightbox/js/glightbox.min.js"),
|
|
||||||
addCSS("/dist/glightbox/css/glightbox.min.css"),
|
|
||||||
]);
|
|
||||||
this.gallery?.destroy();
|
|
||||||
this.gallery = window.GLightbox({
|
|
||||||
elements: this.pictureWrapperTargets.map((e) => {
|
|
||||||
const img = e.querySelector("img");
|
|
||||||
return {
|
|
||||||
type: "image",
|
|
||||||
href: img.getAttribute("src"),
|
|
||||||
description: e.getAttribute("data-glightbox-caption"),
|
|
||||||
alt: img.getAttribute("alt") || "",
|
|
||||||
};
|
|
||||||
}) as any,
|
|
||||||
...settings,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.pictureWrapperTargets.map((e, index) => {
|
|
||||||
e.addEventListener("click", () => {
|
|
||||||
this.gallery.openAt(index);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async pictureWrapperTargetConnected() {
|
|
||||||
await this.initGallery();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,8 +6,7 @@
|
|||||||
"lib": ["dom", "es2021"],
|
"lib": ["dom", "es2021"],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true
|
||||||
"allowSyntheticDefaultImports": true
|
|
||||||
},
|
},
|
||||||
"include": ["./src/front", "./src/**/*.stimulus.ts"]
|
"include": ["./src/front", "./src/**/*.stimulus.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user