1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-28 23:41:30 +00:00

Shadows now being drawn as a :after element. Beauty

This commit is contained in:
Scott Tolksdorf
2017-03-26 15:10:36 -04:00
parent f99bcabad0
commit d5f04ca2b6
10 changed files with 95 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -4,8 +4,7 @@
ul:first-of-type{
margin-top : -0.5em;
margin-bottom : 0.5em;
padding-left : 1em;
text-indent : -1em;
list-style-type : none;
&+p{
text-indent : 0em;
@@ -15,36 +14,49 @@
.monster{
.breakAvoid();
.pseudoBorder();
padding : 10px 5px;
table{
color : @headerText;
.pseudoShadow();
padding : 17px 14px;
table:nth-of-type(1){
margin-bottom : 0.4em;
margin-top : 0.4em;
color : @crimson;
tbody tr { background-color: transparent };
}
ul:nth-of-type(1),ul:nth-of-type(2){
background-color : red;
list-style: none;
padding-left : 1em;
text-indent : -1em;
margin-bottom : 0.5em;
strong{
color : @crimson;
}
}
&:before{
top : 10px;
right : 0px;
bottom : 10px;
left : 0px;
//background-color : @monsterStatBackground;
//border-image-outset : 25px 17px;
border-image-slice : 10;
top : 8px;
right : 7px;
bottom : 19px;
left : 7px;
background-color : #FDF1DC;
border-image-slice : 8;
border-image-source : @monsterBorder;
border-image-width : 47px;
border-image-width : 8px;
}
&.wide{
column-count : 2;
}
}
.note{
.useSansSerif();
.breakAvoid();
.pseudoBorder();
.pseudoShadow();
margin : 9px 0px;
padding : 17px 5px;
padding : 17px 17px;
&:before{
top : 9px;
right : 0px;
bottom : 9px;
left : 0px;
right : 9px;
bottom : 19px;
left : 9px;
background-color : @green;
border-width : 11px;
border-image-outset : 9px 0px;

View File

@@ -6,6 +6,8 @@
@monsterBorder : url('/assets/homebrewery/phb_style/img/monster_border.png');
@noteBorder : url('/assets/homebrewery/phb_style/img/note_border.png');
@descriptiveBorder : url('/assets/homebrewery/phb_style/img/desc_border.png');
@shadowBorder : url('/assets/homebrewery/phb_style/img/shadow_border.png');
@phbBG : url('/assets/homebrewery/phb_style/img/phb_bg.jpg');
@darkBG : url('/assets/homebrewery/phb_style/img/phb_dark_bg.jpg');

View File

@@ -7,13 +7,32 @@
&:before{
content : '';
position : absolute;
z-index : -1;
z-index : -2;
box-sizing : border-box;
border-style : solid;
border-image-repeat : round;
}
}
.pseudoShadow(){
position : relative;
&:after{
content : '';
position : absolute;
z-index : -1;
box-sizing : border-box;
top : 4px;
right : 0px;
bottom : 10px;
left : 0px;
border-style : solid;
border-image-repeat : round;
border-image-slice : 13 13;
border-image-source : @shadowBorder;
border-image-width : 11px;
}
}
.useSansSerif(){
font-family : ScalySans;

View File

@@ -2,6 +2,39 @@ const _ = require('lodash');
const Data = require('./random.data.js');
const getStats = function(){
return '|' + _.times(6, function(){
const num = _.random(1,20);
const mod = Math.ceil(num/2 - 5)
return num + " (" + (mod >= 0 ? '+'+mod : mod ) + ")"
}).join('|') + '|';
}
const getAttributes = ()=>{
return `
- **Saving Throws**
- **Condition Immunities** " + genList(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3),
- **Senses** passive Perception " + _.random(3, 20),
- **Languages** ${Data.rand(["Common", "Pottymouth", "Gibberish", "Latin", "Jive"], 2).join(', ')}
- **Challenge** ${_.random(0, 15)} (${_.random(10,10000)} XP)
`;
}
const getAbilities = ()=>{
}
const getActions = ()=>{
}
module.exports = {
monster : ()=>{
@@ -21,15 +54,18 @@ module.exports = {
|STR|DEX|CON|INT|WIS|CHA|
|:---:|:---:|:---:|:---:|:---:|:---:|
${stats}
${getStats()}
---
- **Condition Immunities** " + genList(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3),
- **Senses** passive Perception " + _.random(3, 20),
- **Languages** " + genList(["Common", "Pottymouth", "Gibberish", "Latin", "Jive"], 2),
- **Challenge** " + _.random(0, 15) + " (" + _.random(10,10000)+ " XP)",
${getAttributes()}
---
Abilities
### Actions
}}`

View File

@@ -2,7 +2,8 @@ const _ = require('lodash');
const Data = {
rand : (name, max = 1, min = 1)=>{
return _.sampleSize(Data[name], _.random(min, max));
const data = (Data[name] ? Data[name] : name);
return _.sampleSize(data, _.random(min, max));
},
titles : [