From c561c3bb614a3f039a7f767931ecb862a16c7711 Mon Sep 17 00:00:00 2001 From: amarcel Date: Tue, 21 May 2024 08:06:02 +0000 Subject: [PATCH] Upload files to "/" --- fetch.js | 14 +++++++++++++ get.php | 17 ++++++++++++++++ index.html | 25 +++++++++++++++++++++++ styles.css | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 fetch.js create mode 100644 get.php create mode 100644 index.html create mode 100644 styles.css diff --git a/fetch.js b/fetch.js new file mode 100644 index 0000000..a0097fb --- /dev/null +++ b/fetch.js @@ -0,0 +1,14 @@ +const url = "http://localhost/a1/get.php" +//const url = "http://qstack.pl:8080/z1/get.php" +let lista + +fetch(url) + .then(response => response.json()) + .then(data => { + sortujSufiksy(data) + }); + +function sortujSufiksy(data) { + + data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `
  • ${JSON.stringify(element.osoby)}
  • `); +} diff --git a/get.php b/get.php new file mode 100644 index 0000000..ee7250f --- /dev/null +++ b/get.php @@ -0,0 +1,17 @@ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..527f5b3 --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + + + + + + Sortowanie Sufiksów + + + + + +

    Nieposortowane Sufiksy

    +
    +

    Posortowane Sufiksy

    +
    + + +
  • +
      +
    1. + + + + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..e408fd3 --- /dev/null +++ b/styles.css @@ -0,0 +1,60 @@ +body { + font-family: Arial, sans-serif; + background-color: #f5f5f5; + color: #333; + margin: 0; + padding: 20px; + line-height: 1.6; +} + +h1 { + text-align: center; + color: #0056b3; + margin-bottom: 20px; +} + +input[type="text"] { + width: calc(100% - 22px); + padding: 10px; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; +} + +button { + display: block; + width: 100%; + padding: 10px; + background-color: #0056b3; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; +} + +button:hover { + background-color: #004494; +} + +h2 { + color: #0056b3; + border-bottom: 2px solid #0056b3; + padding-bottom: 5px; + margin-top: 20px; +} + +#nieposortowane { + display: flex; + flex-direction: column; +} + + +/* .pre { + background-color: #fff; + border: 1px solid #ccc; + padding: 10px; + border-radius: 4px; + overflow-x: auto; +} */