-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Part3 #2
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
document.querySelector("#switch-theme").addEventListener('click', switchTheme); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. все хорошо, хотя в случае если нас ID то есть самый быстрый селектор по дереву, это document.getElementById() |
||
}); | ||
|
||
function switchTheme() { | ||
let bodyCardClassList = document.querySelector("body").classList; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. просто document.body – js движок уже сделал быстрые ссылки для популярных элементов |
||
bodyCardClassList.toggle("dark-theme"); | ||
bodyCardClassList.toggle("light-theme"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. по MCSS не видно вложенности в названии класса: всю вложенность до 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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"> | ||
© 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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
:root .light-theme { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. не ошибка, но одинаковые пары в hex коды можно сокращать в сборке с минификатором 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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
скрипты лучше выносить в отдельный файл, а те, что подключаются для работы с DOM, либо подключать как defer (отложено) либо в конце файла.
На наших масштабах сейчас это мы не заметим, но в проектах по-больше, при анализе кода, в т.ч. поисковиками, все это учитывается.