diff --git a/Radio_7/LICENSE b/Radio_7/LICENSE new file mode 100644 index 0000000..991f486 --- /dev/null +++ b/Radio_7/LICENSE @@ -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. diff --git a/Radio_7/README.md b/Radio_7/README.md new file mode 100644 index 0000000..140903e --- /dev/null +++ b/Radio_7/README.md @@ -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) diff --git a/Radio_7/cookbook.pdf b/Radio_7/cookbook.pdf new file mode 100644 index 0000000..5e84599 Binary files /dev/null and b/Radio_7/cookbook.pdf differ diff --git a/Radio_7/cookbook.png b/Radio_7/cookbook.png new file mode 100644 index 0000000..5a7d83e Binary files /dev/null and b/Radio_7/cookbook.png differ diff --git a/Radio_7/ezmreader.js b/Radio_7/ezmreader.js new file mode 100644 index 0000000..19f6bb5 --- /dev/null +++ b/Radio_7/ezmreader.js @@ -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; +} diff --git a/Radio_7/index.html b/Radio_7/index.html new file mode 100644 index 0000000..d09e670 --- /dev/null +++ b/Radio_7/index.html @@ -0,0 +1,152 @@ + + + + + + XPUB COOKBOOK + + + + + + + + + + + + + + + +
loading zine...
+ + PDF + +
+ + + + diff --git a/Radio_7/pages/.ipynb_checkpoints/2-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/2-checkpoint.png new file mode 100644 index 0000000..4b30c01 Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/2-checkpoint.png differ diff --git a/Radio_7/pages/.ipynb_checkpoints/4-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/4-checkpoint.png new file mode 100644 index 0000000..44de4de Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/4-checkpoint.png differ diff --git a/Radio_7/pages/.ipynb_checkpoints/6-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/6-checkpoint.png new file mode 100644 index 0000000..b90597b Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/6-checkpoint.png differ diff --git a/Radio_7/pages/.ipynb_checkpoints/7-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/7-checkpoint.png new file mode 100644 index 0000000..d0024aa Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/7-checkpoint.png differ diff --git a/Radio_7/pages/.ipynb_checkpoints/8-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/8-checkpoint.png new file mode 100644 index 0000000..5ea28e6 Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/8-checkpoint.png differ diff --git a/Radio_7/pages/.ipynb_checkpoints/9-checkpoint.png b/Radio_7/pages/.ipynb_checkpoints/9-checkpoint.png new file mode 100644 index 0000000..67c9de5 Binary files /dev/null and b/Radio_7/pages/.ipynb_checkpoints/9-checkpoint.png differ diff --git a/Radio_7/pages/1.png b/Radio_7/pages/1.png new file mode 100644 index 0000000..30bd880 Binary files /dev/null and b/Radio_7/pages/1.png differ diff --git a/Radio_7/pages/10.png b/Radio_7/pages/10.png new file mode 100644 index 0000000..a56ab6e Binary files /dev/null and b/Radio_7/pages/10.png differ diff --git a/Radio_7/pages/11.png b/Radio_7/pages/11.png new file mode 100644 index 0000000..2b38ea3 Binary files /dev/null and b/Radio_7/pages/11.png differ diff --git a/Radio_7/pages/12.png b/Radio_7/pages/12.png new file mode 100644 index 0000000..84db2ba Binary files /dev/null and b/Radio_7/pages/12.png differ diff --git a/Radio_7/pages/13.png b/Radio_7/pages/13.png new file mode 100644 index 0000000..e1eef45 Binary files /dev/null and b/Radio_7/pages/13.png differ diff --git a/Radio_7/pages/2.png b/Radio_7/pages/2.png new file mode 100644 index 0000000..ad545a0 Binary files /dev/null and b/Radio_7/pages/2.png differ diff --git a/Radio_7/pages/3.png b/Radio_7/pages/3.png new file mode 100644 index 0000000..f8c6079 Binary files /dev/null and b/Radio_7/pages/3.png differ diff --git a/Radio_7/pages/4.png b/Radio_7/pages/4.png new file mode 100644 index 0000000..44de4de Binary files /dev/null and b/Radio_7/pages/4.png differ diff --git a/Radio_7/pages/5.png b/Radio_7/pages/5.png new file mode 100644 index 0000000..ade1d0a Binary files /dev/null and b/Radio_7/pages/5.png differ diff --git a/Radio_7/pages/6.png b/Radio_7/pages/6.png new file mode 100644 index 0000000..b90597b Binary files /dev/null and b/Radio_7/pages/6.png differ diff --git a/Radio_7/pages/7.png b/Radio_7/pages/7.png new file mode 100644 index 0000000..d0024aa Binary files /dev/null and b/Radio_7/pages/7.png differ diff --git a/Radio_7/pages/8.png b/Radio_7/pages/8.png new file mode 100644 index 0000000..5ea28e6 Binary files /dev/null and b/Radio_7/pages/8.png differ diff --git a/Radio_7/pages/9.png b/Radio_7/pages/9.png new file mode 100644 index 0000000..67c9de5 Binary files /dev/null and b/Radio_7/pages/9.png differ diff --git a/Radio_7/pages/BACK.png b/Radio_7/pages/BACK.png new file mode 100644 index 0000000..21de3be Binary files /dev/null and b/Radio_7/pages/BACK.png differ diff --git a/Radio_7/pages/FRONT.png b/Radio_7/pages/FRONT.png new file mode 100644 index 0000000..029741b Binary files /dev/null and b/Radio_7/pages/FRONT.png differ diff --git a/Radio_7/pages/INNERFRONT.png b/Radio_7/pages/INNERFRONT.png new file mode 100644 index 0000000..68be8c4 Binary files /dev/null and b/Radio_7/pages/INNERFRONT.png differ diff --git a/Radio_7/spa.png b/Radio_7/spa.png new file mode 100644 index 0000000..a25eb53 Binary files /dev/null and b/Radio_7/spa.png differ diff --git a/Radio_7/table.gif b/Radio_7/table.gif new file mode 100644 index 0000000..c412ae0 Binary files /dev/null and b/Radio_7/table.gif differ diff --git a/Radio_7/table.jpg b/Radio_7/table.jpg new file mode 100644 index 0000000..f49159b Binary files /dev/null and b/Radio_7/table.jpg differ diff --git a/Radio_7/table2.png b/Radio_7/table2.png new file mode 100644 index 0000000..9da7d30 Binary files /dev/null and b/Radio_7/table2.png differ diff --git a/index.html b/index.html index d09e670..6d93f1b 100644 --- a/index.html +++ b/index.html @@ -3,150 +3,14 @@ - XPUB COOKBOOK - - - - - - - - - - - - -
loading zine...
- - PDF - -
- +This weeks broadcast + -