summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Justfile2
-rw-r--r--index.php30
-rw-r--r--mtg-pdf.php2
3 files changed, 28 insertions, 6 deletions
diff --git a/Justfile b/Justfile
index b5bb857..9551f3b 100644
--- a/Justfile
+++ b/Justfile
@@ -1,2 +1,2 @@
generate deck:
- DECKLIST="{{deck}}" docker compose run php
+ DECKLIST="{{deck}}" docker compose run cli
diff --git a/index.php b/index.php
index 4f403a3..33ccfa2 100644
--- a/index.php
+++ b/index.php
@@ -6,9 +6,31 @@ if (isset($_POST['decklist'])) {
exit;
}
+$placeholder = <<<PLCHLDR
+QUANTITY NAME (SET) NUMBER
+3 Nissa, Who Shakes the World (WAR) 169
+PLCHLDR;
+
?>
-<form action="" method="POST">
- <textarea name="decklist"></textarea>
- <button>Submit</button>
-</form>
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <style>
+ * {
+ box-sizing: border-box;
+ }
+ textarea {
+ max-width: 100%;
+ }
+ </style>
+ </head>
+ <body>
+ <form action="" method="POST">
+ <textarea name="decklist" placeholder="<?php echo $placeholder; ?>" rows="10" cols="40" style="max-width: 100%;"></textarea>
+ <button>Submit</button>
+ </form>
+ </body>
+</html>
diff --git a/mtg-pdf.php b/mtg-pdf.php
index 9b705b0..087ae9e 100644
--- a/mtg-pdf.php
+++ b/mtg-pdf.php
@@ -112,7 +112,7 @@ $html = str_replace('{{imgs}}', implode('', $imgs), $template);
$request = Gotenberg::chromium('gotenberg:3000')
->paperSize(8.27, 11.7) # A4
- ->margins(0, 0, 0, 0)
+ ->margins(0.3, 0, 0.3, 0)
->outputFilename(date("Ymd_His"))
->html(Stream::string('index.html', $html));