{"size": 1235, "ext": "js", "max_stars_repo_path": "WebContent/js/profile.js", "max_stars_repo_name": "yusungill/1-prj", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "WebContent/js/profile.js", "max_issues_repo_name": "yusungill/1-prj", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "WebContent/js/profile.js", "max_forks_repo_name": "yusungill/1-prj", "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": 27.4444444444, "max_line_length": 71, "alphanum_fraction": 0.636437247}
window.addEventListener("load", function () {
    const fileSection = document.querySelector(".profile-setting");
    const profileBtn = fileSection.querySelector(".profile-fileBtn");
    const triggerBtn = fileSection.querySelector(".profile-img-input");
    const img = triggerBtn.querySelector(".profile-img");
    const submit = document.querySelector(".profile-submit");
    const profileSetting = document.querySelector(".profile-click");


    triggerBtn.addEventListener("click", function () {
    	
        let event = new MouseEvent("click", {
            'view': window,
            'bubbles': true,
            'cancelable': true
        });

        profileBtn.dispatchEvent(event)

    })


    let reader = new FileReader();

    reader.onload = (readerEvent) => {
        img.setAttribute('src', readerEvent.target.result);
    };

    profileBtn.addEventListener("change", (changeEvent) => {

        let imgFile = changeEvent.target.files[0];
        reader.readAsDataURL(imgFile);
    });

    profileSetting.addEventListener("click", function () {

        fileSection.classList.toggle("d-none");
    })

    submit.addEventListener("click", function () {

        fileSection.classList.toggle("d-none");
    })

})