Skip to content

Commit

Permalink
👷 Add some issue forms
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed May 16, 2024
1 parent 9e0da72 commit 0bcf97f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 🐛 Report a bug
description: Report a bug in CardFoldr
title: "[Bug] "
labels: ["bug"]
body:
- type: textarea
attributes:
label: Please describe the problem you are facing.
description: A clear and concise description of what the problem is. If it concerns a specific board game, please provide a link to it as well. Screenshots and other media also go a long way in helping to understand what you're talking about.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ✨ Request a feature
description: Request a new feature to implement in CardFoldr
title: "[Request] "
labels: ["enhancement"]
body:
- type: textarea
attributes:
label: Please describe the problem the feature is supposed to solve.
description: A clear and concise description of what the problem is. If it concerns a specific board game, please provide a link to it as well. Screenshots and other media also go a long way in helping to understand what you're talking about.
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen. If you've considered alternatives, please describe them as well. Don't feel ashamed to include mockups either, no matter how they look!
validations:
required: true
13 changes: 6 additions & 7 deletions assets/cardfoldr.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ const generatePdf = async () => {
const foldLineEdge = document.getElementById('foldLineEdge').value;
const downloadFilename = document.getElementById('downloadFilename').value;

const generateLog = document.getElementById('generate-output');
generateLog.textContent = "Collecting cards...";

const cards = [];
for (const cardElement of document.querySelectorAll('.card:not(.excluded)')) {
const frontImageElement = cardElement.getElementsByClassName('front')[0];
Expand All @@ -516,8 +519,6 @@ const generatePdf = async () => {
cards.push({ front: frontImage, back: backImage });
}

const generateLog = document.getElementById('generate-output');

const worker = new Worker('./assets/worker.js');
worker.onmessage = async (e) => {
if (e.data.state) {
Expand Down Expand Up @@ -575,8 +576,6 @@ const generatePdf = async () => {
reject(e);
}

generateLog.textContent = "Generating PDF...";

const title = `CardFoldr version of ${pdfname}`;
worker.postMessage({
generatePdf: {
Expand Down Expand Up @@ -707,6 +706,8 @@ document.getElementById('extractCards').addEventListener('click', async () => {
});

document.getElementById('generate').addEventListener('click', async () => {
document.getElementById('generate').getElementsByClassName("fa")[0].classList = "fa fa-spinner fa-spin";

const cards = document.getElementsByClassName('card');
if (cards.length === 0) {
alert("Please extract the cards first");
Expand All @@ -715,8 +716,6 @@ document.getElementById('generate').addEventListener('click', async () => {

clearOutput();

document.getElementById('generate').getElementsByClassName("fa")[0].classList = "fa fa-spinner fa-spin";

window.setTimeout(async () => {
await generatePdf();
document.getElementById('generate').getElementsByClassName("fa")[0].classList = "fa fa-flag-checkered";
Expand All @@ -738,7 +737,7 @@ window.onload = async () => {
element.addEventListener('wheel', (event) => {
const scrollAmount = parseInt(element.getAttribute('scroll-amount')) || 100;
if (event.deltaY !== 0) {
element.scrollLeft += event.deltaY > 0 ? 100 : -100;
element.scrollLeft += event.deltaY > 0 ? scrollAmount : -scrollAmount;
}
event.preventDefault();
});
Expand Down

0 comments on commit 0bcf97f

Please sign in to comment.