index to Radio_7
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Jeremy Oduber and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -0,0 +1,32 @@
|
||||
# HTML5 Reader for Electric Zine Maker
|
||||
|
||||
A web and mobile friendly way to show off [Electric Zine Maker](https://alienmelon.itch.io/electric-zine-maker) zines on itch.io.
|
||||
|
||||
See live example [here](https://jeremyoduber.itch.io/js-zine).
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
- Copy the PNG files from your Electric Zine Maker save folder into the 'pages' folder with their original filenames.
|
||||
- If you're not using the default EZM template, change the TEMPLATE constant in ezmreader.js. As of release all EZM templates are available but Fancy templates are not yet fancy.
|
||||
- To change the background color, modify the hex value in the BGCOLOR constant in ezmreader.js.
|
||||
- To add a description or plaintext copy for screen readers, change the ALT constant.
|
||||
- Turn pages with arrow keys or A&D, or click/tap on page edges.
|
||||
|
||||
- If you are hosting your zine directly, you can change the metadata in index.html to have more control of what the preview will look like when your zine is linked to on social media.
|
||||
|
||||
|
||||
### itch.io specific instructions
|
||||
- Compress the whole thing into a zip file and upload to itch.io as an HTML project that will be played in the browser.
|
||||
- Set the viewport dimensions to whatever you like.
|
||||
- The reader is mobile friendly in either orientation, but for better readability on small screens, set it to Landscape.
|
||||
|
||||
## Special Thanks
|
||||
[Nathalie Lawhead](https://twitter.com/alienmelon) for making Electric Zine Maker
|
||||
[Sean S. LeBlanc](https://twitter.com/SeanSLeBlanc) for code contributions
|
||||
|
||||
## License
|
||||
[MIT](https://github.com/jeremyoduber/EZM-Reader/blob/main/LICENSE)
|
||||
|
||||
## Links
|
||||
[project itch.io page](https://jeremyoduber.itch.io/js-zine)
|
||||
[my twitter](https://twitter.com/JeremyOduber)
|
After Width: | Height: | Size: 12 MiB |
@ -0,0 +1,185 @@
|
||||
/*
|
||||
|
||||
HTML5 Reader for Electric Zine Maker, made by Jeremy Oduber & contributors 2019-2021
|
||||
v21.3
|
||||
Me:
|
||||
https://twitter.com/JeremyOduber
|
||||
This:
|
||||
https://jeremyoduber.itch.io/js-zine
|
||||
Electric Zine Maker:
|
||||
https://alienmelon.itch.io/electric-zine-maker
|
||||
GitHub:
|
||||
https://github.com/jeremyoduber/EZM-Reader
|
||||
Licensed under the MIT License:
|
||||
https://github.com/jeremyoduber/EZM-Reader/blob/main/LICENSE
|
||||
|
||||
*/
|
||||
|
||||
//---- USER OPTIONS ----//
|
||||
const TEMPLATE = 4; // Change this value to set the template
|
||||
/*
|
||||
Available templates:
|
||||
|
||||
1: 8 pages (default)
|
||||
8 Page Folded Zine
|
||||
8 Page Z-Fold
|
||||
Quarter Size
|
||||
2: 12 pages
|
||||
Fancy T-Cut Zine
|
||||
3: 14 pages
|
||||
Easy Long Cut
|
||||
4: 16 pages
|
||||
16 Page Micro-Mini
|
||||
Mini-Booklet
|
||||
Fancy Flapbook
|
||||
5: 26 pages
|
||||
Square Accordion
|
||||
Normal Accordion
|
||||
*/
|
||||
const BGCOLOR = '#f5f5f5'; // Change this hex value to set the background color. Remember to keep the quotes!
|
||||
const ALT = 'Reader for Electric Zine Maker'; // Change this to a plaintext copy or description of your content to make it visible to screen-readers
|
||||
//---- END USER OPTIONS ----//
|
||||
|
||||
// Setup constants and variables
|
||||
const FOV = 45;
|
||||
const LOADING_OVERLAY = document.querySelector('#loading');
|
||||
let card_amount;
|
||||
let current_state = 0;
|
||||
let textures = [];
|
||||
let pages = [];
|
||||
|
||||
document.body.style.background = BGCOLOR;
|
||||
document.body.ariaLabel = ALT;
|
||||
const metaTheme = document.createElement('meta');
|
||||
metaTheme.name = 'theme-color';
|
||||
metaTheme.content = BGCOLOR;
|
||||
document.head.appendChild(metaTheme);
|
||||
|
||||
function getTextures(num) {
|
||||
return ['pages/FRONT.png', 'pages/INNERFRONT.png'].concat(
|
||||
new Array(num).fill().map((_, idx) => 'pages/' + (idx + 1) + '.png'),
|
||||
['pages/BACK.png']
|
||||
);
|
||||
}
|
||||
|
||||
// Select template
|
||||
switch (TEMPLATE) {
|
||||
default:
|
||||
case 1:
|
||||
card_amount = 4;
|
||||
textures = getTextures(5);
|
||||
break;
|
||||
case 2:
|
||||
card_amount = 6;
|
||||
textures = getTextures(9);
|
||||
break;
|
||||
case 3:
|
||||
card_amount = 7;
|
||||
textures = getTextures(11);
|
||||
break;
|
||||
case 4:
|
||||
card_amount = 8;
|
||||
textures = getTextures(13);
|
||||
break;
|
||||
case 5:
|
||||
card_amount = 13;
|
||||
textures = getTextures(23);
|
||||
break;
|
||||
}
|
||||
|
||||
// Preloader
|
||||
Promise.all(
|
||||
textures.map(
|
||||
src =>
|
||||
new Promise((resolve, reject) => {
|
||||
const img = new Image();
|
||||
img.onload = () => resolve(img);
|
||||
img.onerror = reject;
|
||||
img.src = src;
|
||||
img.alt = src.split('/')[1].split('.')[0];
|
||||
})
|
||||
)
|
||||
)
|
||||
.then(imgs => {
|
||||
LOADING_OVERLAY.remove();
|
||||
const list = document.createElement('ul');
|
||||
list.ariaHidden = true;
|
||||
pages = imgs.map((img, idx) => {
|
||||
const li = document.createElement('li');
|
||||
const flip = idx % 2;
|
||||
li.className = 'depth-' + Math.min(2, idx);
|
||||
li.style.transform = 'translateX(100%) rotateY(0deg) scaleZ(' + (flip ? -1 : 1) + ')';
|
||||
li.appendChild(img);
|
||||
list.appendChild(li);
|
||||
return li;
|
||||
});
|
||||
document.body.appendChild(list);
|
||||
|
||||
function updatePerspective() {
|
||||
const w = window.innerWidth;
|
||||
const h = window.innerHeight;
|
||||
list.style.perspective = Math.sqrt(((w / 2) * w) / 2 + ((h / 2) * h) / 2) / Math.tan(((FOV / 2) * Math.PI) / 180) + 'px';
|
||||
}
|
||||
|
||||
window.addEventListener('resize', updatePerspective);
|
||||
updatePerspective();
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
LOADING_OVERLAY.textContent = 'Something went wrong! Make sure your images are in the pages folder! See console for details.';
|
||||
});
|
||||
|
||||
// Keyboard input
|
||||
document.addEventListener('keyup', function onKeyUp(key) {
|
||||
if (key.key === 'ArrowLeft' || key.key === 'a') {
|
||||
flipLeft();
|
||||
} else if (key.key === 'ArrowRight' || key.key === 'd') {
|
||||
flipRight();
|
||||
}
|
||||
});
|
||||
|
||||
// Mouse input
|
||||
document.addEventListener('pointerup', function onPointerUp(event) {
|
||||
if (event.button !== 0) return;
|
||||
if (event.clientX < window.innerWidth / 2) {
|
||||
flipRight();
|
||||
} else {
|
||||
flipLeft();
|
||||
}
|
||||
});
|
||||
|
||||
function getPages(state) {
|
||||
return [pages[state * 2], pages[state * 2 + 1]].filter(i => i);
|
||||
}
|
||||
function replaceTransformPerPage(state, search, replace) {
|
||||
getPages(state).forEach(page => {
|
||||
page.style.transform = page.style.transform.replace(search, replace);
|
||||
});
|
||||
}
|
||||
function setDepth(state, depth) {
|
||||
getPages(state).forEach(page => {
|
||||
page.className = page.className.replace(/depth-\d+/, 'depth-' + Math.min(depth, 2));
|
||||
});
|
||||
}
|
||||
|
||||
// Flip page left
|
||||
function flipLeft() {
|
||||
if (current_state >= card_amount) return;
|
||||
replaceTransformPerPage(current_state, '0deg', '-180deg');
|
||||
setDepth(current_state - 1, 1);
|
||||
setDepth(current_state - 2, 2);
|
||||
setDepth(current_state + 1, 0);
|
||||
setDepth(current_state + 2, 1);
|
||||
++current_state;
|
||||
}
|
||||
|
||||
// Flip page right
|
||||
function flipRight() {
|
||||
if (current_state <= 0) return;
|
||||
replaceTransformPerPage(current_state - 1, '-180deg', '0deg');
|
||||
setDepth(current_state - 3, 1);
|
||||
setDepth(current_state - 2, 0);
|
||||
setDepth(current_state + 1, 2);
|
||||
setDepth(current_state, 1);
|
||||
--current_state;
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>XPUB COOKBOOK</title>
|
||||
<meta property="og:title" content="XPUB COOKBOOK" />
|
||||
|
||||
<meta name="description" content="An electric zine" />
|
||||
<meta property="og:description" content="An electric zine" />
|
||||
|
||||
<meta property="og:image" content="http://issue.xpub.nl/15/cookbook.png">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" href="spa.png" type="image/png" />
|
||||
<link rel="apple-touch-icon" href="./pages/FRONT.png" type="image/png" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
font-family: sans-serif;
|
||||
text-align: center;
|
||||
background-image: url("table.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-image: url("table.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
position: absolute;
|
||||
top: 5%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
transform-style: preserve-3d;
|
||||
user-select: none;
|
||||
perspective-origin: center;
|
||||
perspective: 1000px;
|
||||
}
|
||||
|
||||
li {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
height: 95%;
|
||||
backface-visibility: hidden;
|
||||
transform-style: preserve-3d;
|
||||
transform-origin: center left;
|
||||
transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
backface-visibility: hidden;
|
||||
object-fit: contain;
|
||||
object-position: center left;
|
||||
transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
}
|
||||
li:nth-child(even) img {
|
||||
object-position: center right;
|
||||
}
|
||||
|
||||
li.depth-0 img {
|
||||
transform: translateZ(0) scaleX(1);
|
||||
}
|
||||
li:nth-child(even) img {
|
||||
transform: translateZ(0) scaleX(-1);
|
||||
}
|
||||
li.depth-1 img {
|
||||
transform: translateZ(-2px) scaleX(1);
|
||||
}
|
||||
li.depth-1:nth-child(even) img {
|
||||
transform: translateZ(-2px) scaleX(-1);
|
||||
}
|
||||
li.depth-2 img {
|
||||
transform: translateZ(-4px) scaleX(1);
|
||||
}
|
||||
li.depth-2:nth-child(even) img {
|
||||
transform: translateZ(-4px) scaleX(-1);
|
||||
}
|
||||
|
||||
#audio {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
audio{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
a{
|
||||
position: absolute;
|
||||
top: 3%;
|
||||
right: 2%;
|
||||
padding: 0.5vw;
|
||||
font-size: 0.75vw;
|
||||
background-color: white;
|
||||
color: black;
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>This electric zine requires javascript to be enabled.</noscript>
|
||||
<div id="loading">loading zine...</div>
|
||||
|
||||
<a onClick="openTab(this)" href="cookbook.pdf" name="cookbook.pdf">PDF</a>
|
||||
|
||||
<div id="audio"><audio controls>
|
||||
<source src="http://echo.lurk.org:999/cookbook" type="audio/mpeg" controls autoplay>
|
||||
</audio></div>
|
||||
<script src="ezmreader.js">
|
||||
function openTab(th)
|
||||
{
|
||||
window.open(th.name,'_blank');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 4.2 MiB |
After Width: | Height: | Size: 250 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 4.6 MiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 384 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 5.2 MiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 243 KiB |
After Width: | Height: | Size: 4.2 MiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 250 KiB |
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 4.6 MiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 258 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 3.1 MiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 2.8 MiB |