0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-12 21:52:42 +00:00

Renaming colors and a bunch of other things

This commit is contained in:
Scott Tolksdorf
2017-06-04 16:04:34 -04:00
parent 705adbe2c6
commit 10f9ac14c7
11 changed files with 35 additions and 31 deletions

View File

@@ -11,7 +11,10 @@ renderer.paragraph = function(text){
if(!matches) return `\n<p>${text}</p>\n`;
let matchIndex = 0;
const res = _.reduce(text.split(blockReg), (r, text) => {
console.log(text);
//if(text) r.push(text);
if(text) r.push(Markdown(text, {renderer : renderer, sanitize: true}));
const block = matches[matchIndex];
if(block && block[0] == '{'){
r.push(`\n\n<div class="block ${block.substring(2).split(',').join(' ')}">`);
@@ -30,7 +33,7 @@ renderer.image = function(href, title, text){
return `<img src="${href}" class="${text.split(',').join(' ')}"></img>`;
};
renderer.list = function(list, isOrdered, isDef){
if(isDef) return `<ul class='def'>${list}</ul>`;
if(isDef) return `<ul class='alt'>${list}</ul>`;
if(isOrdered) return `<ol>${list}</ol>`;
return `<ul>${list}</ul>`;
}

View File

@@ -14,7 +14,7 @@ var block = {
newline: /^\n+/,
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
hr: /^( *[-]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
nptable: noop,
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,

View File

@@ -15,10 +15,6 @@
tbody tr { background-color: transparent };
}
ul:nth-of-type(1),ul:nth-of-type(2){
list-style: none;
padding-left : 1em;
text-indent : -1em;
margin-bottom : 0.5em;
strong{
color : @crimson;
}
@@ -98,7 +94,7 @@
z-index : 150;
width : 200px;
font-size : 0.9em;
color : @gold;
color : @brown;
text-align : right;
}
//*****************************

View File

@@ -1,5 +1,13 @@
//TODO: come up with fun color names
@crimson : #58180D;
@red : #9c2b1b;
@brown : #c9ad6a; //brown?
@green : #e0e5c1;
@yellow : #faf7ea; //same as background?
@teal : blue;
@blue : blue;
@background : #EEE5CE;
@noteGreen : #e0e5c1;
@headerUnderline : #c9ad6a;
@@ -20,13 +28,7 @@
}
}
@crimson : #58180D;
@red : #9c2b1b;
@gold : #c9ad6a; //brown?
@green : #e0e5c1;
@yellow : #faf7ea; //same as background?
@teal : blue;
@blue : blue;
//TODO make a color mixin generator
@@ -34,5 +36,6 @@
.blue{ .colorElements(@blue); }
.green{ .colorElements(@green); }
.yellow{ .colorElements(@yellow); }
.gold{ .colorElements(@gold); }
.red{ .colorElements(@red); }
.brown{ .colorElements(fade(@brown, 50%)); }
.red{ .colorElements(fade(@red, 25%)); }
.crimson{ .colorElements(fade(@crimson, 20%)); }

View File

@@ -135,8 +135,11 @@ ol{
list-style-position : outside;
list-style-type : decimal;
}
ul.def{
p+ul.alt{
margin-top : -0.5em;
}
ul.alt{
margin-bottom : 0.5em;
padding-left : 0em;
list-style-position : outside;

View File

@@ -57,7 +57,7 @@
background-size : cover;
padding: 28px 63px;
box-sizing: border-box;
color : lighten(@gold, 0%);
color : lighten(@brown, 0%);
font-size: 0.7em;
}
&:nth-child(even){
@@ -81,7 +81,7 @@
bottom : 22px;
width : 50px;
font-size : 0.9em;
color : @gold;
color : @brown;
text-align : center;
}

View File

@@ -12,9 +12,7 @@ const Snips = _.merge(
const BrewSnippets = {
brew : ()=>{
return _.times(_.random(1,10), ()=>BrewSnippets.page()).join('\n\n\\page\n\n');
},
page : ()=>{

View File

@@ -12,9 +12,6 @@ const getStats = function(){
const getAttributes = ()=>{
return `
- **Saving Throws**
- **Condition Immunities** ${Data.rand(["groggy", "swagged", "weak-kneed", "buzzed", "groovy", "melancholy", "drunk"], 3).join(', ')},

View File

@@ -4,7 +4,7 @@ const Data = require('./random.data.js');
module.exports = {
note : ()=>{
return `{{note
return `{{note,red
##### ${Data.rand('abilities')}
${Data.rand('sentences', 6, 4).join(' ')}
}}`

View File

@@ -26,7 +26,7 @@ module.exports = {
const description = Data.rand('effects', 2).concat(Data.rand('effects2')).join(' ');
return `{{spell
return `
#### ${_.sample(Data.spellNames)}
*${_.sample(levels)}-level ${_.sample(schools)}*
- **Casting Time:** ${_.sample(['1 action', 'Reaction', '10 minutes', '1 hour'])}
@@ -34,8 +34,7 @@ module.exports = {
- **Components:** ${components}
- **Duration:** ${duration}
${description}
}}`;
${description}`;
},
@@ -47,6 +46,6 @@ ${description}
return `##### ${level} \n${spells} \n`;
}).join('\n');
return `{{fourColumn,fullPage\n${content}\n}}`;
return `{{fourColumn,fullPage,sansSerif\n${content}\n}}`;
}
}

View File

@@ -43,6 +43,11 @@ const columns = {
module.exports = {
table : () => {
let title = '';
if(Data.chance(5)) title = `##### ${Data.rand(Data.abilities)}\n`;
const rows = _.sample([4,6,8,10]);
let fns = [];
@@ -57,7 +62,7 @@ module.exports = {
const cols = _.map(fns, (fn)=>fn(rows));
return _.times(rows + 2, (i)=>{
return title + _.times(rows + 2, (i)=>{
if(i==1){
return '|' + _.map(cols, (col)=>col[i]).join('|') + '|';
}else{