Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 03/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/global.css">
<title>devmentor.pl - HTML & CSS: RWD - #03</title>
</head>
<body>

<main class="t">T</main>
<header class="p">P</header>
<side class="v">V</side>
<body>
<div class="p">
<picture>
<source srcset="small.jpg" media="(max-width: 599px)">
Expand Down
35 changes: 35 additions & 0 deletions 04/.devcontainer.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"folders": [
{
"path": "../.devcontainer"
},
{
"path": "../.git"
},
{
"path": "../.github"
},
{
"path": "../01"
},
{
"path": "../02"
},
{
"path": "../03"
},
{
"path": "."
},
{
"path": "../05"
},
{
"path": "../assets"
}
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "04",
"liveServer.settings.port": 5502
}
}
32 changes: 16 additions & 16 deletions 04/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
> :white_check_mark: *Jeśli będziesz mieć problem z rozwiązaniem tego zadania, poproś o pomoc na odpowiednim kanale na Slacku, tj. `s1e02-html-and-css-basics` (dotyczy [mentee](https://devmentor.pl/mentoring-javascript/)) lub na ogólnodostępnej i bezpłatnej [społeczności na Discordzie](https://devmentor.pl/discord). Pamiętaj, aby treść Twojego wpisu spełniała [odpowiednie kryteria](https://devmentor.pl/jak-prosic-o-pomoc/).*
> :white_check_mark: _Jeśli będziesz mieć problem z rozwiązaniem tego zadania, poproś o pomoc na odpowiednim kanale na Slacku, tj. `s1e02-html-and-css-basics` (dotyczy [mentee](https://devmentor.pl/mentoring-javascript/)) lub na ogólnodostępnej i bezpłatnej [społeczności na Discordzie](https://devmentor.pl/discord). Pamiętaj, aby treść Twojego wpisu spełniała [odpowiednie kryteria](https://devmentor.pl/jak-prosic-o-pomoc/)._

&nbsp;

# `#04` HTML i CSS: Responsywność

Nadszedł czas na przygotowanie responsywnego menu.
Nadszedł czas na przygotowanie responsywnego menu.

Będziemy mieli 2 wersje jego wyglądu:

- **mobilną**:
- elementy menu są umieszczone jeden pod drugim i zajmują całą szerokość okna przeglądarki,
- są widoczne dopiero po kliknięciu w ikonę "[hamburgera](https://www.youtube.com/watch?v=Al-0vNJD1JU)" (najlepiej bez użycia JavaScriptu),
- im bardziej zagnieżdżone elementy, tym bardziej odsunięte są od lewej krawędzi.
- **normalną**:
- elementy menu umieszczone są obok siebie w poziomie,
- tylko pierwszy poziom widoczny jest od razu,
- drugi poziom menu dostępny jest dopiero po najechaniu na rodzica:
- elementy występujące w rodzicu wyświetlane są jeden pod drugim,
- całość wyświetla się pod rodzicem.
- **mobilną**:
- elementy menu są umieszczone jeden pod drugim i zajmują całą szerokość okna przeglądarki,
- są widoczne dopiero po kliknięciu w ikonę "[hamburgera](https://www.youtube.com/watch?v=Al-0vNJD1JU)" (najlepiej bez użycia JavaScriptu),
- im bardziej zagnieżdżone elementy, tym bardziej odsunięte są od lewej krawędzi.
- **normalną**:
- elementy menu umieszczone są obok siebie w poziomie,
- tylko pierwszy poziom widoczny jest od razu,
- drugi poziom menu dostępny jest dopiero po najechaniu na rodzica:
- elementy występujące w rodzicu wyświetlane są jeden pod drugim,
- całość wyświetla się pod rodzicem.

Sam dobierz wygląd oraz stosowny breakpoint.
Sam dobierz wygląd oraz stosowny breakpoint.

Jak skończysz, to opublikuj swoje rozwiązanie za pomocą [GitHub Pages](https://pages.github.com/) i sprawdź, czy strona przechodzi [test na urządzenia mobilne](https://search.google.com/test/mobile-friendly).


&nbsp;
> :no_entry: *Jeśli nie posiadasz materiałów do tego zadania tj. **PDF + wideo, projekt + Code Review**, znajdziesz je na stronie [devmentor.pl](https://devmentor.pl/workshop-html-and-css-rwd/)*

> :arrow_left: [*poprzednie zadanie*](./../03) | [*następne zadanie*](./../05) :arrow_right:
> :no_entry: _Jeśli nie posiadasz materiałów do tego zadania tj. **PDF + wideo, projekt + Code Review**, znajdziesz je na stronie [devmentor.pl](https://devmentor.pl/workshop-html-and-css-rwd/)_

> :arrow_left: [_poprzednie zadanie_](./../03) | [_następne zadanie_](./../05) :arrow_right:
43 changes: 43 additions & 0 deletions 05/css/desktop.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
body {

}
.blue {
max-width: 1000px;
margin: 0 auto;

}

.header-container {
display: flex;
justify-content: space-between;
}

.logo {
margin: 0;
}

.menu {
position: static;
}


.green ul {
display: flex;
}

.label, .switcher {
display: none;
}

.article {
display: flex;
justify-content: space-between;
}

.menu .items li {
margin-right: 20px;
}

.menu .items li:last-child {
margin-right: 0;
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

56 changes: 56 additions & 0 deletions 05/css/mobile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
body {
}

.green {
border: 3px solid green;
}


.green ul {
display: none;
}


.green input:checked + ul {
display: block;
}

.blue {
border: 3px solid blue;
position: relative;
}

.yellow {
border: 3px solid yellow;
min-height: 50px;
}

.logo {
width: 50%;
margin: 0 auto;
}


.text, .text3, .text2 {
border: 1px solid yellow;
width: 100%;

}

.menu {
position: absolute;
top: 0;
right: 0;
}

.footer {
display: flex;
width: 100%;
margin: 0 auto;
display: flex;
}

.yellow.footer {
width: 50%;
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

69 changes: 69 additions & 0 deletions 05/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/mobile.css">
<link rel="stylesheet" href="css/desktop.css" media="screen and (min-width:800px)">
</head>
<body>
<header class="green">
<div class="blue header-container">

<h1 class="yellow logo">logo</h1>
<nav class="menu yellow">
<label class="label" for="menu-switcher">menu</label>
<input class="switcher" type="checkbox" id="menu-switcher">
<ul class="items">
<li>
<a href="#">start</a>
</li>
<li>
<a href="#">portfolio</a>
</li>
<li>
<a href="#">contact</a>
</li>
</ul>
</nav>
</div>
</header>
<section class="green">
<article class="blue article">
<p class="text"> text text text text text
text text text text text ext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text text
</p>
<p class="text2"> ext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text text </p>

</article>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Za elementem article powinnaś zamknąć section, aby było zgodnie z "projektem". Każdy "wiersz" ma swoje zielone obramowanie.

<section class="green">
<article class="blue article">
<p class="text"> text text text text text
text text text text text ext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text text
</p>
<p class="text2"> ext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text text </p>
<p class="text3"> ext text text text text
text text text text textext text text text text
text text text text textext text text text text
text text text text text </p>
</article>
</section>
<article class="blue footer">
<h1 class="yellow footer">logo</h1>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brakuje zamknięcia dla article. Ten element powinien dodatkowo posiadać section, o klasie green, aby mieć swoją zieloną ramkę.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zwróć uwagę, że teraz jeden zielony jest zagnieżdżony w drugim:

Screenshot 2024-07-19 at 06 12 12

</body>
</html>