{"size": 815, "ext": "js", "max_stars_repo_path": "build/utils/title-change.js", "max_stars_repo_name": "sonseong10/motion", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/utils/title-change.js", "max_issues_repo_name": "sonseong10/motion", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/utils/title-change.js", "max_forks_repo_name": "sonseong10/motion", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2903225806, "max_line_length": 56, "alphanum_fraction": 0.5803680982}
"use strict";
const title = document.querySelector('.title-input');
const pageTitle = document.querySelector('.page-title');
title.onchange = () => {
    if (title.value) {
        document.title = `Motion - ${title.value}`;
        pageTitle.innerText = title.value;
        pageTitle.setAttribute('title', title.value);
        pageTitle.classList.add('is-active');
    }
    else {
        document.title = `Motion`;
        pageTitle.innerText = 'Untitle';
        pageTitle.removeAttribute('title');
        pageTitle.classList.remove('is-active');
    }
};
title.onfocus = () => {
    title.classList.remove('is-active');
};
title.onblur = () => {
    if (title.value) {
        title.classList.add('is-active');
    }
};
title.onkeydown = (e) => {
    if (e.key === 'Enter') {
        title.blur();
    }
};
