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

Part 3 - Week 3 #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Binary file added cv/assets/view/Octocat.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 cv/assets/view/avatar.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 cv/assets/view/tg.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 cv/assets/view/vk.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 cv/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>My CV</title>
<link href="styles/style.css" rel="stylesheet"/>
</head>
<body class="dark">
<main class="business-card">
<article class="info">
<section class="info-general">
<div class="info-general__avatar">
<img id="avatar" src="assets/view/avatar.png" alt="my_avatar">
Copy link

Choose a reason for hiding this comment

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

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

</div>
<div class="info-general__name">
Sasha Rudnev
</div>
<div class="info-general__position">
Idler
</div>
<div class="info__links link">
Copy link

Choose a reason for hiding this comment

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

неожиданно на обертке видеть класс link. Линк обычно это <a> или js-кнопка.

<section class="link__github">
<a href="https://github.com/Ralex2105">
Copy link

Choose a reason for hiding this comment

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

скорее вот это должен быть .link

<img id="github" src="assets/view/Octocat.png" alt="github">
</a>
</section>
<section class="link__vk">
Copy link

Choose a reason for hiding this comment

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

section, по-смыслу (семантически) что-то более крупное - секция страницы с контентом. Для одной ссылки это мелкова-то.

<a href="https://github.com/Ralex2105">
<img id="vk" src="assets/view/vk.png" alt="vk">
</a>
</section>
<section class="link__tg">
<a href="https://github.com/Ralex2105">
Copy link

Choose a reason for hiding this comment

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

рекомендую ссылкам всегда давать классы, это обычно наиболее важные части страницы.
Как правило каждая ссылка обычно носит базовый класс ссылки (скажем, link), которая управляет тем, как отображаются ссылки на всем сайте/портале без учета специфичных стилей какого-то конкретного места на странице. Например все ссылки по базе - синие. А в оповещении - красные.

Тогда базовые стили будет
.link {color: blue}

а в оповещении оверайд:
.notification .link {color: red}

или как элемент:
.notification__link {color: red}

<img id="telegram" src="assets/view/tg.png" alt="telegram">
</a>
</section>
</div>
<section class="info-general__download-button">
<button id="download-button" type="submit">Download CV</button>
</section>
</section>
<footer class="info-general__copyright">©2021 All rights reserved.</footer>
Copy link

Choose a reason for hiding this comment

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

а тут футер хорошо смотрится

</article>
<article class="experience">
<section class="experience-general">
<div class="experience-general__name">
Саша Руднев
</div>
<div class="experience-general__position">
Бездельник
</div>
<section class="change-theme" onclick="script()">
<button id="switch" type="submit">Change theme</button>
</section>
</section>
</article>
<script type="text/javascript" src="script.js"></script>
</main>
</body>
</html>
7 changes: 7 additions & 0 deletions cv/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function script() {
Copy link

Choose a reason for hiding this comment

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

в названии лучше отражать логику работы функции. Будет проще читать код и стектрейс.

if (document.body.classList.contains("dark")) {
document.body.classList.replace("dark", "light");
} else {
document.body.classList.replace("light", "dark");
}
}
134 changes: 134 additions & 0 deletions cv/styles/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
@import "themes.css";

html {
height: 100%;
}

body {
display: flex;
height: 100%;
justify-content: center;
align-items: center;
font-family: Helevetica, sans-serif;
}

.business-card {
width: 1127px;
height: 595px;
display: flex;
left: 0;
top:0;
background: var(--bg);
border-radius: 30px;
color: var(--text);
}

.info {
width: 380px;
display: flex;
flex-direction: column;
align-items: center;
}

.info-general {
height: 563px;
display: flex;
flex-direction: column;
justify-self: center;
align-items: center;
margin-top: 70px;
}

#avatar {
border-radius: 50%;
width: 180px;
height: 180px;
box-shadow: 12px 12px 7px rgba(0,0,0,0.2);
}

.info-general__name{
margin-top: 25px;
margin-bottom: 8px;
font-size: 38px;
}

.info__links {
display: flex;
flex-direction: row;
margin-top: 16px;
margin-bottom: 51px;
}

.link__vk {
margin-left: 10px;
margin-right: 10px;
}

#github, #vk, #telegram {
width: 24px;
height: 24px;
border-radius: 50%;
background: var(--page);
}

#download-button {
color: var(--text);
padding: 12px 32px 12px 32px;
text-align: center;
font-size: 18px;
border-radius: 40px;
border: 3px solid var(--text);
background-color: var(--bg);
}

#download-button:hover {
background-color: var(--backgtround-another);
color: var(--text-another);
}

.info-general__copyright {
display: flex;
font-size: 14px;
margin-top: 66px;
margin-bottom: 14px;
height: 16px;
}

.experience-general {
width: 747px;
height: 595px;
display: flex;
flex-direction: column;
background: var(--background-experience);
border-radius: 30px;
justify-content: center;
align-items: center;
}

#switch {
color: var(--text);
padding: 10px 16px;
text-align: center;
font-size: 7px;
border-radius: 40px;
border: 3px solid var(--text);
background-color: var(--background-experience);
}

.change-theme {
margin-top: 10px;
}

#switch:hover {
background-color: var(--backgtround-another);
color: var(--text-another);
}

.experience-general__name {
font-size: 62px;
}

.experience-general__position {
font-size: 22px;
}

17 changes: 17 additions & 0 deletions cv/styles/themes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:root .dark {
Copy link

Choose a reason for hiding this comment

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

все правильно.
Можно использовать просто классы, без :root. Хотя базовые стили я бы ставил под рут вообще без класса, далее переписывал бы под соответствующими классами то, что надо.

--page: #C4C4C4;
--bg: #444444;
--background-experience: #222222;
--text: #FFFFFF;
--backgtround-another: #FFFFFF;
--text-another: #111111;
}

:root .light {
--page: #C4C4C4;
--bg: #FFFFFF;
--background-experience: #bababa;
--text: #111111;
--backgtround-another: #444444;
--text-another: #FFFFFF;
}