Files
cactoz.su/frontend/js/projects.js
T
cacto abd57e1cdf Добавить home_automatization_controllers в список проектов
Новый репозиторий на git.cactoz.su — прошивка ESP32 для зоны «Гроубокс»
(DHT22 + 3 реле, MQTT). home_automation_mobile пока не добавляю — репозиторий
пустой (0 коммитов).
2026-08-12 00:51:56 +05:00

101 lines
4.3 KiB
JavaScript

import { getLang, initLangToggle } from './i18n.js';
const DATA = {
ru: {
heading: 'ls projects/',
subheading: 'Пара вещей, которые я собрал сам, от идеи до продакшена.',
projects: [
{
name: 'home_automatization',
description:
'В разработке: архитектура и ТЗ готовы, микросервисы на Go и Laravel собираются. Первая зона — гроубокс (полив, свет, климат), дальше — весь дом.',
tags: ['в разработке', 'Go', 'Laravel', 'Docker', 'RabbitMQ', 'ClickHouse', 'gRPC', 'MQTT'],
url: 'https://git.cactoz.su/cacto/home_automatization',
linkLabel: 'открыть',
},
{
name: 'home_automatization_controllers',
description:
'Прошивка ESP32 для зоны «Гроубокс»: датчик DHT22 и три реле-актуатора (свет, полив, вентиляция), общается с платформой по MQTT.',
tags: ['C++', 'ESP32', 'Arduino', 'MQTT', 'DHT22'],
url: 'https://git.cactoz.su/cacto/home_automatization_controllers',
linkLabel: 'открыть',
},
{
name: 'cactoz.su',
description:
'Личный сайт-визитка: резюме, проекты и мультиплеерная мини-игра про танки. Тема — Матрица.',
tags: ['HTML/CSS/JS', 'C++', 'uWebSockets', 'Quintus.js', 'nginx', 'Docker'],
url: 'https://git.cactoz.su/cacto/cactoz.su',
linkLabel: 'открыть',
},
],
},
en: {
heading: 'ls projects/',
subheading: 'A couple of things I built myself, start to finish.',
projects: [
{
name: 'home_automatization',
description:
'Work in progress: architecture and spec are done, Go and Laravel microservices are being built. First zone is a grow box (watering, lighting, climate), the whole house comes next.',
tags: ['in progress', 'Go', 'Laravel', 'Docker', 'RabbitMQ', 'ClickHouse', 'gRPC', 'MQTT'],
url: 'https://git.cactoz.su/cacto/home_automatization',
linkLabel: 'open',
},
{
name: 'home_automatization_controllers',
description:
'ESP32 firmware for the grow-box zone: a DHT22 sensor and three relay actuators (light, watering, ventilation), talking to the platform over MQTT.',
tags: ['C++', 'ESP32', 'Arduino', 'MQTT', 'DHT22'],
url: 'https://git.cactoz.su/cacto/home_automatization_controllers',
linkLabel: 'open',
},
{
name: 'cactoz.su',
description:
'A personal portfolio site: résumé, projects and a small multiplayer tank game. Matrix theme throughout.',
tags: ['HTML/CSS/JS', 'C++', 'uWebSockets', 'Quintus.js', 'nginx', 'Docker'],
url: 'https://git.cactoz.su/cacto/cactoz.su',
linkLabel: 'open',
},
],
},
};
function render() {
const t = DATA[getLang()];
document.title = `${t.heading} — cacto`;
const heading = document.getElementById('projects-heading');
const subheading = document.getElementById('projects-subheading');
if (heading) heading.textContent = t.heading;
if (subheading) subheading.textContent = t.subheading;
const list = document.getElementById('project-list');
if (!list) return;
list.innerHTML = t.projects
.map(
(p) => `
<li class="project-card">
<div class="project-card__header">
<div class="project-card__name"><span class="project-card__perms">drwxr-xr-x</span> ${p.name}</div>
<a href="${p.url}" target="_blank" rel="noopener">${p.linkLabel} →</a>
</div>
<p class="project-card__desc">${p.description}</p>
<ul class="tag-list">
${p.tags.map((tag) => `<li class="tag">${tag}</li>`).join('')}
</ul>
</li>`
)
.join('');
}
// index.html-паттерн: projects.html уже содержит серверный RU-рендер этой
// же разметки, перерисовываем через JS только при переключении на EN.
document.title = `${DATA[getLang()].heading} — cacto`;
if (getLang() !== 'ru') {
render();
}
initLangToggle(render);