Skip to content

Instantly share code, notes, and snippets.

View kaineer's full-sized avatar
:octocat:
⌨️ 🖱️

Sergey Kluchkovsky kaineer

:octocat:
⌨️ 🖱️
View GitHub Profile

Задание

  • Взять index.html и style.css из исходного задания
  • Взять script.js из этого gist-а.
  • Файлы с уровнями отсюда
  • И, теперь главное -- сделать так, чтобы когда мы перешли с уровня на уровень, имеющийся обработчик (созданный в 28 строке, в функции on()) отключался, для того, чтобы второй уровень работал нормально.
// util functions
const list = (arrLike) => Array.from(arrLike);
const first = (selector) => document.querySelector(selector);
const all = (selector) => list(document.querySelectorAll(selector));
const child = (el, index = 0) => list(el.children)[index];
const text = (el, value = null) => {
if (value === null) {
return el && el.textContent;
{
"width": 7,
"height": 7,
"walls": [
"0:0",
"1:0",
"2:0",
"3:0",
"4:0",
"5:0",
// Все, что было раньше плюс
const makeCell = (x, y) => {
return "<div class='item' data-pos='" + x + ":" + y + "'></div>"
}
const makeRow = (y) => {
let row = "<div class='row'>";
for (let x = 0; x <= 10; x++) {
row += makeCell(x, y);
<!doctype html>
<html>
<head>
<title>SVG sample</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<main></main>
<div class="arrows">
<svg
@kaineer
kaineer / plan.md
Last active August 12, 2025 07:32
что надо сделать (список неполный)
  • Добавляем новую ветку
  • Добавляем класс Organization в types
  • Делаем API списка организаций по сваггеру
  • Меняем API пользователя с учетом привязки к организациям
  • Добавляем список организаций пользователю
  • Добавляем в организацию список привязанных веток
  • UI списка групп
  • UI привязки веток к организации
@kaineer
kaineer / deepseek.md
Created June 2, 2025 06:30
Вот что об этом рассказывает deepseek

Реализация временной мёртвой зоны (TDZ) в механизме JavaScript

Временная мёртвая зона (TDZ) обеспечивается на нескольких уровнях работы JavaScript-движка. Вот как это реализовано технически:

1. Фаза компиляции (Parsing и Compilation)

На этапе компиляции движок JavaScript выполняет:

  • Анализ лексического окружения (LexicalEnvironment):
  • Для каждого блока создаётся отдельное лексическое окружение
@kaineer
kaineer / Bindings.jsx
Created May 20, 2025 10:20
bindHandler()
const bindHandler = (e) => {
if (pause) {
dispatch(setBind(e.code));
dispatch(setPause(false));
e.preventDefault();
e.stopPropagation();
}
}
@kaineer
kaineer / bind.js
Created May 20, 2025 10:19
setBind()
setBind: (state, action) => {
const code = action.payload;
if (state.direction) {
state.bindings[state.direction] = code;
state.direction = null;
}
},
@kaineer
kaineer / Form.jsx
Created April 14, 2025 10:09
method
useEffect(() => {
if (row) {
nameRef.current?.value = name;
cityRef.current?.value = city;
}
}, [row]);