Skip to content

Commit 9c050bf

Browse files
authored
Merge pull request #64 from aqerd/check
Minor fixes in frontend and backend
2 parents c7c1ae4 + 9683f93 commit 9c050bf

26 files changed

+170
-135
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: down push pull lint test format build up
22

3-
all: build up
3+
all: down build up
44

55
build:
66
docker-compose build

src/app/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def email(data):
9595
"error.html", msg_error="Paste your email in Profile page", error=501
9696
)
9797
return render_template(
98-
"error.html", msg_error=f"Error sending email: {e}", error=500
98+
"error.html", msg_error="Error sending email", error=500
9999
)
100100

101101

src/app/static/css/style.css

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ h2 {
5757
margin: 0;
5858
}
5959

60-
input, textarea, select {
60+
input,
61+
textarea,
62+
select {
6163
font-size: 1em;
6264
border-radius: 16px;
6365
outline: none;
@@ -83,7 +85,8 @@ textarea {
8385
height: 20vh;
8486
}
8587

86-
textarea::-webkit-resizer, textarea::-moz-resizer {
88+
textarea::-webkit-resizer,
89+
textarea::-moz-resizer {
8790
background: var(--hover-color);
8891
border-radius: 10px 0 8px 0;
8992
width: 10px !important;
@@ -103,11 +106,15 @@ textarea::-webkit-scrollbar-track {
103106
border-radius: 10px;
104107
}
105108

106-
input:focus, textarea:focus, select:focus {
109+
input:focus,
110+
textarea:focus,
111+
select:focus {
107112
border: 2px solid var(--border-color);
108113
}
109114

110-
input[type="date"], input::placeholder, textarea::placeholder {
115+
input[type="date"],
116+
input::placeholder,
117+
textarea::placeholder {
111118
color: var(--neutral-color);
112119
}
113120

@@ -126,8 +133,7 @@ input[type="number"]::-webkit-outer-spin-button {
126133
margin: 0;
127134
}
128135

129-
input[type="number"],
130-
input[type="date"] {
136+
input[type="number"] {
131137
-moz-appearance: textfield;
132138
}
133139

@@ -157,11 +163,10 @@ button {
157163
stroke: var(--main-color);
158164
}
159165

160-
.top-nav button:hover {
161-
background-color: var(--hover-color);
162-
}
163-
164-
button:hover {
166+
.top-nav button:hover,
167+
button:hover,
168+
.top-nav button:active,
169+
.link-button:hover {
165170
background-color: var(--hover-color);
166171
}
167172

@@ -303,11 +308,10 @@ main form {
303308
margin: 0;
304309
}
305310

306-
.top-nav button:active {
307-
background-color: var(--hover-color);
308-
}
309-
310-
a, a:hover, a:visited, b {
311+
a,
312+
a:hover,
313+
a:visited,
314+
b {
311315
color: var(--accent-color);
312316
}
313317

@@ -329,7 +333,8 @@ b {
329333
fill: var(--accent-color);
330334
}
331335

332-
.current, .current:hover {
336+
.current,
337+
.current:hover {
333338
color: var(--bg-color);
334339
background-color: var(--main-color);
335340
}
@@ -342,10 +347,6 @@ button.add-button {
342347
height: 42px;
343348
}
344349

345-
button.add-button:hover {
346-
background-color: var(--accent-color);
347-
}
348-
349350
.text-with-btn {
350351
display: grid;
351352
grid-template-columns: 1fr auto;
@@ -434,14 +435,17 @@ body.modal-open {
434435
display: block;
435436
}
436437

437-
.logo .logo-cvb {
438+
.logo .logo-cvb,
439+
.logo-social-bg,
440+
.logo-object {
438441
fill: var(--main-color);
439442
}
440443

441-
.logo-bg {
442-
stroke: none;
444+
.logo-stroke {
445+
stroke: var(--main-color);
443446
}
444447

448+
.logo-social,
445449
.logo-shape {
446450
fill: var(--bg-color);
447451
}
@@ -450,18 +454,15 @@ body.modal-open {
450454
fill: var(--interaction-color);
451455
}
452456

453-
.logo-object {
454-
fill: var(--main-color);
455-
}
456-
457-
.logo-stroke {
458-
stroke: var(--main-color);
457+
.logo-bg,
458+
.logo-social-bg {
459+
stroke: none;
460+
rx: 8px;
459461
}
460462

461463
.link-button {
462464
display: flex;
463465
flex-direction: column;
464-
justify-content: center;
465466
gap: 8px;
466467
padding: 16px;
467468
border-radius: 16px;
@@ -478,10 +479,6 @@ body.modal-open {
478479
gap: 16px;
479480
}
480481

481-
.link-button:hover {
482-
background-color: var(--hover-color);
483-
}
484-
485482
.link-button-top {
486483
display: flex;
487484
align-items: center;
@@ -571,7 +568,8 @@ body.modal-open {
571568
padding: 8px 12px;
572569
}
573570

574-
.small-text, button {
571+
.small-text,
572+
button {
575573
font-size: 16px;
576574
}
577575

src/app/static/data/links.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"github": {
3-
"link": "github.com",
4-
"name": "GitHub",
5-
"code": "GH",
6-
"logo": "/some/path/to/gh.svg"
7-
},
8-
"telegram": {
9-
"link": "t.me",
10-
"name": "Telegram",
11-
"code": "TG",
12-
"logo": "/some/path/to/tg.svg"
13-
}
14-
}
2+
"github": {
3+
"link": "github.com",
4+
"name": "GitHub",
5+
"code": "GH",
6+
"logo": "src/app/templates/icons/github.svg"
7+
},
8+
"telegram": {
9+
"link": "t.me",
10+
"name": "Telegram",
11+
"code": "TG",
12+
"logo": "src/app/templates/icons/telegram.svg"
13+
}
14+
}

src/app/static/js/change_button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ document.addEventListener('DOMContentLoaded', function() {
4242
window.location.href = '/email';
4343
}
4444
});
45-
});
45+
});

src/app/static/js/theme_toggle.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
document.addEventListener("DOMContentLoaded", () => {
2-
const themeStylesheet = document.getElementById("theme-stylesheet");
2+
let currentLink = document.getElementById("theme-stylesheet");
33
const themeButtons = document.querySelectorAll(".theme-toggle");
4-
const savedTheme = localStorage.getItem("theme") || "dark";
5-
themeStylesheet.href = `/static/css/themes/${savedTheme}.css`;
6-
themeButtons.forEach(button => {
7-
button.addEventListener("click", (e) => {
8-
const selectedTheme = e.currentTarget.dataset.theme;
9-
if (selectedTheme) {
10-
themeStylesheet.href = `/static/css/themes/${selectedTheme}.css`;
11-
localStorage.setItem("theme", selectedTheme);
4+
5+
const swapTheme = (selectedTheme) => {
6+
if (!selectedTheme || selectedTheme === localStorage.getItem("theme")) return;
7+
8+
const newLink = document.createElement("link");
9+
newLink.rel = "stylesheet";
10+
newLink.href = `/static/css/themes/${selectedTheme}.css`;
11+
12+
newLink.onload = () => {
13+
if (currentLink && currentLink.parentNode) {
14+
currentLink.parentNode.removeChild(currentLink);
1215
}
13-
});
16+
newLink.id = "theme-stylesheet";
17+
currentLink = newLink;
18+
};
19+
20+
document.head.appendChild(newLink);
21+
localStorage.setItem("theme", selectedTheme);
22+
};
23+
24+
themeButtons.forEach(button => {
25+
button.addEventListener("click", (e) => swapTheme(e.currentTarget.dataset.theme));
1426
});
1527
});

src/app/static/js/update_job.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ function addExperience(event) {
1616
const endYear = Math.floor(Math.random() * (currentYear - startYear + 1)) + startYear;
1717
const timelinePlaceholder = startYear === endYear ? `${startYear}` : `${startYear} - ${endYear}`;
1818

19+
const starIcon = document.getElementById('ai-icon-template')?.innerHTML.trim() || '';
20+
1921
const newExperienceDiv = document.createElement('div');
2022
newExperienceDiv.classList.add('experience-item');
2123
newExperienceDiv.innerHTML = `
@@ -36,11 +38,7 @@ function addExperience(event) {
3638
<div class="text-with-btn">
3739
<label for="job-description-${experienceCount}">Description</label>
3840
<button class="ai-btn" onclick="openModal(event)" data-id="job-description-${experienceCount}">
39-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
40-
<path class="star" d="M16 13L17.9799 19.0201L24 21L17.9799 22.9799L16 29L14.0201 22.9799L8 21L14.0201 19.0201L16 13Z" fill="black"/>
41-
<path class="star" d="M24 22L24.9899 25.0101L28 26L24.9899 26.9899L24 30L23.0101 26.9899L20 26L23.0101 25.0101L24 22Z" fill="black"/>
42-
<path class="star" d="M25 10L26.2374 13.7626L30 15L26.2374 16.2374L25 20L23.7626 16.2374L20 15L23.7626 13.7626L25 10Z" fill="black"/>
43-
</svg>
41+
${starIcon}
4442
</button>
4543
</div>
4644
<textarea id="job-description-${experienceCount}" name="job-description-${experienceCount}" placeholder="Describe your experience"></textarea>

src/app/static/js/update_project.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ function addProject(event) {
1717
const randomTld = tlds[Math.floor(Math.random() * tlds.length)];
1818
const projectUrl = `https://${randomProject.toLowerCase().replace(/\s+/g, '')}.${randomTld}`;
1919

20+
const starIcon = document.getElementById('ai-icon-template')?.innerHTML.trim() || '';
21+
2022
const newProjectDiv = document.createElement('div');
2123
newProjectDiv.classList.add('portfolio-item');
2224
newProjectDiv.innerHTML = `
@@ -37,11 +39,7 @@ function addProject(event) {
3739
<div class="text-with-btn">
3840
<label for="project-description-${projectCount}">Description</label>
3941
<button class="ai-btn" onclick="openModal(event)" data-id="project-description-${projectCount}">
40-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
41-
<path class="star" d="M16 13L17.9799 19.0201L24 21L17.9799 22.9799L16 29L14.0201 22.9799L8 21L14.0201 19.0201L16 13Z" fill="black"/>
42-
<path class="star" d="M24 22L24.9899 25.0101L28 26L24.9899 26.9899L24 30L23.0101 26.9899L20 26L23.0101 25.0101L24 22Z" fill="black"/>
43-
<path class="star" d="M25 10L26.2374 13.7626L30 15L26.2374 16.2374L25 20L23.7626 16.2374L20 15L23.7626 13.7626L25 10Z" fill="black"/>
44-
</svg>
42+
${starIcon}
4543
</button>
4644
</div>
4745
<textarea id="project-description-${projectCount}" name="project-description-${projectCount}" placeholder="Tell something about this project"></textarea>

src/app/templates/base.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)