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

Part5 #4

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
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.

15 changes: 15 additions & 0 deletions .idea/inspectionProfiles/Project_Default.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/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.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Galeev_Artur
# Galeev_Artur
54 changes: 54 additions & 0 deletions dist/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Если нужен такого рода импорт, придется поставить rollup scss plugin
// В остальных случаях все стили подтянет gulp, просто по маске src/styles/**/*.less и скомпилирует их в единый css файл
// import './styles/layout.scss';

function changeTheme() {
let bodyCardClassList = document.querySelector("body").classList;
bodyCardClassList.toggle("dark-theme");
bodyCardClassList.toggle("light-theme");
}

document.addEventListener("DOMContentLoaded", function (event) {
document.body.addEventListener('click', changeTheme);
});

function toElement(name, progress) {
let newSkillDiv = document.createElement('div');
newSkillDiv.classList.add('skills-list_skill');
newSkillDiv.innerHTML =
Copy link
Member

Choose a reason for hiding this comment

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

Почму используется конструкция раздельных строк кода через сложения, есть же литералы Hello! ${name.toString()}, также вызов toString() не имеет смысла переменная сама приводится к строке

' <section class="skill-left">' +
' <div class="skill-left_name">' +
' ' + name.toString() +
' </div>' +
' <div class="skill-left_progress">' +
Copy link
Member

Choose a reason for hiding this comment

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

Просто для информации есть возможность использовать темплейты для реализации https://developer.mozilla.org/ru/docs/Web/HTML/Element/template, но текущий способ тоже ок, если подправить на современные литералы строки

' <div class="skill_bar" style="width:' + progress.toString() + '%"></div>' +
' </div>' +
' </section>' +
' <section class="skill-right">' +
' <div class="skill-right_delete">' +
' <img class="skill-right_delete_img" src="assets/minus-light.png" alt="h">' +
' </div>' +
' </section>'
;
let img = newSkillDiv.getElementsByClassName("skill-right_delete_img").item(0);
img.addEventListener('click', () => {
newSkillDiv.remove();
});
return newSkillDiv;
}


var list = document.getElementById('skills_list');
var applyBtn = document.getElementById("apply-button");
var nameField = document.getElementById("name");
var numberField = document.getElementById("number");

// Example
list.appendChild(toElement('JAVA', 90));
list.appendChild(toElement('C++', 60));

applyBtn.addEventListener('click', () => {
if (!(nameField.value === '') && !(numberField.value === '') ) {
list.appendChild(toElement(nameField.value, numberField.value));
}
});
Binary file added dist/assets/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 dist/assets/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 dist/assets/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 dist/assets/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.
74 changes: 74 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Curriculum vitae</title>
<!-- inject:css -->
<link rel="stylesheet" href="./style.css">
<!-- endinject -->
</head>
<body class="light-theme">
<div class="main-card">
<section class="left-part-wrapper">
<div class="left-part_main">
<div class="left-part_photo">
<img class="left-part_photo-img" src="assets/face.jpg" alt="photo"/>
</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="assets/vk-logo.png" height="24" alt="vk-logo">
</a>
<a href="https://www.telegram.me/coradead">
<img class="left-part_social-networks-img" src="assets/tg-logo.png" height="24" alt="telegram-logo">
</a>
<a href="https://www.github.com/coradead">
<img class="left-part_social-networks-img" src="assets/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-wrapper">
<div class="right-part_main">
<div class="right-part_second-page">
<div class="right-part_second-page_title">
Coding skills:
</div>
<div class="right-part_second-page_skills-list" id="skills_list">

</div>
<div class="right-part_second-page_new-skill_form">
<div class="form">
<input type="text" id="name" class="form_input" autocomplete="off" placeholder=" ">
<label for="name" class="form_label">Name of skill</label>
</div>
<p></p>
<div class="form">
<input type="number" id="number" class="form_input" autocomplete="off" placeholder=" ">
<label for="number" class="form_label">Level of skill</label>
</div>
<p></p>
<button id="apply-button" class="apply-button" role="button">ADD NEW</button>
</div>
</div>
</div>
</section>
</div>
<!-- inject:js -->
<script src="./app.js"></script>
<!-- endinject -->
</body>
</html>
Loading