Refactor Star Wars Journal module structure and styles
- Replaced `main.js` with `asc-starwars.js` and modularized journal sheet logic into `journalSheets.js`. - Updated `module.json` to use ES modules and adjusted script/style references accordingly. - Consolidated and enhanced CSS styles into `asc-starwars-journal.css` and added `asc-ffg-starwars.css`. - Removed deprecated `starwars-journal.css` and outdated journal sheet registration logic.
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
"minimum": "12",
|
||||
"verified": "12"
|
||||
},
|
||||
"scripts": ["scripts/main.js"],
|
||||
"styles": ["styles/starwars-journal.css"]
|
||||
"esmodules": ["scripts/asc-starwars.js"],
|
||||
"styles": [
|
||||
"styles/asc-ffg-starwars.css",
|
||||
"styles/asc-starwars-journal.css"
|
||||
]
|
||||
}
|
||||
11
src/scripts/asc-starwars.js
Normal file
11
src/scripts/asc-starwars.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import {StarWarsStyleJournalSheet} from "./journalSheets.js"
|
||||
// ui.notifications.info
|
||||
// Register the custom journal sheet
|
||||
|
||||
Hooks.once('ready', () => {
|
||||
console.log('ASC Star Wars Style Journal | Registering custom sheet...');
|
||||
Journal.registerSheet('asc-starwars-style-journal', StarWarsStyleJournalSheet, {
|
||||
label: 'Star Wars Style Journal',
|
||||
makeDefault: false // Set to true if you want this as the default
|
||||
});
|
||||
});
|
||||
7
src/scripts/journalSheets.js
Normal file
7
src/scripts/journalSheets.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export class StarWarsStyleJournalSheet extends JournalSheet {
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: [...(super.defaultOptions.classes || []), 'asc-starwars-customsheet'],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
class StarWarsJournalSheet extends JournalSheet {
|
||||
static get defaultOptions() {
|
||||
const options = super.defaultOptions;
|
||||
options.classes.push('asc-starwars-journal-sheet');
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
Hooks.on("ready", function() {
|
||||
console.log("Star Wars Style Journal | Registering the module's sheets.");
|
||||
//This code runs once the Foundry VTT software begins its initialization workflow
|
||||
DocumentSheetConfig.registerSheet(Journal, "asc-starwars-style-journal", StarWarsJournalSheet, {
|
||||
label: "Star Wars",
|
||||
types: ["base"],
|
||||
makeDefault: false
|
||||
});
|
||||
|
||||
console.log("Star Wars Style Journal | Ready.")
|
||||
});
|
||||
|
||||
Hooks.on("ready", function() {
|
||||
//This code runs once core initialization is ready and game data is available.
|
||||
});
|
||||
0
src/styles/asc-ffg-starwars.css
Normal file
0
src/styles/asc-ffg-starwars.css
Normal file
101
src/styles/asc-starwars-journal.css
Normal file
101
src/styles/asc-starwars-journal.css
Normal file
@@ -0,0 +1,101 @@
|
||||
@font-face {
|
||||
font-family: "News Cycle";
|
||||
src: url("../fonts/NewsCycle-Regular.ttf");
|
||||
}
|
||||
@font-face {
|
||||
font-family: "News Cycle";
|
||||
font-weight: bold;
|
||||
src: url("../fonts/NewsCycle-Bold.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: StarJedi;
|
||||
src: url("../fonts/StarJedi-DGRW.woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: SWCrawlTitle;
|
||||
src: url("../fonts/SWCrawlTitle.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: SWCrawlBody;
|
||||
src: url("../fonts/SWCrawlBody.ttf");
|
||||
}
|
||||
|
||||
.asc-starwars-customsheet .journal-entry-content, .editor-container {
|
||||
background-image:url(../artwork/stars.png) !important;
|
||||
background-repeat:repeat !important;
|
||||
background-position:center top !important;
|
||||
background-color:black !important;
|
||||
color: #ffd54e;
|
||||
font-family:SWCrawlBody;
|
||||
padding-top: 2rem;
|
||||
|
||||
.journal-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.editor-content {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
article {
|
||||
transform:perspective(300px) rotateX(10deg);
|
||||
}
|
||||
|
||||
article, .editor-content {
|
||||
font-size:larger;
|
||||
width:80%;
|
||||
margin:auto;
|
||||
|
||||
a.content-link {
|
||||
background: inherit;
|
||||
text-transform: uppercase;
|
||||
border: none;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
&.editor-content {
|
||||
p, strong, em {
|
||||
border: #686868BF 1px solid;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align:center;
|
||||
border-bottom:none;
|
||||
font-size:inherit;
|
||||
line-height:1.5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align:center;
|
||||
padding-bottom: 8px;
|
||||
border-bottom:solid #ffffff4a 1.1px;
|
||||
font-size:xxx-large;
|
||||
text-transform: lowercase;
|
||||
font-family:"SWCrawlTitle";
|
||||
}
|
||||
|
||||
em, strong {
|
||||
text-transform:uppercase;
|
||||
font-weight:bold;
|
||||
font-size:1.2em;
|
||||
font-style: inherit;
|
||||
}
|
||||
|
||||
strong {
|
||||
|
||||
padding-right:.5em;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align:justify;
|
||||
margin-bottom: 1em;
|
||||
line-height:1.35em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "News Cycle";
|
||||
src: url("../fonts/NewsCycle-Regular.ttf");
|
||||
}
|
||||
@font-face {
|
||||
font-family: "News Cycle";
|
||||
font-weight: bold;
|
||||
src: url("../fonts/NewsCycle-Bold.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: StarJedi;
|
||||
src: url("../fonts/StarJedi-DGRW.woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: SWCrawlTitle;
|
||||
src: url("../fonts/SWCrawlTitle.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: SWCrawlBody;
|
||||
src: url("../fonts/SWCrawlBody.ttf");
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet p a.content-link {
|
||||
background: inherit;
|
||||
text-transform: uppercase;
|
||||
border: none;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet p a.mention,
|
||||
.asc-starwars-journal-sheet p a.entity-mention,
|
||||
.asc-starwars-journal-sheet p a.mention em,
|
||||
.asc-starwars-journal-sheet p a.entity-mention em{
|
||||
color: inherit;
|
||||
text-transform: uppercase;
|
||||
font-style: inherit;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet .single-page{
|
||||
background-image:url(../artwork/stars.png);
|
||||
background-repeat:repeat;
|
||||
background-position:center top;
|
||||
background-color:black;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article h1 {
|
||||
text-align:center;
|
||||
border-bottom:none;
|
||||
font-size:inherit;
|
||||
line-height:1.5em;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article h2{
|
||||
text-align:center;
|
||||
padding-bottom: 8px;
|
||||
border-bottom:solid white 1.1px;
|
||||
font-size:210%;
|
||||
text-transform: lowercase;
|
||||
font-family:"SWCrawlTitle";
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article {
|
||||
font-family:SWCrawlBody;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article p{
|
||||
text-align:justify;
|
||||
margin-bottom: 1em;
|
||||
line-height:1.35em;
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article .hook{
|
||||
text-transform:uppercase;
|
||||
font-weight:bold;
|
||||
padding-right:.5em;
|
||||
font-size:1.2em
|
||||
}
|
||||
|
||||
.asc-starwars-journal-sheet article {
|
||||
color:#ffd54e;
|
||||
font-size:larger;
|
||||
width:80%;
|
||||
margin:auto;
|
||||
transform:perspective(300px) rotateX(10deg)
|
||||
}
|
||||
Reference in New Issue
Block a user