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 5 - JS #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
7 changes: 7 additions & 0 deletions cv/changeTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function changeTheme() {
if (document.body.classList.contains("dark")) {
document.body.classList.replace("dark", "light");
} else {
document.body.classList.replace("light", "dark");
}
}
10 changes: 10 additions & 0 deletions dist/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function changeTheme() {
let bodyCardClassList = document.querySelector("body").classList;
bodyCardClassList.toggle("dark-theme");
bodyCardClassList.toggle("light-theme");
}

document.addEventListener("DOMContentLoaded", function () {
const classname = document.querySelector('#switch-theme-button');
classname.addEventListener('click', changeTheme);
});
Binary file added dist/assets/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 dist/assets/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 dist/assets/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 dist/assets/vk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">

<head>
<meta charset="UTF-8">
<title>My CV</title>
<!-- inject:css -->
<link rel="stylesheet" href="./style.css">
<!-- endinject -->

</head>
<body class="dark-theme">
<main class="business-card">
<article class="info">
<section class="info-general">
<div class="info-general__avatar">
<img id="personal_avatar" src="assets/avatar.png" alt="my_avatar">
</div>
<div class="info-general__name">
Sasha Rudnev
</div>
<div class="info-general__position">
Idler
</div>
<section class="info__links">
<div class="link__github link">
<link href="https://github.com/Ralex2105">
<img id="github" src="assets/Octocat.png" alt="github">
</div>
<div class="link__vk link">
<link href="https://github.com/Ralex2105">
<img id="vk" src="assets/vk.png" alt="vk">
</div>
<div class="link__tg link">
<link href="https://github.com/Ralex2105">
<img id="telegram" src="assets/tg.png" alt="telegram">
</div>
</section>
<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>
</article>
<article class="experience">
<section class="experience-general">
<div class="experience-general__name">
Саша Руднев
</div>
<div class="experience-general__position">
Бездельник
</div>
<section class="switch-theme">
<button id="switch-theme-button" type="submit">Change theme</button>
</section>
</section>
</article>
</main>
<!-- inject:js -->
<script src="./app.js"></script>
<!-- endinject -->
</body>
</html>
Loading