mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 13:02:38 +00:00
Merge branch 'master' into brew_themes_user_selection
This commit is contained in:
@@ -20,9 +20,9 @@ const PAGE_HEIGHT = 1056;
|
|||||||
|
|
||||||
const INITIAL_CONTENT = dedent`
|
const INITIAL_CONTENT = dedent`
|
||||||
<!DOCTYPE html><html><head>
|
<!DOCTYPE html><html><head>
|
||||||
<link href="//use.fontawesome.com/releases/v6.5.1/css/all.css" rel="stylesheet" />
|
<link href="//use.fontawesome.com/releases/v6.5.1/css/all.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
|
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
|
||||||
<link href='/homebrew/bundle.css' rel='stylesheet' />
|
<link href='/homebrew/bundle.css' type="text/css" rel='stylesheet' />
|
||||||
<base target=_blank>
|
<base target=_blank>
|
||||||
</head><body style='overflow: hidden'><div></div></body></html>`;
|
</head><body style='overflow: hidden'><div></div></body></html>`;
|
||||||
|
|
||||||
|
|||||||
@@ -240,18 +240,23 @@
|
|||||||
.navDropdownContainer {
|
.navDropdownContainer {
|
||||||
position : relative;
|
position : relative;
|
||||||
.navDropdown {
|
.navDropdown {
|
||||||
position : absolute;
|
position: absolute;
|
||||||
top : 28px;
|
top: 28px;
|
||||||
left : 0px;
|
right: 0px;
|
||||||
z-index : 10000;
|
z-index: 10000;
|
||||||
width : 100%;
|
width: max-content;
|
||||||
max-height : calc(100vh - 28px);
|
min-width:100%;
|
||||||
overflow : hidden auto;
|
max-height: calc(100vh - 28px);
|
||||||
|
overflow: hidden auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
.navItem {
|
.navItem {
|
||||||
position : relative;
|
position : relative;
|
||||||
display : block;
|
display : flex;
|
||||||
|
justify-content : space-between;
|
||||||
|
align-items : center;
|
||||||
width : 100%;
|
width : 100%;
|
||||||
padding : 8px 5px;
|
|
||||||
border : 1px solid #888888;
|
border : 1px solid #888888;
|
||||||
border-bottom : 0;
|
border-bottom : 0;
|
||||||
animation-name : glideDropDown;
|
animation-name : glideDropDown;
|
||||||
@@ -266,6 +271,7 @@
|
|||||||
position : relative;
|
position : relative;
|
||||||
box-sizing : border-box;
|
box-sizing : border-box;
|
||||||
display : block;
|
display : block;
|
||||||
|
max-width : 15em;
|
||||||
max-height : ~'calc(100vh - 28px)';
|
max-height : ~'calc(100vh - 28px)';
|
||||||
padding : 8px 5px 13px;
|
padding : 8px 5px 13px;
|
||||||
overflow : hidden auto;
|
overflow : hidden auto;
|
||||||
|
|||||||
@@ -1,12 +1,64 @@
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
const _ = require('lodash');
|
||||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
|
const { splitTextStyleAndMetadata } = require('../../../shared/helpers.js'); // Importing the function from helpers.js
|
||||||
|
|
||||||
module.exports = function(props){
|
const BREWKEY = 'homebrewery-new';
|
||||||
return <Nav.item
|
const STYLEKEY = 'homebrewery-new-style';
|
||||||
href='/new'
|
const METAKEY = 'homebrewery-new-meta';
|
||||||
newTab={true}
|
|
||||||
color='purple'
|
const NewBrew = () => {
|
||||||
icon='fas fa-plus-square'>
|
const handleFileChange = (e) => {
|
||||||
new
|
const file = e.target.files[0];
|
||||||
</Nav.item>;
|
if (file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = (e) => {
|
||||||
|
const fileContent = e.target.result;
|
||||||
|
const newBrew = {
|
||||||
|
text: fileContent,
|
||||||
|
style: ''
|
||||||
|
};
|
||||||
|
if(fileContent.startsWith('```metadata')) {
|
||||||
|
splitTextStyleAndMetadata(newBrew); // Modify newBrew directly
|
||||||
|
localStorage.setItem(BREWKEY, newBrew.text);
|
||||||
|
localStorage.setItem(STYLEKEY, newBrew.style);
|
||||||
|
localStorage.setItem(METAKEY, JSON.stringify(_.pick(newBrew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang'])));
|
||||||
|
window.location.href = '/new';
|
||||||
|
} else {
|
||||||
|
alert('This file is invalid, please, enter a valid file');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Nav.dropdown>
|
||||||
|
<Nav.item
|
||||||
|
className='new'
|
||||||
|
color='purple'
|
||||||
|
icon='fa-solid fa-plus-square'>
|
||||||
|
new
|
||||||
|
</Nav.item>
|
||||||
|
<Nav.item
|
||||||
|
className='fromBlank'
|
||||||
|
href='/new'
|
||||||
|
newTab={true}
|
||||||
|
color='purple'
|
||||||
|
icon='fa-solid fa-file'>
|
||||||
|
from blank
|
||||||
|
</Nav.item>
|
||||||
|
|
||||||
|
<Nav.item
|
||||||
|
className='fromFile'
|
||||||
|
color='purple'
|
||||||
|
icon='fa-solid fa-upload'
|
||||||
|
onClick={() => { document.getElementById('uploadTxt').click(); }}>
|
||||||
|
<input id="uploadTxt" className='newFromLocal' type="file" onChange={handleFileChange} style={{ display: 'none' }} />
|
||||||
|
from file
|
||||||
|
</Nav.item>
|
||||||
|
</Nav.dropdown>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = NewBrew;
|
||||||
|
|||||||
@@ -262,8 +262,8 @@ const ListPage = createClass({
|
|||||||
render : function(){
|
render : function(){
|
||||||
return <div className='listPage sitePage'>
|
return <div className='listPage sitePage'>
|
||||||
{/*<style>@layer V3_5ePHB, bundle;</style>*/}
|
{/*<style>@layer V3_5ePHB, bundle;</style>*/}
|
||||||
<link href='/themes/V3/Blank/style.css' rel='stylesheet'/>
|
<link href='/themes/V3/Blank/style.css' type="text/css" rel='stylesheet'/>
|
||||||
<link href='/themes/V3/5ePHB/style.css' rel='stylesheet'/>
|
<link href='/themes/V3/5ePHB/style.css' type="text/css" rel='stylesheet'/>
|
||||||
{this.props.navItems}
|
{this.props.navItems}
|
||||||
{this.renderSortOptions()}
|
{this.renderSortOptions()}
|
||||||
{this.renderTagsOptions()}
|
{this.renderTagsOptions()}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const PrintPage = createClass({
|
|||||||
style : styleStorage,
|
style : styleStorage,
|
||||||
renderer : metaStorage?.renderer || 'legacy',
|
renderer : metaStorage?.renderer || 'legacy',
|
||||||
theme : metaStorage?.theme || '5ePHB',
|
theme : metaStorage?.theme || '5ePHB',
|
||||||
lang : metaStorage?.lang || 'en'
|
lang : metaStorage?.lang || 'en'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ const template = async function(name, title='', props = {}){
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, height=device-height, interactive-widget=resizes-visual" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, height=device-height, interactive-widget=resizes-visual" />
|
||||||
<link href="//use.fontawesome.com/releases/v6.5.1/css/all.css" rel="stylesheet" />
|
<link href="//use.fontawesome.com/releases/v6.5.1/css/all.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
|
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
|
||||||
<link href=${`/${name}/bundle.css`} rel='stylesheet' />
|
<link href=${`/${name}/bundle.css`} type="text/css" rel='stylesheet' />
|
||||||
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
|
||||||
${ogMetaTags}
|
${ogMetaTags}
|
||||||
<meta name="twitter:card" content="summary">
|
<meta name="twitter:card" content="summary">
|
||||||
|
|||||||
40
package-lock.json
generated
40
package-lock.json
generated
@@ -11,8 +11,8 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.24.0",
|
"@babel/core": "^7.24.0",
|
||||||
"@babel/plugin-transform-runtime": "^7.23.9",
|
"@babel/plugin-transform-runtime": "^7.24.0",
|
||||||
"@babel/preset-env": "^7.23.9",
|
"@babel/preset-env": "^7.24.0",
|
||||||
"@babel/preset-react": "^7.23.3",
|
"@babel/preset-react": "^7.23.3",
|
||||||
"@googleapis/drive": "^8.7.0",
|
"@googleapis/drive": "^8.7.0",
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
@@ -340,9 +340,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/helper-plugin-utils": {
|
"node_modules/@babel/helper-plugin-utils": {
|
||||||
"version": "7.22.5",
|
"version": "7.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz",
|
||||||
"integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==",
|
"integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
@@ -1242,13 +1242,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-transform-object-rest-spread": {
|
"node_modules/@babel/plugin-transform-object-rest-spread": {
|
||||||
"version": "7.23.4",
|
"version": "7.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.0.tgz",
|
||||||
"integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==",
|
"integrity": "sha512-y/yKMm7buHpFFXfxVFS4Vk1ToRJDilIa6fKRioB9Vjichv58TDGXTvqV0dN7plobAmTW5eSEGXDngE+Mm+uO+w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/compat-data": "^7.23.3",
|
"@babel/compat-data": "^7.23.5",
|
||||||
"@babel/helper-compilation-targets": "^7.22.15",
|
"@babel/helper-compilation-targets": "^7.23.6",
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.24.0",
|
||||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
||||||
"@babel/plugin-transform-parameters": "^7.23.3"
|
"@babel/plugin-transform-parameters": "^7.23.3"
|
||||||
},
|
},
|
||||||
@@ -1456,12 +1456,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-transform-runtime": {
|
"node_modules/@babel/plugin-transform-runtime": {
|
||||||
"version": "7.23.9",
|
"version": "7.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.9.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.24.0.tgz",
|
||||||
"integrity": "sha512-A7clW3a0aSjm3ONU9o2HAILSegJCYlEZmOhmBRReVtIpY/Z/p7yIZ+wR41Z+UipwdGuqwtID/V/dOdZXjwi9gQ==",
|
"integrity": "sha512-zc0GA5IitLKJrSfXlXmp8KDqLrnGECK7YRfQBmEKg1NmBOQ7e+KuclBEKJgzifQeUYLdNiAw4B4bjyvzWVLiSA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/helper-module-imports": "^7.22.15",
|
"@babel/helper-module-imports": "^7.22.15",
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.24.0",
|
||||||
"babel-plugin-polyfill-corejs2": "^0.4.8",
|
"babel-plugin-polyfill-corejs2": "^0.4.8",
|
||||||
"babel-plugin-polyfill-corejs3": "^0.9.0",
|
"babel-plugin-polyfill-corejs3": "^0.9.0",
|
||||||
"babel-plugin-polyfill-regenerator": "^0.5.5",
|
"babel-plugin-polyfill-regenerator": "^0.5.5",
|
||||||
@@ -1605,13 +1605,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/preset-env": {
|
"node_modules/@babel/preset-env": {
|
||||||
"version": "7.23.9",
|
"version": "7.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.0.tgz",
|
||||||
"integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==",
|
"integrity": "sha512-ZxPEzV9IgvGn73iK0E6VB9/95Nd7aMFpbE0l8KQFDG70cOV9IxRP7Y2FUPmlK0v6ImlLqYX50iuZ3ZTVhOF2lA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/compat-data": "^7.23.5",
|
"@babel/compat-data": "^7.23.5",
|
||||||
"@babel/helper-compilation-targets": "^7.23.6",
|
"@babel/helper-compilation-targets": "^7.23.6",
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.24.0",
|
||||||
"@babel/helper-validator-option": "^7.23.5",
|
"@babel/helper-validator-option": "^7.23.5",
|
||||||
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3",
|
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3",
|
||||||
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3",
|
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3",
|
||||||
@@ -1664,7 +1664,7 @@
|
|||||||
"@babel/plugin-transform-new-target": "^7.23.3",
|
"@babel/plugin-transform-new-target": "^7.23.3",
|
||||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
|
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
|
||||||
"@babel/plugin-transform-numeric-separator": "^7.23.4",
|
"@babel/plugin-transform-numeric-separator": "^7.23.4",
|
||||||
"@babel/plugin-transform-object-rest-spread": "^7.23.4",
|
"@babel/plugin-transform-object-rest-spread": "^7.24.0",
|
||||||
"@babel/plugin-transform-object-super": "^7.23.3",
|
"@babel/plugin-transform-object-super": "^7.23.3",
|
||||||
"@babel/plugin-transform-optional-catch-binding": "^7.23.4",
|
"@babel/plugin-transform-optional-catch-binding": "^7.23.4",
|
||||||
"@babel/plugin-transform-optional-chaining": "^7.23.4",
|
"@babel/plugin-transform-optional-chaining": "^7.23.4",
|
||||||
|
|||||||
@@ -81,8 +81,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.24.0",
|
"@babel/core": "^7.24.0",
|
||||||
"@babel/plugin-transform-runtime": "^7.23.9",
|
"@babel/plugin-transform-runtime": "^7.24.0",
|
||||||
"@babel/preset-env": "^7.23.9",
|
"@babel/preset-env": "^7.24.0",
|
||||||
"@babel/preset-react": "^7.23.3",
|
"@babel/preset-react": "^7.23.3",
|
||||||
"@googleapis/drive": "^8.7.0",
|
"@googleapis/drive": "^8.7.0",
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
|
|||||||
@@ -17,21 +17,8 @@ const asyncHandler = require('express-async-handler');
|
|||||||
|
|
||||||
const { DEFAULT_BREW } = require('./brewDefaults.js');
|
const { DEFAULT_BREW } = require('./brewDefaults.js');
|
||||||
|
|
||||||
const splitTextStyleAndMetadata = (brew)=>{
|
const { splitTextStyleAndMetadata } = require('../shared/helpers.js');
|
||||||
brew.text = brew.text.replaceAll('\r\n', '\n');
|
|
||||||
if(brew.text.startsWith('```metadata')) {
|
|
||||||
const index = brew.text.indexOf('```\n\n');
|
|
||||||
const metadataSection = brew.text.slice(12, index - 1);
|
|
||||||
const metadata = yaml.load(metadataSection);
|
|
||||||
Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']));
|
|
||||||
brew.text = brew.text.slice(index + 5);
|
|
||||||
}
|
|
||||||
if(brew.text.startsWith('```css')) {
|
|
||||||
const index = brew.text.indexOf('```\n\n');
|
|
||||||
brew.style = brew.text.slice(7, index - 1);
|
|
||||||
brew.text = brew.text.slice(index + 5);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const sanitizeBrew = (brew, accessType)=>{
|
const sanitizeBrew = (brew, accessType)=>{
|
||||||
brew._id = undefined;
|
brew._id = undefined;
|
||||||
|
|||||||
@@ -271,8 +271,6 @@ const api = {
|
|||||||
res.status(200).send(saved);
|
res.status(200).send(saved);
|
||||||
},
|
},
|
||||||
getBrewThemeWithCSS : async (req, res)=>{
|
getBrewThemeWithCSS : async (req, res)=>{
|
||||||
console.log('I made it out!');
|
|
||||||
console.log(req.brew);
|
|
||||||
const brew = req.brew;
|
const brew = req.brew;
|
||||||
splitTextStyleAndMetadata(brew);
|
splitTextStyleAndMetadata(brew);
|
||||||
res.setHeader('Content-Type', 'text/css');
|
res.setHeader('Content-Type', 'text/css');
|
||||||
|
|||||||
22
shared/helpers.js
Normal file
22
shared/helpers.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const _ = require('lodash');
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const splitTextStyleAndMetadata = (brew) => {
|
||||||
|
brew.text = brew.text.replaceAll('\r\n', '\n');
|
||||||
|
if (brew.text.startsWith('```metadata')) {
|
||||||
|
const index = brew.text.indexOf('```\n\n');
|
||||||
|
const metadataSection = brew.text.slice(12, index - 1);
|
||||||
|
const metadata = yaml.load(metadataSection);
|
||||||
|
Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme', 'lang']));
|
||||||
|
brew.text = brew.text.slice(index + 5);
|
||||||
|
}
|
||||||
|
if (brew.text.startsWith('```css')) {
|
||||||
|
const index = brew.text.indexOf('```\n\n');
|
||||||
|
brew.style = brew.text.slice(7, index - 1);
|
||||||
|
brew.text = brew.text.slice(index + 5);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
splitTextStyleAndMetadata
|
||||||
|
};
|
||||||
@@ -436,7 +436,7 @@ const CodeEditor = createClass({
|
|||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <>
|
return <>
|
||||||
<link href={`../homebrew/cm-themes/${this.props.editorTheme}.css`} rel='stylesheet' />
|
<link href={`../homebrew/cm-themes/${this.props.editorTheme}.css`} type="text/css" rel='stylesheet' />
|
||||||
<div className='codeEditor' ref='editor' style={this.props.style}/>
|
<div className='codeEditor' ref='editor' style={this.props.style}/>
|
||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ const Nav = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`navDropdownContainer ${props.className}`}
|
<div className={`navDropdownContainer ${props.className ?? ''}`}
|
||||||
ref={myRef}
|
ref={myRef}
|
||||||
onMouseEnter = { props.trigger.includes('hover') ? ()=>handleDropdown(true) : undefined }
|
onMouseEnter = { props.trigger.includes('hover') ? ()=>handleDropdown(true) : undefined }
|
||||||
onMouseLeave = { props.trigger.includes('hover') ? ()=>handleDropdown(false) : undefined }
|
onMouseLeave = { props.trigger.includes('hover') ? ()=>handleDropdown(false) : undefined }
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ module.exports = function(props){
|
|||||||
|
|
||||||
return dedent`
|
return dedent`
|
||||||
{{toc,wide
|
{{toc,wide
|
||||||
# Table Of Contents
|
# Contents
|
||||||
|
|
||||||
${markdown}
|
${markdown}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -402,15 +402,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.pageNumber {
|
.pageNumber {
|
||||||
position : absolute;
|
|
||||||
right : 2px;
|
right : 2px;
|
||||||
bottom : 22px;
|
bottom : 22px;
|
||||||
width : 50px;
|
|
||||||
font-size : 0.9em;
|
|
||||||
color : var(--HB_Color_Footnotes);
|
color : var(--HB_Color_Footnotes);
|
||||||
text-align : center;
|
|
||||||
text-indent : 0;
|
|
||||||
&.auto::after { content : counter(phb-page-numbers); }
|
|
||||||
}
|
}
|
||||||
.footnote {
|
.footnote {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@page { margin : 0; }
|
@page { margin : 0; }
|
||||||
body { counter-reset : phb-page-numbers; }
|
body { counter-reset : page-numbers; }
|
||||||
* { -webkit-print-color-adjust : exact; }
|
* { -webkit-print-color-adjust : exact; }
|
||||||
|
|
||||||
//*****************************
|
//*****************************
|
||||||
@@ -47,7 +47,7 @@ body { counter-reset : phb-page-numbers; }
|
|||||||
height : 279.4mm;
|
height : 279.4mm;
|
||||||
padding : 1.4cm 1.9cm 1.7cm;
|
padding : 1.4cm 1.9cm 1.7cm;
|
||||||
overflow : hidden;
|
overflow : hidden;
|
||||||
counter-increment : phb-page-numbers;
|
counter-increment : page-numbers;
|
||||||
background-color : var(--HB_Color_Background);
|
background-color : var(--HB_Color_Background);
|
||||||
text-rendering : optimizeLegibility;
|
text-rendering : optimizeLegibility;
|
||||||
contain : size;
|
contain : size;
|
||||||
@@ -166,7 +166,6 @@ body { counter-reset : phb-page-numbers; }
|
|||||||
margin : 0;
|
margin : 0;
|
||||||
font-size : 120px;
|
font-size : 120px;
|
||||||
text-transform : uppercase;
|
text-transform : uppercase;
|
||||||
mix-blend-mode : overlay;
|
|
||||||
opacity : 30%;
|
opacity : 30%;
|
||||||
transform : rotate(-45deg);
|
transform : rotate(-45deg);
|
||||||
p { margin-bottom : none; }
|
p { margin-bottom : none; }
|
||||||
@@ -460,3 +459,22 @@ body { counter-reset : phb-page-numbers; }
|
|||||||
.homebreweryIcon.red { background-color : red; }
|
.homebreweryIcon.red { background-color : red; }
|
||||||
.homebreweryIcon.gold { background-image : linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); }
|
.homebreweryIcon.gold { background-image : linear-gradient(to top left, brown 22.5%, gold 40%, white 60%, gold 67.5%, brown 82.5%); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//*****************************
|
||||||
|
//* Page Number
|
||||||
|
//*****************************/
|
||||||
|
.page {
|
||||||
|
.pageNumber {
|
||||||
|
position : absolute;
|
||||||
|
right : 30px;
|
||||||
|
bottom : 30px;
|
||||||
|
width : 50px;
|
||||||
|
font-size : 0.9em;
|
||||||
|
text-align : center;
|
||||||
|
&.auto::after { content : counter(page-numbers); }
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(even) {
|
||||||
|
.pageNumber { left : 30px; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -374,17 +374,9 @@
|
|||||||
}
|
}
|
||||||
.pageNumber{
|
.pageNumber{
|
||||||
font-family : FrederickaTheGreat;
|
font-family : FrederickaTheGreat;
|
||||||
position : absolute;
|
|
||||||
right : 3cm;
|
right : 3cm;
|
||||||
bottom : 1.25cm;
|
bottom : 1.25cm;
|
||||||
width : 50px;
|
|
||||||
font-size : 0.9em;
|
|
||||||
color : var(--HB_Color_HeaderText);
|
color : var(--HB_Color_HeaderText);
|
||||||
text-align : center;
|
|
||||||
text-indent : 0;
|
|
||||||
&.auto::after {
|
|
||||||
content : counter(phb-page-numbers);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.footnote{
|
.footnote{
|
||||||
position : absolute;
|
position : absolute;
|
||||||
|
|||||||
Reference in New Issue
Block a user