Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part3 #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions frontEnd.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file added images/face.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/git-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tg-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/vk-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script>
Copy link

Choose a reason for hiding this comment

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

скрипты лучше выносить в отдельный файл, а те, что подключаются для работы с DOM, либо подключать как defer (отложено) либо в конце файла.
На наших масштабах сейчас это мы не заметим, но в проектах по-больше, при анализе кода, в т.ч. поисковиками, все это учитывается.

document.addEventListener("DOMContentLoaded", function(event) {
document.querySelector("#switch-theme").addEventListener('click', switchTheme);
Copy link

Choose a reason for hiding this comment

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

все хорошо, хотя в случае если нас ID то есть самый быстрый селектор по дереву, это document.getElementById()

});

function switchTheme() {
let bodyCardClassList = document.querySelector("body").classList;
Copy link

Choose a reason for hiding this comment

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

просто document.body – js движок уже сделал быстрые ссылки для популярных элементов

bodyCardClassList.toggle("dark-theme");
bodyCardClassList.toggle("light-theme");
Copy link

Choose a reason for hiding this comment

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

все правильно: переменная закеширвоана, toggle 👍

}
</script>
<meta charset="UTF-8">
<title>Curriculum vitae</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body id="switch-theme" class="dark-theme">
<div class="main-card">
<section class="left-part">
<div class="left-part_main">
<div class="left-part_photo">
<img class="left-part_photo-img" src="images/face.jpg" alt="photo"/>
Copy link

Choose a reason for hiding this comment

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

по MCSS не видно вложенности в названии класса:
left-part_photo-img -> left-part_photo_img

всю вложенность до 7го колена не отображаем, слишком длинно, но до 3-4 стараемся.

</div>
<div class="left-part_employee-FIO">
Alex Smith
</div>
<div class="left-part_employee-speciality">
Web Designer
</div>
<div class="left-part_social-networks">
<a href="https://www.vk.com/coradead">
<img class="left-part_social-networks-img" src="images/vk-logo.png" height="24" alt="vk-logo">
Copy link

Choose a reason for hiding this comment

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

тут скорее MCSS, тк для БЭМ неправильный синтаксис (блок__элемент). А в MCSS стараемся дать представление о вложенности хотя бы на 3 уровнях: left-part_social-networks_img

</a>
<a href="https://www.telegram.me/coradead">
<img class="left-part_social-networks-img" src="images/tg-logo.png" height="24" alt="telegram-logo">
</a>
<a href="https://www.github.com/coradead">
<img class="left-part_social-networks-img" src="images/git-logo.png" height="24" alt="github-logo">
</a>
</div>
<div class="left-part_download">
<button class="left-part_download-button">
Download CV
</button>
</div>
<footer class="left-part_copyright">
&#169 2021 All rights reserved.
</footer>
</div>
</section>
<section class="right-part">
<div class="right-part_main">
<div class="right-part_employee-name">Alex Smith</div>
Copy link

Choose a reason for hiding this comment

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

тут можно было бы выделить карточку юзера, как отдельный компонент, тк на самом деле сейчас у тебя мало компонентизации, – скоре один суперкомпонент страницы, который именует все от крупных до мелких деталей.

<div class="right-part_employee-position">Web Designer</div>
</div>
</section>
</div>
</body>
</html>
122 changes: 122 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
:root .light-theme {
Copy link

Choose a reason for hiding this comment

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

ок, и рут уже не нужен, раз есть конкретные классы

background-color: white;
}

:root .dark-theme {
background-color: black;
}

body {
background-color: #000000;
Copy link

Choose a reason for hiding this comment

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

не ошибка, но одинаковые пары в hex коды можно сокращать
00000 -> 000
112233 -> 123

в сборке с минификатором CSS это за нас это сделает сборка

display: flex;
justify-content: center;
margin: 4%;
}

.main-card {
background: #444444;
border-radius: 30px;

display: flex;

font-family: Helvetica, sans-serif;
font-style: normal;
font-weight: normal;
}

.left-part_main {
Copy link

Choose a reason for hiding this comment

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

рекомендую также разносить компоненты по своим файлам стилей

display: flex;
height: 595px;
width: 380px;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}

.left-part_photo-img {
width: 180px;
height: 180px;
margin-top: 70px;
border-radius: 50%;
box-shadow: 12px 12px 0 0 rgb(196 196 196);
}

.left-part_employee-FIO {
margin-top: 29px;

font-weight: bold;
font-size: 38px;

color: #FFFFFF;
}

.left-part_employee-speciality {
margin-top: 8px;
font-size: 20px;

color: #FFFFFF;
}

.left-part_social-networks {
width: 110px;
display: flex;
align-self: center;
flex-direction: row;
justify-content: space-around;
margin-top: 16px;
height: 24px;
}

.left-part_social-networks-img {
border-radius: 50%;
}

.left-part_download-button {
margin-top: 57px;
width: 168px;
height: 46px;

background: transparent;
border: 3px solid #FFFFFF;
box-sizing: border-box;
border-radius: 40px;

font-size: 17px;
line-height: 20px;
color: #FFFFFF;
}

.left-part_copyright {
margin-bottom: 16px;
display: flex;
flex-grow: 1;
flex-direction: row;
align-items: flex-end;
height: 16px;
font-size: 14px;
color: #FFFFFF;
}

.right-part_main {
color: #FFFFFF;
background-color: #222222;
width: 747px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 30px;
}

.right-part {
display: flex;
}

.right-part_employee-name {
font-size: 62px;
}

.right-part_employee-position {
margin-top: 8px;
font-size: 22px;
}