-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
9 changed files
with
201 additions
and
191 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
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
File renamed without changes.
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,43 @@ | ||
*{ | ||
tab-size: 4; | ||
box-sizing: border-box; | ||
} | ||
|
||
/* Demo styling */ | ||
body{ | ||
white-space: nowrap; | ||
text-align: center; | ||
background: #ccc; | ||
font-size: 0; | ||
margin: 0; | ||
} | ||
body::before{ | ||
content: ""; | ||
height: 100vh; | ||
width: 0; | ||
display: inline-block; | ||
vertical-align: middle; | ||
} | ||
|
||
#chalkboard{ | ||
font-size: 1rem; | ||
background: #333; | ||
border: 5px double #000; | ||
border-color: #aaa #ccc #fff #666; | ||
box-shadow: 0 0 1.5em -.25em rgba(0,0,0,1); | ||
|
||
display: inline-block; | ||
vertical-align: middle; | ||
white-space: normal; | ||
position: relative; | ||
margin: 1em; | ||
width: calc(100% - 2em); | ||
max-width: 640px; | ||
height: 500px; | ||
} | ||
.troff-view-pages{ | ||
padding: 1em; | ||
} | ||
.troff-view-page{ | ||
margin-bottom: 1em; | ||
} |
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,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-AU"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="initial-scale=1, minimum-scale=1" /> | ||
<link rel="stylesheet" type="text/css" href="../../../lib/postproc/canvas/viewer.css" /> | ||
<link rel="stylesheet" type="text/css" href="./canvas.css" /> | ||
<title>TroffCanvasViewer demo</title> | ||
</head> | ||
|
||
|
||
<body> | ||
|
||
<div id="chalkboard"></div> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
const {TroffCanvasViewer} = require("../../.."); | ||
const view = new TroffCanvasViewer({ | ||
parentElement: document.getElementById("chalkboard"), | ||
}); | ||
|
||
// Load ditroff source from file, then render it | ||
view.loadFile("./text/pdf-large.out"); | ||
</script> | ||
</body> | ||
</html> |
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,53 @@ | ||
*{ | ||
tab-size: 4; | ||
box-sizing: border-box; | ||
} | ||
|
||
html{ | ||
background: #000; | ||
color: #fff; | ||
} | ||
|
||
a:link, | ||
a:visited{ | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
#notice{ | ||
background: rgba(0, 0, 0, .75); | ||
font: 1rem sans-serif; | ||
color: #fff; | ||
|
||
position: fixed; | ||
overflow: hidden; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
z-index: 9; | ||
transition: 0s step-end z-index, .3s ease-in opacity; | ||
} | ||
#notice[hidden]{ | ||
display: block !important; | ||
pointer-events: none; | ||
opacity: 0; | ||
z-index: -1; | ||
transition-delay: .3s, 0s; | ||
} | ||
|
||
#notice > strong{ | ||
cursor: pointer; | ||
position: fixed; | ||
display: block; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
text-align: center; | ||
text-shadow: 1px 1px 0 #000; | ||
} | ||
#notice > strong::after{ | ||
content: "(Click to dismiss this message)"; | ||
display: block; | ||
margin-top: 1em; | ||
} |
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,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-AU"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="initial-scale=1, minimum-scale=1" /> | ||
<link rel="stylesheet" type="text/css" href="./tty.css" /> | ||
<title>TTYViewer demo</title> | ||
</head> | ||
|
||
|
||
<body> | ||
|
||
<div id="frame"></div> | ||
<div id="notice" hidden><strong></strong></div> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
// Unrelated garnish | ||
notice.addEventListener("click", () => { | ||
notice.hidden = true; | ||
}); | ||
|
||
|
||
// Demo-related | ||
const { | ||
ManPageLoader, | ||
TTYViewer, | ||
} = require("../../../lib/index.js"); | ||
|
||
const loader = new ManPageLoader(); | ||
const viewer = new TTYViewer({ | ||
parentElement: document.getElementById("frame"), | ||
onError: (error) => { | ||
console.error(error); | ||
notice.hidden = false; | ||
notice.firstChild.textContent = error; | ||
}, | ||
}); | ||
|
||
console.dir({loader, viewer}); | ||
loader.load("groff_char") | ||
.then(data => viewer.render(data)) | ||
.catch(err => console.error(err)); | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.