Eardwulf - Filipe
From Roll20 Wiki
character sheet code
<input type="text" name="attr_character_name" /> <input type="number" name="attr_attack" value="1d20+5" /> // example inputs that are used in the <input type="text" name="attr_attackname" /> <button type="roll" name="roll_attack" value="&{template:custom} {{title=@{attackname} }} {{Attack = [[@{attack}]]}} {{desc=**Special:** @{character_name} has **+2** to hit vs. anyone who is surprised. If you make a leap as part of the attack or have the high ground, this bonus is instead **+3**. }}" >Attack example</button> // roll button shows an example of how the roll template can be used <rolltemplate class="sheet-rolltemplate-custom"> <div class="sheet-container sheet-color-{{color}}"> <div class="sheet-header"> {{#title}}<div class="sheet-title">{{title}}</div>{{/title}} {{#subtitle}}<div class="sheet-subtitle">{{subtitle}}</div>{{/subtitle}} </div> <div class="sheet-content"> {{#allprops() title subtitle desc color}} <div class="sheet-key">{{key}}</div> <div class="sheet-value">{{value}}</div> {{/allprops() title subtitle desc color}} {{#desc}}<div class="sheet-desc">{{desc}}</div>{{/desc}} </div> </div> </rolltemplate> .sheet-rolltemplate-custom { margin-left: -37px; } .withoutavatars .sheet-rolltemplate-custom { margin-left: -7px; } .sheet-rolltemplate-custom .sheet-container { border: 1px solid; /* by default, the border is the same color as the header. You can change this here, e.g. to black */ border-color: var(--header-bg-color); } /* Header formatting - title and subtitle */ .sheet-rolltemplate-custom .sheet-header { background-color: var(--header-bg-color); /* change text-align to center to center the header text */ text-align: left; color: var(--header-text-color); padding: 5px; } .sheet-rolltemplate-custom .sheet-title { font-size:1.1em; } .sheet-rolltemplate-custom .sheet-subtitle { font-size:.9em; } /* example colors */ .sheet-rolltemplate-custom .sheet-container { /* this is the default color */ --header-bg-color: rgba(112,32,130,1); --header-text-color: #FFF; } .sheet-rolltemplate-custom .sheet-container.sheet-color-red { --header-bg-color: #F00; } .sheet-rolltemplate-custom .sheet-container.sheet-color-green { --header-bg-color: #0F0; --header-text-color: #000; } /* Allprops part */ .sheet-rolltemplate-custom .sheet-content { display: grid; background: #FFF; /* Header formatting - modify the column layout below */ grid-template-columns: auto auto; /* Line height to match default roll template */ line-height:1.4em; } .sheet-rolltemplate-custom .sheet-content > div { padding: 5px; } /* Left column */ .sheet-rolltemplate-custom .sheet-content .sheet-key { font-weight: bold; padding-right: 10px; text-align: right; } /* Empty rule, use this if you want to change the right column .sheet-rolltemplate-custom .sheet-value { } */ /* Make even-numbered rows grey */ .sheet-rolltemplate-custom .sheet-content :nth-child(4n+3), .sheet-rolltemplate-custom .sheet-content :nth-child(4n) { background:#EEE; } /* Description field */ .sheet-rolltemplate-custom .sheet-desc { grid-column: span 2; padding: 5px; text-align: center; }