Compare commits

...

2 Commits

Author SHA1 Message Date
james c2c4d68837 6 commit 2024-05-21 10:30:06 +02:00
james d87b07ad38 6 commit 2024-05-21 10:12:02 +02:00
3 changed files with 22 additions and 2 deletions

View File

@ -5,8 +5,18 @@ let lista
fetch(url) fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
wyswietlSufiksy(data)
}); });
function wyswietlSufiksy(data) { function wyswietlSufiksy(data) {
data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`); data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`);
} }
document.getElementById("nieposortowane").onmouseover = function() {mouseOver()};
document.getElementById("nieposortowane").onmouseout = function() {mouseOut()};
function mouseOver() {
document.getElementById("nieposortowane").style.color = "red";
}
function mouseOut() {
document.getElementById("nieposortowane").style.color = "black";
}

View File

@ -10,8 +10,9 @@
</head> </head>
<body> <body>
<h1>Sortowanie Sufiksów</h1> <h1>Sortowanie Sufiksów</h1>
<button onclick="sortujSufiksy()">Sortuj Sufiksy</button> <button onclick="wyswietlSufiksy()">Wyswietl Sufiksy</button>
<h2>Nieposortowane Sufiksy</h2> <h2>Nieposortowane Sufiksy</h2>
<div class="pre" id="nieposortowane"></div> <div class="pre" id="nieposortowane"></div>
<h2>Posortowane Sufiksy</h2> <h2>Posortowane Sufiksy</h2>

View File

@ -50,6 +50,15 @@ h2 {
flex-direction: column; flex-direction: column;
} }
/* li:hover {
color: red;
font-weight: bold;
}
#nieposortowane:hover {
background-color: white;
} */
/* .pre { /* .pre {
background-color: #fff; background-color: #fff;