Difference between revisions of "Character Sheet Enhancement"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
m (→Examples) |
||
Line 39: | Line 39: | ||
{{stub}} | {{stub}} | ||
Collection of examples & usercases of some features. Please expand with code or links to examples/documentation. | Collection of examples & usercases of some features. Please expand with code or links to examples/documentation. | ||
+ | ===id's=== | ||
+ | |||
+ | ====id CSS selector==== | ||
+ | Use an id to select one unique element. An id name cannot start with a number. | ||
+ | <pre data-language="html"> | ||
+ | //html | ||
+ | <input type="text" id="character-name" name="attr_character_name" value="" placeholder="Character Name" /> | ||
+ | |||
+ | //css | ||
+ | #character-name { | ||
+ | text-align: center; | ||
+ | color: red; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | ====id Clickable Label text==== | ||
+ | Create "clickable" label text by using a linked label and input. Linked labels could replace various methods that use hidden checkboxes to simulate clickable text/buttons on a sheet. | ||
+ | <pre data-language="html"> | ||
+ | //html | ||
+ | <input id="attackMod1" name="attr_attackMod1" type="checkbox" value="1" class="hidden"> | ||
+ | <label for="attackMod1" class="link">Apply Modifier</label> | ||
+ | //css | ||
+ | .sheet-hidden { | ||
+ | display:none; | ||
+ | } | ||
+ | label.link:hover { | ||
+ | cursor: help; | ||
+ | text-decoration: underline; | ||
+ | color: red; | ||
+ | } | ||
+ | input[type="checkbox"]:checked + label.link { | ||
+ | color: red; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | ====id Sheet Anchors==== | ||
+ | Create links to jump to anchored elements of a sheet. Could be used as a "Navigational Menu/Table of Contents", or simply as clickable text that can quickly move to another section of a sheet. | ||
+ | <pre data-language="html"> | ||
+ | //html | ||
+ | <h2>Sheet Anchor example</h2> | ||
+ | <h3 id="menu">Menu</h3> | ||
+ | <ul> | ||
+ | <li><a href="#Attacks">Attacks</a></li> | ||
+ | <li><a href="#Skills">Skills</a></li> | ||
+ | <li><a href="#Spells">Spells</a></li> | ||
+ | </ul> | ||
+ | <h3 id="Attacks">Attacks</h3> | ||
+ | <p>"Lorem ipsum"</p> | ||
+ | <h3 id="Skills">Skills</h3> | ||
+ | <p>"Lorem ipsum"</p> | ||
+ | <h3 id="Spells">Spells</h3> | ||
+ | <p>"Lorem ipsum"</p> | ||
+ | <hr> | ||
+ | <p><a href="#menu">Menu</a></p> | ||
+ | </pre> | ||
===Datalist=== | ===Datalist=== |
Revision as of 21:45, 14 March 2021
Character Sheet Development
Getting Started
- Using Custom Sheets
- Building Sheets
(Main Page) - Glossary
- Code Restrictions
- Best Practice
- Common Mistakes
- Tutorials
- Examples, Templates
- Pattern Libraries
- HTML & storing data
- CSS & Styling
General
- Updates & Changelog
- Known Bugs
- Character Sheet Enhancement(CSE)
- Custom Roll Parsing
- Legacy Sheet(LCS)
- Beacon SDK
Reference
- Buttons
- Repeating Sections
- Sheetworkers
- Roll Templates
- sheet.json
- Translation
- Auto-Calc
- Advanced
- All SheetDev Pages
Tools & Tips
Other
Main Page: Building Character Sheets
Update is live as of March 9th 2021, see Character Sheet Enhancements!(Forum) for more info |
Character Sheet Enhancement is an update to character sheets and how they are made, enabling many new features, and removing some existing restrictions sheet creators have had to deal with.
It was available on the Dev Server for testing During February, and fully released on March 9th 2021.
Contents |
Info
- Character Sheet Enhancements!(Forum) (March 9th Release)
- iFrame-and-Sanitization-Changes
- Dev Server Testing details (Jan 29th): Now on Dev Server: Character Sheet Enhancements!(Forum) - Char sheet subforum
- Dev Server Talk(Forum) - Pro subforum tread
Features
A summary of what updates the sheet system will have.
- HTML updates:
- The CSS sanitizer has been removed, which now allows for:
- Integrated macro bar for character quick attacks, including pop out windows
-
Character Sheet/Stat Block is the default for opening a PC/NPCThis is being reverted until we have more research regarding implementation.
How to update sheet to new
Examples
This article is a stub. |
Collection of examples & usercases of some features. Please expand with code or links to examples/documentation.
id's
id CSS selector
Use an id to select one unique element. An id name cannot start with a number.
//html <input type="text" id="character-name" name="attr_character_name" value="" placeholder="Character Name" /> //css #character-name { text-align: center; color: red; }
id Clickable Label text
Create "clickable" label text by using a linked label and input. Linked labels could replace various methods that use hidden checkboxes to simulate clickable text/buttons on a sheet.
//html <input id="attackMod1" name="attr_attackMod1" type="checkbox" value="1" class="hidden"> <label for="attackMod1" class="link">Apply Modifier</label> //css .sheet-hidden { display:none; } label.link:hover { cursor: help; text-decoration: underline; color: red; } input[type="checkbox"]:checked + label.link { color: red; }
id Sheet Anchors
Create links to jump to anchored elements of a sheet. Could be used as a "Navigational Menu/Table of Contents", or simply as clickable text that can quickly move to another section of a sheet.
//html <h2>Sheet Anchor example</h2> <h3 id="menu">Menu</h3> <ul> <li><a href="#Attacks">Attacks</a></li> <li><a href="#Skills">Skills</a></li> <li><a href="#Spells">Spells</a></li> </ul> <h3 id="Attacks">Attacks</h3> <p>"Lorem ipsum"</p> <h3 id="Skills">Skills</h3> <p>"Lorem ipsum"</p> <h3 id="Spells">Spells</h3> <p>"Lorem ipsum"</p> <hr> <p><a href="#menu">Menu</a></p>
Datalist
https://app.roll20.net/forum/post/9624869/html5-datalist-for-character-sheets
"Datalists are a helpful tool for sheet authors to guide players toward filling out input-fields. Datalists combines the precision of a dropdown-field with the flexibility of an input-field." -Peter B.
<input type="text" list="abilityScores" name="attr_abilityScore"> <datalist id="abilityScores"> <option value="@{strength}">Strength</option> <option value="@{dexterity}">Dexterity</option> <option value="@{constitution}">Constitution</option> <option value="@{intelligence}">Intelligence</option> <option value="@{wisdom}">Wisdom</option> <option value="@{charisma}">Charisma</option> </datalist>
<details>
A more simple way to create a collapsible section on a sheet than the old CSS tricks we have.
You have a <details>
where everything is inside, and then the <summary>
-element inside it determine what is shown when it's collapsed.
<details> <summary>Epcot Center</summary> <p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.</p> </details>
Popup
code snippet by Roll20 Dev exemplifying how popups can be implemented on sheets.
https://codepen.io/imprakash/pen/GgNMXO
See Also