{"size": 859, "ext": "js", "max_stars_repo_path": "app/js/modules/fontsLoader.js", "max_stars_repo_name": "max-tsymba/malachite", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/js/modules/fontsLoader.js", "max_issues_repo_name": "max-tsymba/malachite", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/js/modules/fontsLoader.js", "max_forks_repo_name": "max-tsymba/malachite", "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": 29.6206896552, "max_line_length": 97, "alphanum_fraction": 0.5157159488}
const fontsLoader = (url) => {

    let select = document.getElementsByName('font');
    let getFontsArray = [];

    select.forEach(option => {
        for(let i = 1; i < option.length; i++) {
            
            getFontsArray.push(option[i].textContent);
            let newStyle = document.createElement('style');
            newStyle.appendChild(document.createTextNode("\
            @font-face {\
                font-family: " + option[i].textContent + ";\
                src: url('../" + url + "/" + option[i].textContent + ".ttf') format('truetype');\
            }\
            "));
            document.head.appendChild(newStyle);
        }
    })

    select.forEach(option => {

        for(let i = 1; i < option.length; i++) {
            option[i].style.fontFamily = option[i].textContent;
        }
    })
};

export default fontsLoader;