Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Add About app
Browse files Browse the repository at this point in the history
  • Loading branch information
eclarke12 committed Nov 3, 2020
1 parent 1ecfcd2 commit 0585864
Show file tree
Hide file tree
Showing 10 changed files with 298 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.1.4] - 2020-11-03
### Added
- Confirmed compatibility with Foundry VTT 0.7.5

## [1.1.3] - 2020-10-06
### Added
- Português (Brasil) translation -- thanks @rinnocenti!
Expand Down
47 changes: 47 additions & 0 deletions about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* About this module FormApp
* @extends FormApplication
*/
class PinCushionAboutApp extends FormApplication {
constructor(options={}) {
super(options);
}

/**
* Call app default options
* @override
*/
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
id: "pin-cushion-about",
title: `About ${PinCushion.MODULE_TITLE}`,
template: `${PinCushion.PATH}/templates/about.hbs`,
popOut: true,
width: 500,
height: 480
});
}

/**
* Supplies data to the template
*/
async getData() {
return {
moduleName: PinCushion.MODULE_TITLE,
version: game.modules.get(PinCushion.MODULE_NAME).data.version,
patrons: await this.fetchPatrons()
}
}

/**
* Fetches a list of Patrons to display on the About page
*/
async fetchPatrons() {
const jsonPath = `${PinCushion.PATH}/patrons.json`;
const response = await fetch(jsonPath);
if (!response.ok) return null;

const json = await response.json();
return json;
}
}
Binary file added img/Digital-Patreon-Logo_FieryCoral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/Discord-Logo-Color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/deathsave-newlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"SETTINGS.AboutAppN": "About Pin Cushion",
"SETTINGS.AboutAppH": "Displays additional info about Pin Cushion",
"SETTINGS.ShowJournalPreviewN": "Show Journal Preview",
"SETTINGS.ShowJournalPreviewH": "Shows a Journal preview when hovering over a map pin",
"SETTINGS.PreviewTypeN": "Journal Preview Type",
Expand Down
137 changes: 137 additions & 0 deletions patrons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
[
{
"name": "John O"
},
{
"name": "Greg L"
},
{
"name": "Cody R"
},
{
"name": "4535992"
},
{
"name": "Lazytron"
},
{
"name": "Alessandro V"
},
{
"name": "Little A"
},
{
"name": "wmiller1000 ."
},
{
"name": "Bernie F"
},
{
"name": "Norc"
},
{
"name": "Sybearian"
},
{
"name": "Yicheng M"
},
{
"name": "Tsulex X"
},
{
"name": "Martin K"
},
{
"name": "Duncan"
},
{
"name": "Zondark"
},
{
"name": "cesarvillavi"
},
{
"name": "Sammy P"
},
{
"name": "Kelevra"
},
{
"name": "Gerry S"
},
{
"name": "Mr E"
},
{
"name": "Shawn M"
},
{
"name": "TotalFusionOne"
},
{
"name": "Leon"
},
{
"name": "Andrés A"
},
{
"name": "Alex B"
},
{
"name": "Cody S"
},
{
"name": "Apostol"
},
{
"name": "Ms E"
},
{
"name": "David B"
},
{
"name": "Trevor s"
},
{
"name": "David C"
},
{
"name": "Youness A"
},
{
"name": "Kyle R"
},
{
"name": "jlew"
},
{
"name": "Darshyne I"
},
{
"name": "Kevin J"
},
{
"name": "Saevar L"
},
{
"name": "Thomas Z"
},
{
"name": "Gene R"
},
{
"name": "Jose R"
},
{
"name": "Istvan S"
},
{
"name": "Mark W"
},
{
"name": "Shawn"
},
{
"name": "tim p"
}
]
52 changes: 52 additions & 0 deletions pin-cushion.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,56 @@
.pin-cushion-hud #content {
text-overflow: ellipsis;
text-align: left;
}

/* About App */
/* ABOUT */
#pin-cushion-about img {
border: none;
}

#pin-cushion-about .logo {
width: 600px;
}

#pin-cushion-about .version {
flex-grow: 0;
}

#pin-cushion-about div.patrons {
width: 100%;
}

#pin-cushion-about .patrons ol {
height: 175px;
border: 1px inset white;
list-style: none;
overflow: hidden scroll;
text-align: center;
padding: 2px;
}

#pin-cushion-about .patrons li:nth-child(odd) {
background: rgba(0,0,0,0.2);
}

#pin-cushion-about .patrons li {
font-size: x-large;
}

#pin-cushion-about footer div {
justify-content: center;
text-align: center;
}

#pin-cushion-about .death-save {
flex: 0 0 120px;
}

#pin-cushion-about .heart {
color: tomato;
}

#pin-cushion-about .patreon img {
flex: 0 0 100px;
}
13 changes: 13 additions & 0 deletions pin-cushion.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class PinCushion {
return "Pin Cushion";
}

static get PATH() {
return "modules/pin-cushion";
}

static get DIALOG() {
return {
content: `<div class="form-group"><p class="notes">Name:</p></label><input name="name" type="text"></div></br>`,
Expand Down Expand Up @@ -260,6 +264,15 @@ Hooks.on("hoverNote", (note, hovered) => {
* Helper function to register settings
*/
function registerSettings() {
game.settings.registerMenu(PinCushion.MODULE_NAME, "aboutApp", {
name: "SETTINGS.AboutAppN",
label: "SETTINGS.AboutAppN",
hint: "SETTINGS.AboutAppH",
icon: "fas fa-question",
type: PinCushionAboutApp,
restricted: false
});

game.settings.register(PinCushion.MODULE_NAME, "showJournalPreview", {
name: "SETTINGS.ShowJournalPreviewN",
hint: "SETTINGS.ShowJournalPreviewH",
Expand Down
43 changes: 43 additions & 0 deletions templates/about.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<form autocomplete="off" onsubmit="event.preventDefault()">
<div class="flexrow">
<h1>{{moduleName}}</h1>
<span class="version"><strong>v{{version}}</strong></span>
</div>
<div class="readme">
<p><a href="https://github.com/death-save/pin-cushion/wiki" title="Wiki"><i class="fas fa-book"></i> Wiki / More Info</a></p>
</div>
<div class="made-by flexcol">
<span class="made">
Made with <span class="heart">❤</span> by <strong>DEATH SAVE DEVELOPMENT</strong>
</span>
</div>
<div class="patrons">
<p>Thanks to the support of these awesome people:</p>
<ol class="patrons">
{{#each patrons}}
<li class="patron">{{this.name}}</li>
{{/each}}
</ol>
</div>
<footer class="flexrow">
<div class="logo">
<a href="https://deathsave.dev">
<img src="modules/pin-cushion/img/deathsave-newlogo.png" class="death-save" title="DEATH SAVE DEVELOPMENT" height="120px" width="120px">
</a>
</div>
<div class="discord">
<a href="https://discord.gg/wwH7DQc">
<img src="modules/pin-cushion/img/Discord-Logo-Color.png" title="Discord" height="100px" width="100px">
<br/>
<span>Join us on Discord</span>
</a>
</div>
<div class="patreon">
<a href="https://www.patreon.com/bePatron?u=21811555">
<img src="modules/pin-cushion/img/Digital-Patreon-Logo_FieryCoral.png" title="Patreon" height="100px" width="100px">
<br/>
<span>Become a Patron</span>
</a>
</div>
</footer>
</form>

0 comments on commit 0585864

Please sign in to comment.