@inizioevoke/astro-core 1.0.0
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.
- package/package.json +31 -0
- package/src/components/Modal/Modal.astro +36 -0
- package/src/components/Modal/Modal.css +145 -0
- package/src/components/Modal/Modal.ts +109 -0
- package/src/components/Modal/ModalOverlay.astro +1 -0
- package/src/components/Modal/ModalTrigger.astro +29 -0
- package/src/components/PdfViewer/PdfViewer.astro +103 -0
- package/src/components/PdfViewer/PdfViewer.css +198 -0
- package/src/components/PdfViewer/PdfViewer.ts +183 -0
- package/src/components/PdfViewer/pdf.min.mjs +28 -0
- package/src/components/PdfViewer/pdf.mjs +26465 -0
- package/src/components/PdfViewer/pdf.mjs.map +1 -0
- package/src/components/PdfViewer/pdf.worker.min.mjs +28 -0
- package/src/components/PdfViewer/pdf.worker.mjs +63057 -0
- package/src/components/PdfViewer/pdf.worker.mjs.map +1 -0
- package/src/components/ScrollContainer/ScrollContainer.astro +55 -0
- package/src/components/ScrollContainer/ScrollContainer.css +64 -0
- package/src/components/ScrollContainer/ScrollContainer.ts +143 -0
- package/src/components/Tabs/TabItem.astro +24 -0
- package/src/components/Tabs/Tabs.astro +94 -0
- package/src/components/Tabs/Tabs.css +70 -0
- package/src/components/Tabs/Tabs.ts +22 -0
- package/src/components/Zoom/Zoom.astro +64 -0
- package/src/components/Zoom/ZoomContent.astro +0 -0
- package/src/components/Zoom/ZoomModal.astro +0 -0
- package/src/components/index.ts +8 -0
- package/src/integrations/index.ts +2 -0
- package/src/integrations/prune-build.ts +71 -0
- package/src/integrations/relative-links.ts +178 -0
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inizioevoke/astro-core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./index.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./components": "./src/components/index.ts",
|
|
11
|
+
"./integrations": "./src/integrations/index.ts"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"index.ts"
|
|
16
|
+
],
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"astro": ">=6.0.0",
|
|
19
|
+
"typescript": ">=5.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@astrojs/check": "^0.9.8",
|
|
23
|
+
"@astrojs/ts-plugin": "^1.10.7",
|
|
24
|
+
"@types/node": "^25.5.0",
|
|
25
|
+
"astro": "^6.0.5",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"pdfjs-dist": "^5.5.207"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import './Modal.css';
|
|
4
|
+
|
|
5
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
6
|
+
id: string;
|
|
7
|
+
closeButton?: boolean;
|
|
8
|
+
closeButtonAtts?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
id,
|
|
13
|
+
closeButton = true,
|
|
14
|
+
closeButtonAtts,
|
|
15
|
+
...rest
|
|
16
|
+
} = Astro.props;
|
|
17
|
+
|
|
18
|
+
const attrs = {...rest};
|
|
19
|
+
const cssClass = attrs['class'] ?? '';
|
|
20
|
+
|
|
21
|
+
['class'].forEach((a) => {
|
|
22
|
+
delete attrs[a as keyof typeof attrs];
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
<div id={id} class:list={['evo-modal', cssClass]} {...attrs}>
|
|
27
|
+
{closeButton && <button class="evo-modal-close evo-modal-action-hide" {...closeButtonAtts}><span class="evo-modal-x"><slot name="close">X</slot></span></button>}
|
|
28
|
+
<slot name="outer" />
|
|
29
|
+
<div class="evo-modal-wrapper">
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import './Modal';
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
|
|
2
|
+
@layer inizioevoke-astro-components {
|
|
3
|
+
:root {
|
|
4
|
+
--evo-modal-viewport-width: 100vw;
|
|
5
|
+
--evo-modal-viewport-height: 100vh;
|
|
6
|
+
--evo-modal-position: absolute;
|
|
7
|
+
--evo-modal-width: 800px;
|
|
8
|
+
--evo-modal-height: 450px;
|
|
9
|
+
--evo-modal-animation-duration: 300ms;
|
|
10
|
+
--evo-modal-z-index: 99;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.evo-modal-overlay {
|
|
14
|
+
position: fixed;
|
|
15
|
+
left: 0;
|
|
16
|
+
top: 0;
|
|
17
|
+
display: none;
|
|
18
|
+
opacity: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
background-color: rgba(0,0,0,0.66);
|
|
22
|
+
z-index: calc(var(--evo-modal-z-index) - 1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.evo-modal {
|
|
26
|
+
position: var(--evo-modal-position);
|
|
27
|
+
left: calc((var(--evo-modal-viewport-width) - var(--evo-modal-width)) / 2);
|
|
28
|
+
top: calc((var(--evo-modal-viewport-height) - var(--evo-modal-height)) / 2);
|
|
29
|
+
width: var(--evo-modal-width);
|
|
30
|
+
height: var(--evo-modal-height);
|
|
31
|
+
display: none;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
opacity: 0;
|
|
35
|
+
color: #000000;
|
|
36
|
+
background-color: #ffffff;
|
|
37
|
+
z-index: var(--evo-modal-z-index);
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
|
|
40
|
+
.evo-modal-close {
|
|
41
|
+
/* the button click area is larger than the visible button */
|
|
42
|
+
position: absolute;
|
|
43
|
+
right: 0px;
|
|
44
|
+
top: 0px;
|
|
45
|
+
width: 40px;
|
|
46
|
+
height: 40px;
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
border: none;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
z-index: var(--evo-modal-z-index);
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
|
|
53
|
+
.evo-modal-x {
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: 8px;
|
|
56
|
+
top: 8px;
|
|
57
|
+
display: block;
|
|
58
|
+
width: 24px;
|
|
59
|
+
height: 24px;
|
|
60
|
+
background-color: #990000;
|
|
61
|
+
border: none;
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
text-align: left;
|
|
64
|
+
text-indent: -9999px;
|
|
65
|
+
transform: rotate(45deg);
|
|
66
|
+
|
|
67
|
+
&::before,
|
|
68
|
+
&::after {
|
|
69
|
+
content: "";
|
|
70
|
+
position: absolute;
|
|
71
|
+
background-color: #ffffff;
|
|
72
|
+
}
|
|
73
|
+
&::before {
|
|
74
|
+
left: 5px;
|
|
75
|
+
top: 11px;
|
|
76
|
+
width: 14px;
|
|
77
|
+
height: 2px;
|
|
78
|
+
}
|
|
79
|
+
&::after {
|
|
80
|
+
left: 11px;
|
|
81
|
+
top: 5px;
|
|
82
|
+
width: 2px;
|
|
83
|
+
height: 14px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.evo-modal-wrapper {
|
|
89
|
+
position: relative;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
padding: 1rem;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
|
|
96
|
+
h1,h2,h3 {
|
|
97
|
+
&:first-child {
|
|
98
|
+
margin-top: 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.evo-modal-hide-none {
|
|
105
|
+
display: none;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
.evo-modal-hide-fade {
|
|
109
|
+
display: block;
|
|
110
|
+
opacity: 0;
|
|
111
|
+
animation-name: evo_modal_hide;
|
|
112
|
+
animation-duration: var(--evo-modal-animation-duration);
|
|
113
|
+
animation-iteration-count: 1;
|
|
114
|
+
animation-timing-function: linear;
|
|
115
|
+
}
|
|
116
|
+
.evo-modal-show-none {
|
|
117
|
+
display: block;
|
|
118
|
+
opacity: 1;
|
|
119
|
+
}
|
|
120
|
+
.evo-modal-show-fade {
|
|
121
|
+
display: block;
|
|
122
|
+
opacity: 1;
|
|
123
|
+
animation-name: evo_modal_show;
|
|
124
|
+
animation-duration: var(--evo-modal-animation-duration);
|
|
125
|
+
animation-iteration-count: 1;
|
|
126
|
+
animation-timing-function: linear;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@keyframes evo_modal_show {
|
|
130
|
+
0% {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
}
|
|
133
|
+
100% {
|
|
134
|
+
opacity: 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
@keyframes evo_modal_hide {
|
|
138
|
+
0% {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
100% {
|
|
142
|
+
opacity: 0;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
export type ModalAnimation = 'none' | 'fade';
|
|
3
|
+
|
|
4
|
+
interface ModalOptions {
|
|
5
|
+
animation?: ModalAnimation;
|
|
6
|
+
}
|
|
7
|
+
export function show(selector: string | HTMLElement, { animation = 'fade' }: ModalOptions = {}) {
|
|
8
|
+
return new Promise<void>(async (resolve) => {
|
|
9
|
+
let modal = typeof selector == 'string' ? document.querySelector<HTMLElement>(/^[\.#]/.test(selector) ? selector : `#${selector}`) : selector;
|
|
10
|
+
if (modal) {
|
|
11
|
+
await hide(null, { animation, hideOverlay: false });
|
|
12
|
+
__showOverlay(animation);
|
|
13
|
+
|
|
14
|
+
modal.classList.add('evo-modal-visible', `evo-modal-show-${animation}`);
|
|
15
|
+
setTimeout(resolve, animation !== 'none' ? animationDuration : 0);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function __showOverlay(animation: ModalAnimation) {
|
|
20
|
+
if (!overlay.classList.contains('evo-modal-visible')) {
|
|
21
|
+
overlay.setAttribute('data-evo-modal-animation', animation);
|
|
22
|
+
overlay.classList.add('evo-modal-visible', `evo-modal-show-${animation}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface HideModalOptions extends ModalOptions {
|
|
27
|
+
hideOverlay?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export function hide(selector?: string | HTMLElement | (string | HTMLElement)[] | null, { animation, hideOverlay = true }: HideModalOptions = {}) {
|
|
30
|
+
return new Promise<void>(async (resolve) => {
|
|
31
|
+
const modals: HTMLElement[] = (selector ? Array.isArray(selector) ? selector : [selector] : [...document.querySelectorAll<HTMLElement>('.evo-modal.evo-modal-visible')])
|
|
32
|
+
.map((m) => {
|
|
33
|
+
return typeof m == 'string' ? document.querySelector<HTMLElement>(/^[\.#]/.test(m) ? m : `#${m}`) : m;
|
|
34
|
+
})
|
|
35
|
+
.filter(m => m !== undefined && m !== null);
|
|
36
|
+
|
|
37
|
+
const hides = [];
|
|
38
|
+
if (!animation) {
|
|
39
|
+
if (modals.length) {
|
|
40
|
+
animation = ([...modals[0].classList.values()].find((c) => { return c.startsWith('evo-modal-show'); }) ?? 'evo-modal-show-fade').substring(15) as ModalAnimation;
|
|
41
|
+
} else {
|
|
42
|
+
animation = 'fade';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (let modal of modals) {
|
|
46
|
+
hides.push(__hide(modal, animation));
|
|
47
|
+
}
|
|
48
|
+
if (hideOverlay) {
|
|
49
|
+
hides.push(__hide(overlay, animation));
|
|
50
|
+
}
|
|
51
|
+
await Promise.all(hides);
|
|
52
|
+
resolve();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function __hide(modal: HTMLElement, animation: ModalAnimation) {
|
|
56
|
+
return new Promise<void>((resolve) => {
|
|
57
|
+
const showClass = [...modal.classList.values()].find((c) => { return c.startsWith('evo-modal-show'); }) ?? 'evo-modal-show-fade';
|
|
58
|
+
modal.classList.add(`evo-modal-hide-${animation}`);
|
|
59
|
+
modal.classList.remove(showClass);
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
modal.classList.remove('evo-modal-visible', `evo-modal-hide-${animation}`);
|
|
62
|
+
resolve();
|
|
63
|
+
}, animation !== 'none' ? animationDuration : 0);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Moves the overlay element by appending it to an element
|
|
69
|
+
* @param selector
|
|
70
|
+
*/
|
|
71
|
+
export function appendOverlay(selector: string | HTMLElement) {
|
|
72
|
+
const container = typeof selector == 'string' ? document.querySelector(selector) : selector;
|
|
73
|
+
if (container) {
|
|
74
|
+
container.appendChild(overlay);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const overlay: HTMLElement = document.querySelector<HTMLElement>('.evo-modal-overlay') ?? (() => {
|
|
79
|
+
// create the overlay
|
|
80
|
+
const div = document.createElement('div');
|
|
81
|
+
div.classList.add('evo-modal-overlay');
|
|
82
|
+
document.body.append(div);
|
|
83
|
+
return div;
|
|
84
|
+
})();
|
|
85
|
+
overlay.addEventListener('click', () => {
|
|
86
|
+
hide();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const animationDuration = (() => {
|
|
90
|
+
const duration = getComputedStyle(document.body).getPropertyValue('--evo-modal-animation-duration');
|
|
91
|
+
return duration ? /^\d+m?s$/.test(duration) ? parseInt(duration, 10) : parseFloat(duration) * 1000 : 0;
|
|
92
|
+
})();
|
|
93
|
+
|
|
94
|
+
document.querySelectorAll<HTMLElement>('.evo-modal').forEach((modal) => {
|
|
95
|
+
modal.querySelectorAll<HTMLElement>('.evo-modal-action-hide').forEach((btn) => {
|
|
96
|
+
btn.addEventListener('click', async () => {
|
|
97
|
+
hide(modal);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
document.querySelectorAll<HTMLElement>('[data-evo-modal-show]').forEach((trigger) => {
|
|
103
|
+
trigger.addEventListener('click', async (e) => {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
const target = (e.currentTarget ?? e.target) as HTMLElement;
|
|
106
|
+
const animation = (target.getAttribute('data-evo-modal-animation') ?? undefined) as ModalAnimation | undefined;
|
|
107
|
+
await show(target.getAttribute('data-evo-modal-show') as string, { animation });
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div class="evo-modal-overlay"></div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import type { ModalAnimation } from './Modal';
|
|
4
|
+
|
|
5
|
+
interface Props extends HTMLAttributes<'button'> {
|
|
6
|
+
modal: string;
|
|
7
|
+
animation?: ModalAnimation;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
modal,
|
|
12
|
+
animation,
|
|
13
|
+
...rest
|
|
14
|
+
} = Astro.props;
|
|
15
|
+
|
|
16
|
+
interface ButtonAttrs extends HTMLAttributes<'button'> {
|
|
17
|
+
'data-evo-modal-show': string;
|
|
18
|
+
'data-evo-modal-animation'?: ModalAnimation
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const attrs: ButtonAttrs = {...rest, 'data-evo-modal-show': modal};
|
|
22
|
+
if (animation) {
|
|
23
|
+
attrs['data-evo-modal-animation'] = animation;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const cssClass = attrs['class'];
|
|
27
|
+
delete attrs['class'];
|
|
28
|
+
---
|
|
29
|
+
<button class:list={['evo-modal-trigger', cssClass]} {...attrs}><slot /></button>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
import ScrollContainer from '../ScrollContainer/ScrollContainer.astro';
|
|
3
|
+
import './PdfViewer.css';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
id: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
height?: number | string;
|
|
9
|
+
theme?: 'black' | 'dark';
|
|
10
|
+
pdf: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
pages?: string;
|
|
13
|
+
bookmarks?: Record<string, number>;
|
|
14
|
+
bookmarkText?: string;
|
|
15
|
+
}
|
|
16
|
+
const {
|
|
17
|
+
id,
|
|
18
|
+
class: cssClass,
|
|
19
|
+
height,
|
|
20
|
+
theme,
|
|
21
|
+
pdf,
|
|
22
|
+
page = 1,
|
|
23
|
+
bookmarks,
|
|
24
|
+
bookmarkText = 'Jump to',
|
|
25
|
+
...rest
|
|
26
|
+
} = Astro.props;
|
|
27
|
+
|
|
28
|
+
const attrs: Record<string, string> = {...rest};
|
|
29
|
+
if (height) {
|
|
30
|
+
attrs.style = `${attrs.style ? `${attrs.style}${attrs.style.endsWith(';') ? '' : ';'}` : ''}--evo-pdf-viewer-height:${typeof height == 'number' ? `${height}px` : height};`;
|
|
31
|
+
}
|
|
32
|
+
---
|
|
33
|
+
<div
|
|
34
|
+
id={id}
|
|
35
|
+
class:list={['evo-pdf-viewer', cssClass, theme ? `evo-pdf-viewer-theme-${theme}` : null]}
|
|
36
|
+
data-pdf={pdf}
|
|
37
|
+
data-page={page}
|
|
38
|
+
data-bookmarks={btoa(JSON.stringify(bookmarks ?? {}))}
|
|
39
|
+
{...attrs}
|
|
40
|
+
>
|
|
41
|
+
<div class="evo-pdf-viewer-toolbar">
|
|
42
|
+
<div class="evo-pdf-viewer-toolbar-start">
|
|
43
|
+
<slot name="toolbar-start" />
|
|
44
|
+
</div>
|
|
45
|
+
<div class="evo-pdf-viewer-toolbar-controls">
|
|
46
|
+
<button class="evo-pdf-viewer-toolbar-prev">
|
|
47
|
+
<slot name="toolbar-prev">
|
|
48
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
|
+
<path d="M6 15L12 9L18 15" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
50
|
+
</svg>
|
|
51
|
+
</slot>
|
|
52
|
+
</button>
|
|
53
|
+
<button class="evo-pdf-viewer-toolbar-next">
|
|
54
|
+
<slot name="toolbar-next">
|
|
55
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
+
<path d="M6 9L12 15L18 9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
57
|
+
</svg>
|
|
58
|
+
</slot>
|
|
59
|
+
</button>
|
|
60
|
+
<div class="evo-pdf-viewer-nav-page">
|
|
61
|
+
<select></select> of <span class="evo-pdf-viewer-nav-page-count">0</span>
|
|
62
|
+
</div>
|
|
63
|
+
<button class="evo-pdf-viewer-toolbar-zoom-out">
|
|
64
|
+
<slot name="toolbar-zoom-out">
|
|
65
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
66
|
+
<path d="M6 12L18 12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
67
|
+
</slot>
|
|
68
|
+
</button>
|
|
69
|
+
<button class="evo-pdf-viewer-toolbar-zoom-in">
|
|
70
|
+
<slot name="toolbar-zoom-in">
|
|
71
|
+
<svg class="evo-pdf-viewer-toolbar-icon" width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
72
|
+
<path d="M4 12H20M12 4V20" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
73
|
+
</svg>
|
|
74
|
+
</slot>
|
|
75
|
+
</button>
|
|
76
|
+
<button class="evo-pdf-viewer-toolbar-zoom-reset">
|
|
77
|
+
<slot name="toolbar-zoom-reset">
|
|
78
|
+
<svg width="16px" height="16px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
79
|
+
<path d="M3 3V8M3 8H8M3 8L6 5.29168C7.59227 3.86656 9.69494 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.71683 21 4.13247 18.008 3.22302 14" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
80
|
+
</svg>
|
|
81
|
+
</slot>
|
|
82
|
+
</button>
|
|
83
|
+
<div class="evo-pdf-viewer-toolbar-bookmarks hidden">
|
|
84
|
+
<select>
|
|
85
|
+
<option value="" disabled selected hidden>{bookmarkText}</option>
|
|
86
|
+
</select>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="evo-pdf-viewer-toolbar-end">
|
|
90
|
+
<slot name="toolbar-end" />
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="evo-pdf-viewer-container">
|
|
94
|
+
<ScrollContainer>
|
|
95
|
+
<!-- <div class="evo-pdf-viewer-page">
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
<div class="evo-pdf-viewer-page">
|
|
99
|
+
|
|
100
|
+
</div> -->
|
|
101
|
+
</ScrollContainer>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
.evo-pdf-viewer {
|
|
2
|
+
--evo-pdf-viewer-height: 100%;
|
|
3
|
+
--evo-pdf-viewer-toolbar-height: 44px;
|
|
4
|
+
--evo-pdf-viewer-toolbar-align: center;
|
|
5
|
+
--evo-pdf-viewer-scale: 1;
|
|
6
|
+
|
|
7
|
+
position: relative;
|
|
8
|
+
height: var(--evo-pdf-viewer-height);
|
|
9
|
+
background-color: #f0f0f0;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
|
|
12
|
+
.evo-pdf-viewer-toolbar {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: var(--evo-pdf-viewer-toolbar-align);
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 32px;
|
|
17
|
+
height: var(--evo-pdf-viewer-toolbar-height);
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
|
|
20
|
+
.evo-pdf-viewer-toolbar-controls {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 8px;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
button {
|
|
29
|
+
&.evo-pdf-viewer-toolbar-prev,
|
|
30
|
+
&.evo-pdf-viewer-toolbar-next,
|
|
31
|
+
&.evo-pdf-viewer-toolbar-zoom-out,
|
|
32
|
+
&.evo-pdf-viewer-toolbar-zoom-in,
|
|
33
|
+
&.evo-pdf-viewer-toolbar-zoom-reset {
|
|
34
|
+
all: unset;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
width: 22px;
|
|
40
|
+
height: 22px;
|
|
41
|
+
background-color: #ffffff;
|
|
42
|
+
border: 1px solid #888888;
|
|
43
|
+
border-radius: 6px;
|
|
44
|
+
|
|
45
|
+
.evo-pdf-viewer-toolbar-icon {
|
|
46
|
+
path {
|
|
47
|
+
stroke: #000000;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.evo-pdf-viewer-nav-page {
|
|
53
|
+
margin: 0 8px;
|
|
54
|
+
padding: 0 16px;
|
|
55
|
+
border-left: 1px solid black;
|
|
56
|
+
border-right: 1px solid black;
|
|
57
|
+
font-family: sans-serif;
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
line-height: 24px;
|
|
60
|
+
select {
|
|
61
|
+
/*all: unset;*/
|
|
62
|
+
display: inline-block;
|
|
63
|
+
height: 24px;
|
|
64
|
+
padding: 0;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
color: #000000;
|
|
67
|
+
font-family: sans-serif;
|
|
68
|
+
font-size: 16px;
|
|
69
|
+
line-height: 24px;
|
|
70
|
+
text-align: center;
|
|
71
|
+
background-color: #ffffff;
|
|
72
|
+
border: 1px solid #888888;
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.evo-pdf-viewer-toolbar-bookmarks {
|
|
77
|
+
margin: 0 8px;
|
|
78
|
+
padding: 0 16px;
|
|
79
|
+
border-left: 1px solid black;
|
|
80
|
+
select {
|
|
81
|
+
/*all: unset;*/
|
|
82
|
+
display: inline-block;
|
|
83
|
+
height: 24px;
|
|
84
|
+
padding: 0 0.25em;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
color: #000000;
|
|
87
|
+
font-family: sans-serif;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
line-height: 24px;
|
|
90
|
+
text-align: left;
|
|
91
|
+
background-color: #ffffff;
|
|
92
|
+
border: 1px solid #888888;
|
|
93
|
+
border-radius: 6px;
|
|
94
|
+
}
|
|
95
|
+
&.hidden {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/*.evo-pdf-viewer-nav {
|
|
101
|
+
position: absolute;
|
|
102
|
+
left: calc(50% - 80px);
|
|
103
|
+
top: var(--evo-pdf-viewer-toolbar-height);
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
width: 160px;
|
|
107
|
+
padding: 6px 12px;
|
|
108
|
+
border-radius: 0 0 12px 12px;
|
|
109
|
+
background-color: rgba(51, 51, 51, 0.9);
|
|
110
|
+
backdrop-filter: blur(2px);
|
|
111
|
+
z-index: 1;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
|
|
114
|
+
button {
|
|
115
|
+
all: unset;
|
|
116
|
+
display: block;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
&.evo-pdf-viewer-nav-arrow {
|
|
119
|
+
width: 24px;
|
|
120
|
+
height: 24px;
|
|
121
|
+
}
|
|
122
|
+
&.evo-pdf-viewer-nav-page {
|
|
123
|
+
color: white;
|
|
124
|
+
font-family: sans-serif;
|
|
125
|
+
font-size: 18px;
|
|
126
|
+
line-height: 18px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}*/
|
|
130
|
+
.evo-pdf-viewer-container {
|
|
131
|
+
height: calc(var(--evo-pdf-viewer-height) - var(--evo-pdf-viewer-toolbar-height));
|
|
132
|
+
padding: 0 9px 9px 9px;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
|
|
135
|
+
.evo-scroll-container {
|
|
136
|
+
--evo-scroll-container-track-color: #cccccc;
|
|
137
|
+
.evo-scroll-content {
|
|
138
|
+
canvas {
|
|
139
|
+
display: block;
|
|
140
|
+
margin: 18px auto;
|
|
141
|
+
background-color: white;
|
|
142
|
+
|
|
143
|
+
&:first-child {
|
|
144
|
+
margin-top: 0;
|
|
145
|
+
}
|
|
146
|
+
&:last-child {
|
|
147
|
+
margin-bottom: 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&.evo-pdf-viewer-theme-dark {
|
|
155
|
+
background-color: #444444;
|
|
156
|
+
.evo-pdf-viewer-toolbar {
|
|
157
|
+
|
|
158
|
+
button {
|
|
159
|
+
background-color: #cccccc;
|
|
160
|
+
}
|
|
161
|
+
select {
|
|
162
|
+
background-color: #cccccc;
|
|
163
|
+
}
|
|
164
|
+
.evo-pdf-viewer-nav-page,
|
|
165
|
+
.evo-pdf-viewer-toolbar-bookmarks {
|
|
166
|
+
color: #ffffff;
|
|
167
|
+
border-color: #cccccc;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
&.evo-pdf-viewer-theme-black {
|
|
172
|
+
background-color: #000000;
|
|
173
|
+
.evo-pdf-viewer-toolbar {
|
|
174
|
+
|
|
175
|
+
button {
|
|
176
|
+
background-color: #666666;
|
|
177
|
+
.evo-pdf-viewer-toolbar-icon {
|
|
178
|
+
path {
|
|
179
|
+
stroke: #ffffff;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
select {
|
|
184
|
+
color: #ffffff;
|
|
185
|
+
background-color: #666666;
|
|
186
|
+
}
|
|
187
|
+
.evo-pdf-viewer-nav-page,
|
|
188
|
+
.evo-pdf-viewer-toolbar-bookmarks {
|
|
189
|
+
color: #ffffff;
|
|
190
|
+
border-color: #999999;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
.evo-pdf-viewer-container {
|
|
194
|
+
--evo-scroll-container-track-color: #666666;
|
|
195
|
+
--evo-scroll-container-thumb-color: #dddddd;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|