-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f19277
commit bb988ae
Showing
86 changed files
with
3,760 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @ts-expect-error | ||
import { chunker } from './pagedjs'; | ||
|
||
import { config } from './config'; | ||
|
||
import './pagedjs/index.scss'; | ||
import './pagedjs/interface.scss'; | ||
|
||
let loading = true; | ||
|
||
export async function render(app: HTMLElement, renderTo: HTMLElement) { | ||
loading = true; | ||
|
||
console.log('chunking...'); | ||
const chunks = await chunker(app, renderTo, config); | ||
console.log(`took: ${(chunks.performance / 1000).toFixed(2)}s`); | ||
|
||
loading = false; | ||
document.dispatchEvent(new Event('pages-loaded')); | ||
|
||
return chunks; | ||
} | ||
|
||
export function waitForRender() { | ||
return new Promise((resolve) => { | ||
if (loading) { | ||
document.addEventListener('pages-loaded', resolve, { once: true }); | ||
} else { | ||
resolve(true); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@media screen { | ||
.pages { | ||
#print-view { | ||
$gap: 1em; | ||
margin: 0 auto; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
.pagedjs_page { | ||
&:first-child { | ||
.pagedjs_page_content > div { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
#print-view { | ||
font-family: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, | ||
sans-serif; | ||
font-size: 12pt; | ||
line-height: 1.4; | ||
|
||
h1 { | ||
font-size: 1.8em; | ||
text-align: center; | ||
} | ||
.pagedjs_page { | ||
&:first-child { | ||
.pagedjs_page_content > div { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
|
||
h1 { | ||
font-size: 1.8em; | ||
text-align: center; | ||
} | ||
|
||
p { | ||
padding-left: 2em; | ||
padding-right: 2em; | ||
p { | ||
padding-left: 2em; | ||
padding-right: 2em; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
// page styling ------ | ||
|
||
.pagedjs_page_content > div > *:first-child, | ||
.pagedjs_page_content > div > .boxout:first-child *:first-child, | ||
.pagedjs_page_content > div > .boxout:first-child .type { | ||
margin-top: 0; | ||
.pagedjs_page_content > div > *:first-child, | ||
.pagedjs_page_content > div > .boxout:first-child > *:first-child, | ||
.pagedjs_page_content > div > .boxout:first-child > .type, | ||
.pagedjs_page_content > div > section:first-child > *:first-child, | ||
.pagedjs_page_content | ||
> div | ||
> section:first-child | ||
> .boxout:first-child | ||
> *:first-child, | ||
.pagedjs_page_content | ||
> div | ||
> section:first-child | ||
> .boxout:first-child | ||
> .type { | ||
margin-top: 0; | ||
} | ||
} |
Oops, something went wrong.