From bf7852bccce954aff2d7c94161f4d301a0f29684 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Wed, 16 Mar 2022 23:20:59 +0100 Subject: Initial commit w/ v1.0.0 --- .gitignore | 25 ++ api/add.php | 55 ++++ api/change-order.php | 26 ++ api/export.php | 43 +++ api/remove.php | 19 ++ composer.json | 5 + composer.lock | 706 ++++++++++++++++++++++++++++++++++++++++++++ favicon.svg | 15 + imgs/
thinkpad.png | Bin 0 -> 74515 bytes imgs/artix.png | Bin 0 -> 172380 bytes imgs/ring.png | Bin 0 -> 40517 bytes imgs/wiedzmin.png | Bin 0 -> 54020 bytes "imgs/\360\237\231\212.png" | Bin 0 -> 34517 bytes index.html | 76 +++++ index.php | 106 +++++++ package.json | 14 + pnpm-lock.yaml | 324 ++++++++++++++++++++ src/data.php | 38 +++ src/db.xml | 30 ++ src/main.js | 83 ++++++ src/main.ts | 67 +++++ src/style.css | 25 ++ start | 4 + tsconfig.json | 17 ++ 24 files changed, 1678 insertions(+) create mode 100644 .gitignore create mode 100644 api/add.php create mode 100644 api/change-order.php create mode 100644 api/export.php create mode 100644 api/remove.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 favicon.svg create mode 100644 imgs/
thinkpad.png create mode 100644 imgs/artix.png create mode 100644 imgs/ring.png create mode 100644 imgs/wiedzmin.png create mode 100644 "imgs/\360\237\231\212.png" create mode 100644 index.html create mode 100644 index.php create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 src/data.php create mode 100644 src/db.xml create mode 100644 src/main.js create mode 100644 src/main.ts create mode 100644 src/style.css create mode 100755 start create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccc5729 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local +vendor + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/api/add.php b/api/add.php new file mode 100644 index 0000000..b2e4c2d --- /dev/null +++ b/api/add.php @@ -0,0 +1,55 @@ +query('//game[@id="' . $id . '"]')->item(0); + var_dump($game); + var_dump($game->getElementsByTagName); + $xpath->query('//game[@id="' . $id . '"]/name')->item(0)->nodeValue = $name; + $xpath->query('//game[@id="' . $id . '"]/author')->item(0)->nodeValue = $author; + $xpath->query('//game[@id="' . $id . '"]/thumbnail')->item(0)->nodeValue = $thumbnail; + $xpath->query('//game[@id="' . $id . '"]/magazine')->item(0)->nodeValue = $magazine; +} else { + $root = $doc->getElementsByTagName("root")->item(0); + $game = $doc->createElement("game", ""); + + $mid = $doc->getElementsByTagName("mid")->item(0); + $game->setAttribute("id", $mid->nodeValue); + $mid->nodeValue = intval($mid->nodeValue) + 1; + + $count = $doc->getElementsByTagName("count")->item(0); + $count->nodeValue = intval($count->nodeValue) + 1; + $game->setAttribute("order", $count->nodeValue); + + $name = $doc->createElement("name", $name); + $author = $doc->createElement("author", $author); + $thumbnail = $doc->createElement("thumbnail", $thumbnail); + $magazine = $doc->createElement("magazine", $magazine); + $game->append($name); + $game->append($author); + $game->append($thumbnail); + $game->append($magazine); + + $root->appendChild($game); +} + +$doc->save($path); diff --git a/api/change-order.php b/api/change-order.php new file mode 100644 index 0000000..b498605 --- /dev/null +++ b/api/change-order.php @@ -0,0 +1,26 @@ +getElementsByTagName("count")->item(0)->nodeValue; +if ($new_order === strval(intval($count) + 1) || $new_order === "0") { + exit(); +} +$doc = get_doc(); +$xpath = new DOMXpath($doc); +$old_game = $xpath->query('//game[@order="' . $old_order . '"]')->item(0); +$new_game = $xpath->query('//game[@order="' . $new_order . '"]')->item(0); +$old_game->setAttribute("order", $new_order); +$new_game->setAttribute("order", $old_order); + +// check for first + +$doc->save($path); +header("Location: " . $_SERVER["HTTP_REFERER"]); diff --git a/api/export.php b/api/export.php new file mode 100644 index 0000000..77e36a2 --- /dev/null +++ b/api/export.php @@ -0,0 +1,43 @@ +getActiveSheet(); + +$active_sheet->setCellValue('A1', "Name"); +$active_sheet->setCellValue('B1', "Author"); +$active_sheet->setCellValue('C1', "Magazine"); +$row = 2; +foreach ($data as $d) { + $active_sheet->setCellValue('A' . $row, $d["name"]); + + $drawing = new Drawing(); + $drawing->setName($d["name"]); + $drawing->setPath("../imgs/" . $d["thumbnail"]); + $drawing->setHeight(200); + + $comment = $active_sheet->getComment('A' . $row); + $comment->setBackgroundImage($drawing); + $comment->setSizeAsBackgroundImage(); + + + $active_sheet->setCellValue('B' . $row, $d["author"]); + $active_sheet->setCellValue('C' . $row, $d["magazine"]); + $row++; +} + +$writer = new Xlsx($spreadsheet); +$writer->save('php://output'); + +$spreadsheet->disconnectWorksheets(); diff --git a/api/remove.php b/api/remove.php new file mode 100644 index 0000000..65f1a82 --- /dev/null +++ b/api/remove.php @@ -0,0 +1,19 @@ +query('//game[@id="' . $id . '"]')->item(0); +$game->parentNode->removeChild($game); + +$count = $doc->getElementsByTagName("count")->item(0); +$count->nodeValue = intval($count->nodeValue) - 1; + +$doc->save($path); +header("Location: " . $_SERVER["HTTP_REFERER"]); diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..509eee8 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "phpoffice/phpspreadsheet": "^1.22" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..40330c0 --- /dev/null +++ b/composer.lock @@ -0,0 +1,706 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e442471d898d555cab75123cc5bc6f4a", + "packages": [ + { + "name": "ezyang/htmlpurifier", + "version": "v4.14.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", + "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" + }, + "time": "2021-12-25T01:21:49+00:00" + }, + { + "name": "maennchen/zipstream-php", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58", + "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.5", + "php": ">= 7.1", + "psr/http-message": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "require-dev": { + "ext-zip": "*", + "guzzlehttp/guzzle": ">= 6.3", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": ">= 7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/master" + }, + "funding": [ + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2020-05-30T13:11:16+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "ab8bc271e404909db09ff2d5ffa1e538085c0f22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/ab8bc271e404909db09ff2d5ffa1e538085c0f22", + "reference": "ab8bc271e404909db09ff2d5ffa1e538085c0f22", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/php-compatibility": "^9.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.1" + }, + "time": "2021-06-29T15:32:53+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "c66aefcafb4f6c269510e9ac46b82619a904c576" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/c66aefcafb4f6c269510e9ac46b82619a904c576", + "reference": "c66aefcafb4f6c269510e9ac46b82619a904c576", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/php-compatibility": "^9.0", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.0" + }, + "time": "2021-07-01T19:01:15+00:00" + }, + { + "name": "myclabs/php-enum", + "version": "1.8.3", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "b942d263c641ddb5190929ff840c68f78713e937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937", + "reference": "b942d263c641ddb5190929ff840c68f78713e937", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.3" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "time": "2021-07-05T08:18:36+00:00" + }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.22.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "3a9e29b4f386a08a151a33578e80ef1747037a48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3a9e29b4f386a08a151a33578e80ef1747037a48", + "reference": "3a9e29b4f386a08a151a33578e80ef1747037a48", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.13", + "maennchen/zipstream-php": "^2.1", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.3 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "dompdf/dompdf": "^1.0", + "friendsofphp/php-cs-fixer": "^3.2", + "jpgraph/jpgraph": "^4.0", + "mpdf/mpdf": "8.0.17", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.6", + "tecnickcom/tcpdf": "^6.4" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)", + "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.22.0" + }, + "time": "2022-02-18T12:57:07+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..de4aedd --- /dev/null +++ b/favicon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/imgs/
thinkpad.png b/imgs/
thinkpad.png new file mode 100644 index 0000000..32e264e Binary files /dev/null and b/imgs/
thinkpad.png differ diff --git a/imgs/artix.png b/imgs/artix.png new file mode 100644 index 0000000..14abb0a Binary files /dev/null and b/imgs/artix.png differ diff --git a/imgs/ring.png b/imgs/ring.png new file mode 100644 index 0000000..74ce417 Binary files /dev/null and b/imgs/ring.png differ diff --git a/imgs/wiedzmin.png b/imgs/wiedzmin.png new file mode 100644 index 0000000..ccf9982 Binary files /dev/null and b/imgs/wiedzmin.png differ diff --git "a/imgs/\360\237\231\212.png" "b/imgs/\360\237\231\212.png" new file mode 100644 index 0000000..5425cc0 Binary files /dev/null and "b/imgs/\360\237\231\212.png" differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..a9e21d1 --- /dev/null +++ b/index.html @@ -0,0 +1,76 @@ + + + + + + + + Markup Language of Saddness + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Game nameThumbnailAuthorMagazine
aaaaaaailaaaaaane
aaaaaaailaaaaaane
+ + + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..ea19837 --- /dev/null +++ b/index.php @@ -0,0 +1,106 @@ + + + + + + + + Markup Language of Saddness + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Game nameThumbnailAuthorMagazine
+ + "> + "> + + +
+ + "> + "> + + +
" width="200" />
+ Export to xlsx + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..1882668 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "mlos", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "devDependencies": { + "typescript": "^4.5.4", + "vite": "^2.8.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..3503365 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,324 @@ +lockfileVersion: 5.3 + +specifiers: + typescript: ^4.5.4 + vite: ^2.8.0 + +devDependencies: + typescript: 4.6.2 + vite: 2.8.6 + +packages: + + /esbuild-android-64/0.14.25: + resolution: {integrity: sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.14.25: + resolution: {integrity: sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.14.25: + resolution: {integrity: sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.14.25: + resolution: {integrity: sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.14.25: + resolution: {integrity: sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.14.25: + resolution: {integrity: sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.14.25: + resolution: {integrity: sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.14.25: + resolution: {integrity: sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.14.25: + resolution: {integrity: sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.14.25: + resolution: {integrity: sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.14.25: + resolution: {integrity: sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.14.25: + resolution: {integrity: sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.14.25: + resolution: {integrity: sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.14.25: + resolution: {integrity: sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.14.25: + resolution: {integrity: sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.14.25: + resolution: {integrity: sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.14.25: + resolution: {integrity: sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.14.25: + resolution: {integrity: sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.14.25: + resolution: {integrity: sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.14.25: + resolution: {integrity: sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.14.25: + resolution: {integrity: sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + esbuild-android-64: 0.14.25 + esbuild-android-arm64: 0.14.25 + esbuild-darwin-64: 0.14.25 + esbuild-darwin-arm64: 0.14.25 + esbuild-freebsd-64: 0.14.25 + esbuild-freebsd-arm64: 0.14.25 + esbuild-linux-32: 0.14.25 + esbuild-linux-64: 0.14.25 + esbuild-linux-arm: 0.14.25 + esbuild-linux-arm64: 0.14.25 + esbuild-linux-mips64le: 0.14.25 + esbuild-linux-ppc64le: 0.14.25 + esbuild-linux-riscv64: 0.14.25 + esbuild-linux-s390x: 0.14.25 + esbuild-netbsd-64: 0.14.25 + esbuild-openbsd-64: 0.14.25 + esbuild-sunos-64: 0.14.25 + esbuild-windows-32: 0.14.25 + esbuild-windows-64: 0.14.25 + esbuild-windows-arm64: 0.14.25 + dev: true + + /fsevents/2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /is-core-module/2.8.1: + resolution: {integrity: sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==} + dependencies: + has: 1.0.3 + dev: true + + /nanoid/3.3.1: + resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /postcss/8.4.8: + resolution: {integrity: sha512-2tXEqGxrjvAO6U+CJzDL2Fk2kPHTv1jQsYkSoMeOis2SsYaXRO2COxTdQp99cYvif9JTXaAk9lYGc3VhJt7JPQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.1 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + + /resolve/1.22.0: + resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==} + hasBin: true + dependencies: + is-core-module: 2.8.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /rollup/2.70.0: + resolution: {integrity: sha512-iEzYw+syFxQ0X9RefVwhr8BA2TNJsTaX8L8dhyeyMECDbmiba+8UQzcu+xZdji0+JQ+s7kouQnw+9Oz5M19XKA==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /typescript/4.6.2: + resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /vite/2.8.6: + resolution: {integrity: sha512-e4H0QpludOVKkmOsRyqQ7LTcMUDF3mcgyNU4lmi0B5JUbe0ZxeBBl8VoZ8Y6Rfn9eFKYtdXNPcYK97ZwH+K2ug==} + engines: {node: '>=12.2.0'} + hasBin: true + peerDependencies: + less: '*' + sass: '*' + stylus: '*' + peerDependenciesMeta: + less: + optional: true + sass: + optional: true + stylus: + optional: true + dependencies: + esbuild: 0.14.25 + postcss: 8.4.8 + resolve: 1.22.0 + rollup: 2.70.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true diff --git a/src/data.php b/src/data.php new file mode 100644 index 0000000..aaf9d88 --- /dev/null +++ b/src/data.php @@ -0,0 +1,38 @@ +getElementsByTagName($name)->item(0)->nodeValue; +} +function get_doc(): DOMDocument +{ + $doc = new DOMDocument(); + $path = "/home/maks/school/clientApps/mlos/src/db.xml"; + $doc->load($path); + return $doc; +} +function get_data(): array +{ + $doc = get_doc(); + $out = []; + $games = $doc->getElementsByTagName("game"); + $i = 0; + while ($game = $games->item($i++)) { + $out[] = [ + "id" => $game->getAttribute("id"), + "order" => $game->getAttribute("order"), + "name" => get_node_value($game, "name"), + "thumbnail" => get_node_value($game, "thumbnail"), + "author" => get_node_value($game, "author"), + "magazine" => get_node_value($game, "magazine"), + ]; + } + usort($out, function ($a, $b) { + return $a["order"] - $b["order"]; + }); + return [$out, $doc->getElementsByTagName("count")->item(0)->nodeValue]; +} + +$doc = get_doc(); +$xpath = new DOMXpath($doc); +$game = $xpath->query('//game[@id="2"]/name')->item(0); +// var_dump($game); diff --git a/src/db.xml b/src/db.xml new file mode 100644 index 0000000..7579d72 --- /dev/null +++ b/src/db.xml @@ -0,0 +1,30 @@ + + + 12 + 5 + + Wiedzmiń + wiedzmin.png + Ąndrzej Sępkiewicz + Fantastyka + + + Władca pierścieni + ring.png + Tolkien Sapkowski + CDAction 1999 + + + Artix + artix.png + NotSoArchDev + Torvalds 1987 + + + 🥶 + 🤑 + 🙊.png + 🙊 + + +<b>Thinkpad</b><b>Lenovo</b><br>thinkpad.png<b>Intel(R)</b> diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..db9a00f --- /dev/null +++ b/src/main.js @@ -0,0 +1,83 @@ +//import './style.css'; +function edit(e) { + e.preventDefault(); + const tar = e.target; + const form = tar.parentNode; + form.onseeked; + const id = tar.dataset.id; + const tds = document.querySelectorAll(`[data-id="${id}"]`); + const names = ["name", "thumbnail", "author", "magazine",]; + tds.forEach((el, i) => { + if (el.tagName === "TD") { + const v = el.innerHTML; + el.innerHTML = ``; + } + else if (el === tar) { + el.style.display = "none"; + } + else { + const iel = el; + if (iel.type !== "hidden") { + iel.value = "Save"; + el.onclick = e => save(e, tds); + } + } + }); +} +//@ts-expect-error +window.edit = edit; +async function save(e, tds) { + console.log(tds); + const tar = e.target; + const body = new FormData(); + e.preventDefault(); + let i = 0; + tds.forEach((el) => { + if (el.tagName === "TD") { + const v = el.firstChild.value; + + if (i === 3) + el.innerHTML = v; + else + el.innerText = v; + + switch (i) { + case 0: + body.append("name", v); + break; + case 1: + body.append("thumbnail", v); + break; + case 2: + body.append("author", v); + break; + case 3: + body.append("magazine", v); + break; + } + i++; + } + else if (el === tar) { + const iel = el; + iel.value = "Remove"; + iel.onclick = null; + } + else { + const iel = el; + if (iel.type === "hidden") { + body.append(iel.name, iel.value); + } + else { + iel.style.display = ""; + } + } + }); + console.log(await (await fetch("api/add.php", { + method: "POST", + headers: { + // "Content-Type": "multipart/form-data", + }, + body + })).text()); +} +//# sourceMappingURL=main.js.map diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..c4b616b --- /dev/null +++ b/src/main.ts @@ -0,0 +1,67 @@ +import './style.css' + +function edit(e: PointerEvent) { + e.preventDefault(); + const tar = e.target as HTMLInputElement; + const form = tar.parentNode as HTMLFormElement + form.onseeked + const id = tar.dataset.id; + const tds = document.querySelectorAll(`[data-id="${id}"]`) as NodeListOf + const names = ["name", "thumbnail", "author", "magazine",] + tds.forEach((el, i) => { + if (el.tagName === "TD") { + const v = el.innerHTML; + el.innerHTML = `` + } else if (el === tar) { + el.style.display = "none" + } else { + const iel = (el as HTMLInputElement) + if (iel.type !== "hidden") { + iel.value = "Save" + el.onclick = e => save(e, tds); + } + } + }) +} +//@ts-expect-error +window.edit = edit; + +async function save(e: MouseEvent, tds: NodeListOf) { + console.log(tds) + const tar = e.target as HTMLInputElement + const body = new FormData(); + e.preventDefault(); + let i = 0; + tds.forEach((el) => { + if (el.tagName === "TD") { + const v = (el.firstChild as HTMLInputElement).value; + el.innerHTML = v + switch (i) { + case 0: body.append("name", v); break; + case 1: body.append("thumbnail", v); break; + case 2: body.append("author", v); break; + case 3: body.append("magazine", v); break; + } + i++; + } else if (el === tar) { + const iel = (el as HTMLInputElement) + iel.value = "Remove" + iel.onclick = null; + } else { + const iel = (el as HTMLInputElement) + if (iel.type === "hidden") { + body.append(iel.name, iel.value); + } else { + iel.style.display = "" + } + } + }) + await fetch("api/add.php", { + method: "POST", + headers: { + "Content-Type": "multipart/form-data", + }, + body + }); +} + diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..bbcdf49 --- /dev/null +++ b/src/style.css @@ -0,0 +1,25 @@ +header { + display: flex; + justify-content: center; + padding: 20px; +} +table { + margin: 0 auto; + border-spacing: 15px; +} +td { + margin: 100px; +} +header button { + font-size: 1em; + padding: 10px; +} +html { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + /* text-align: center; */ + color: #2c3e50; + font-size: 2em; + /* margin-top: 60px; */ +} diff --git a/start b/start new file mode 100755 index 0000000..5176169 --- /dev/null +++ b/start @@ -0,0 +1,4 @@ +#!/bin/sh +#st -e pnpm dev & +st -e php -S 0.0.0.0:8000 & +lvim . diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..6f1941d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ESNext", "DOM"], + "moduleResolution": "Node", + "strict": true, + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true + }, + "include": ["src"] +} -- cgit v1.3.1