-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="pl"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Moja Strona</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<div id="container"></div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const container = document.getElementById('container'); | ||
|
||
// Funkcja do pobierania danych z pliku JSON | ||
async function fetchTexts() { | ||
try { | ||
const response = await fetch('text.json'); // Załaduj dane z pliku JSON | ||
const texts = await response.json(); | ||
createSquares(texts); | ||
} catch (error) { | ||
console.error('Błąd podczas pobierania danych:', error); | ||
} | ||
} | ||
|
||
// Funkcja do tworzenia kwadratów z tekstem | ||
function createSquares(textArray) { | ||
textArray.forEach(text => { | ||
const square = document.createElement('div'); | ||
square.classList.add('square'); | ||
square.textContent = text; | ||
container.appendChild(square); | ||
}); | ||
} | ||
|
||
// Wywołanie funkcji pobierającej dane z JSON | ||
fetchTexts(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
background-color: #f4f4f4; | ||
} | ||
|
||
#container { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(512px, 1fr)); | ||
gap: 10px; | ||
width: 90%; | ||
margin-top: 100%; | ||
} | ||
.square { | ||
display: flex; | ||
background-image: url(img1.png); | ||
background-size: cover; | ||
background-position: center center; | ||
border: 2px solid #ddd; | ||
border-radius: 5px; | ||
padding: 20px; | ||
height: 350px; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: end; | ||
} | ||
|
||
.square:hover { | ||
background-color: #f0f0f0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
"Lorem ipsum dolor sit amet", | ||
"Consectetur adipiscing elit", | ||
"Sed do eiusmod tempor incididunt", | ||
"Ut labore et dolore magna aliqua", | ||
"Ut enim ad minim veniam", | ||
"Quis nostrud exercitation ullamco", | ||
"Laboris nisi ut aliquip ex ea commodo", | ||
"Duis aute irure dolor in reprehenderit", | ||
"In voluptate velit esse cillum", | ||
"Dolore eu fugiat nulla pariatur", | ||
"Excepteur sint occaecat cupidatat non", | ||
"Proident, sunt in culpa qui officia", | ||
"Delectus aut odit aut fugit", | ||
"Nulla pariatur exercitation ullamco laboris nisi", | ||
"Ut aliquip ex ea commodo consequat", | ||
"Duis aute irure dolor in reprehenderit", | ||
"Voluptate velit esse cillum dolore eu fugiat nulla pariatur", | ||
"Excepteur sint occaecat cupidatat non proident", | ||
"Sunt in culpa qui officia deserunt mollit anim id est laborum" | ||
|
||
] |