diff --git a/package.json b/package.json index 04950b5..af1fe85 100755 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "planar-vagabond", - "version": "0.12.1", + "version": "0.12.3", "description": "", "main": "index.js", "scripts": { - "build": "node app.js build", - "build:prod": "cross-env NODE_ENV=production node ./lib/build", - "serve": "node app.js serve", - "start": "node app.js watch", - "watch": "node app.js watch" + "build": "npx weevr build", + "build:prod": "cross-env NODE_ENV=production npx weevr build", + "serve": "npx weevr serve", + "start": "npx weevr watch", + "watch": "npx weevr watch" }, "keywords": [], "author": "Eric Woodward (https://www.itsericwoodward.com)", diff --git a/src/assets/fragments/bestiary/golems/immunities.md b/src/assets/fragments/bestiary/golems/immunities.md new file mode 100644 index 0000000..b5fc481 --- /dev/null +++ b/src/assets/fragments/bestiary/golems/immunities.md @@ -0,0 +1,3 @@ +- Immune to damage from non-magical weapons. +- Immune to mind reading / altering spells and spell-like effects, (ex: charm, fear, hold, sleep). +- No need to eat, drink, breathe, or sleep. diff --git a/src/assets/fragments/weapons/dagger-properties.md b/src/assets/fragments/weapons/dagger-properties.md index 094b074..b2eff0b 100644 --- a/src/assets/fragments/weapons/dagger-properties.md +++ b/src/assets/fragments/weapons/dagger-properties.md @@ -1,7 +1,4 @@ ### Dagger Properties - **Light**: May be used in offhand when [dual-wielding](/rules/combat.html#dual-wielding). -- **Thrown**: May be used as ranged weapon - - Short range: 10' max - - Medium range: 20' max - - Long range: 30' max +- **Thrown**: May be thrown and used as a ranged weapon (10' / 20' / 30'). diff --git a/src/assets/fragments/weapons/longsword-properties.md b/src/assets/fragments/weapons/longsword-properties.md index 44b1843..c5672b8 100644 --- a/src/assets/fragments/weapons/longsword-properties.md +++ b/src/assets/fragments/weapons/longsword-properties.md @@ -1,5 +1,5 @@ ### Longsword Properties -- **Versatile**: At start of combat round, if offhand is free, may choose to have sword deal 1d10 base damage that round while gaining the following properties: +- **Versatile**: At start of combat round, if offhand is free, may choose to have sword deal 1d10 base damage for that round while gaining the following properties: - **Slow**: Always attacks last in a round. - **Two-handed**: Requires two hands to use. diff --git a/src/assets/fragments/weapons/trident-properties.md b/src/assets/fragments/weapons/trident-properties.md new file mode 100644 index 0000000..3e6528a --- /dev/null +++ b/src/assets/fragments/weapons/trident-properties.md @@ -0,0 +1,6 @@ +### Trident Properties + +- **Thrown**: May be thrown and used as a ranged weapon (10' / 20' / 30'). +- **Versatile**: At start of combat round, if offhand is free, may choose to have trident deal 1d8 base damage for that round while gaining the following properties: + - **Slow**: Always attacks last in a round. + - **Two-handed**: Requires two hands to use. diff --git a/src/assets/fragments/weapons/warhammer-properties.md b/src/assets/fragments/weapons/warhammer-properties.md new file mode 100644 index 0000000..878413a --- /dev/null +++ b/src/assets/fragments/weapons/warhammer-properties.md @@ -0,0 +1,6 @@ +### Warhammer Properties + +- **Blunt**: No cutting edge, may be wielded by a cleric. +- **Versatile**: At start of combat round, if offhand is free, may choose to have hammer deal 1d8 base damage for that round while gaining the following properties: + - **Slow**: Always attacks last in a round. + - **Two-handed**: Requires two hands to use. diff --git a/src/assets/images/magic-items/cape-of-muuntehbahnk.jpg b/src/assets/images/magic-items/cape-of-muuntehbahnk.jpg new file mode 100644 index 0000000..e550a63 Binary files /dev/null and b/src/assets/images/magic-items/cape-of-muuntehbahnk.jpg differ diff --git a/src/assets/images/magic-items/mirror-of-telepresence-1.jpg b/src/assets/images/magic-items/mirror-of-telepresence-1.jpg new file mode 100644 index 0000000..5d2ae20 Binary files /dev/null and b/src/assets/images/magic-items/mirror-of-telepresence-1.jpg differ diff --git a/src/assets/images/magic-items/mirror-of-telepresence-2.jpg b/src/assets/images/magic-items/mirror-of-telepresence-2.jpg new file mode 100644 index 0000000..e0ac546 Binary files /dev/null and b/src/assets/images/magic-items/mirror-of-telepresence-2.jpg differ diff --git a/src/assets/images/magic-items/stone-of-blinding.jpg b/src/assets/images/magic-items/stone-of-blinding.jpg new file mode 100644 index 0000000..3b6db5a Binary files /dev/null and b/src/assets/images/magic-items/stone-of-blinding.jpg differ diff --git a/src/assets/images/magic-items/wand-of-desparking.jpg b/src/assets/images/magic-items/wand-of-desparking.jpg new file mode 100644 index 0000000..8bf74a5 Binary files /dev/null and b/src/assets/images/magic-items/wand-of-desparking.jpg differ diff --git a/src/assets/images/magic-items/whispering-stones.jpg b/src/assets/images/magic-items/whispering-stones.jpg index 76d8352..2da547e 100644 Binary files a/src/assets/images/magic-items/whispering-stones.jpg and b/src/assets/images/magic-items/whispering-stones.jpg differ diff --git a/src/assets/scripts/scripts.js b/src/assets/scripts/scripts.js index 5a88a86..7381019 100644 --- a/src/assets/scripts/scripts.js +++ b/src/assets/scripts/scripts.js @@ -47,6 +47,7 @@ export default (() => { }); } + // put url in DuckDuckGo search on 404 page if (document.documentElement.className.indexOf('is404') > -1) { document.getElementById('searchQuery').value = window.location.pathname @@ -54,12 +55,67 @@ export default (() => { .replace(/\//g, ' '); } + // Add site to DuckDuckGo search document .getElementById('searchForm') .addEventListener('submit', (e) => { document.getElementById('searchQuery').value += ' site:' + window.location.hostname; }); + + // Add shadow to toolDetails that have extra content + // I know - ALL OF THIS CODE just for that little effect + const details = document.querySelectorAll('.toolDetails'), + setBottomShadow = (detail) => { + const { + clientHeight = 0, + offsetHeight = 0, + scrollHeight = 0, + scrollTop = 0, + } = detail ?? {}, + currentScroll = + scrollTop / (scrollHeight - offsetHeight); + + if (clientHeight === scrollHeight) return; + + detail.style.boxShadow = `rgba(0, 0, 0, 0.35) 0px -${ + 50 * (1 - currentScroll) + }px 36px -28px inset`; + }; + + let isWaiting; + const throttle = (callback, time) => { + if (isWaiting) return; + isWaiting = true; + setTimeout(() => { + callback(); + isWaiting = false; + }, time); + }; + + window.addEventListener( + 'resize', + () => + throttle( + () => + details.forEach((detail) => + setBottomShadow(detail) + ), + 250 + ), + { passive: true } + ); + + details.forEach((detail) => { + detail.addEventListener( + 'scroll', + () => throttle(() => setBottomShadow(detail), 250), + { passive: true } + ); + setBottomShadow(detail); + }); + + details.forEach((detail) => setBottomShadow(detail)); }, 1); }); })(); diff --git a/src/assets/styles/styles.css b/src/assets/styles/styles.css index afbc32c..8483ef9 100644 --- a/src/assets/styles/styles.css +++ b/src/assets/styles/styles.css @@ -344,14 +344,6 @@ table th { font-style: italic; } -.headlessTableWrapper thead { - display: none; -} - -.nonHumanClassTableWrapper table thead tr:last-child { - display: none; -} - .dividedTableWrapper { display: block; margin: 1rem 0; @@ -382,6 +374,23 @@ table th { max-width: 90%; } +details.gm-notes { + border: 1px dashed #885c68; + padding-left: 1rem; +} + +details.gm-notes summary { + margin-left: -1rem; +} + +details.gm-notes ul { + margin-top: 0; +} + +.headlessTableWrapper thead { + display: none; +} + a.hiddenLink { border-bottom: transparent; color: #fadbb0; @@ -529,7 +538,47 @@ a.licenseLink:hover { top: 1rem; } -.menubar { +.menubar {/** + * Scrolling shadows by @kizmarh and @leaverou + * Only works in browsers supporting background-attachment: local; & CSS gradients + * Degrades gracefully + */ + + html { + background: white; + font: 120% sans-serif; + } + + .scrollbox { + overflow: auto; + width: 200px; + max-height: 200px; + margin: 50px auto; + + background: + /* Shadow covers */ + linear-gradient(white 30%, rgba(255,255,255,0)), + linear-gradient(rgba(255,255,255,0), white 70%) 0 100%, + + /* Shadows */ + radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)), + radial-gradient(50% 100%,farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%; + background: + /* Shadow covers */ + linear-gradient(white 30%, rgba(255,255,255,0)), + linear-gradient(rgba(255,255,255,0), white 70%) 0 100%, + + /* Shadows */ + radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)), + radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%; + background-repeat: no-repeat; + background-color: white; + background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px; + + /* Opera doesn't support this in the shorthand */ + background-attachment: local, local, scroll, scroll; + } + background: #282c32; display: static; max-height: 1px; @@ -742,6 +791,10 @@ a.licenseLink:hover { text-align: center; } +.nonHumanClassTableWrapper table thead tr:last-child { + display: none; +} + .page { background: #372734; background: rgba(55, 39, 52, 0.9); @@ -1073,12 +1126,14 @@ a.pageTitle-sublink { font-weight: bold; } + .toolDetails { border: 1px dashed; display: none; margin-bottom: 4%; overflow-y: auto; padding: 0 2rem; + position: relative; width: 100%; } @@ -1114,6 +1169,14 @@ a.pageTitle-sublink { text-align: center; } +.bottomShadow { + box-shadow: rgba(0, 0, 0, 0.35) 0px -50px 36px -28px inset; +} + +.topShadow { + box-shadow: rgba(0, 0, 0, 0.35) 0px 50px 36px 28px inset; +} + .zineIssue-wrapper .table-of-contents { display: none; } diff --git a/src/layouts/partials/rulesHeader.ejs b/src/layouts/partials/rulesHeader.ejs index c800f47..d4a9344 100644 --- a/src/layouts/partials/rulesHeader.ejs +++ b/src/layouts/partials/rulesHeader.ejs @@ -34,7 +34,7 @@ var title = (page.title ?? '').replace('HOSR ', '');