let result;
$.ajax({
    method: "GET",
    url: "../json/data.json",
    dataType: "json",
}).done(function (msg) {
    result = [...msg];
    console.log(result);
    renderSec00(result);
    renderSec02(result);
});

function renderSec00(data) {
    let temp = data[0]['data'];
    let str = '';
    for(let i = 0; i < temp.length; i++){
        console.log(temp[i]['imgUrl']);
        str+= `<div class="sec-00__slider-${i+1}" onclick="window.open('${temp[i]['link']}');" style="background-image: url('${temp[i]['imgUrl']}');"></div>`
    }
    $('.sec-00__slider').html(str);
    console.log(str);
}

function renderSec02(data) {
    let temp = data[1]['data'];
    let str = '';
    for(let i = 0; i < temp.length; i++){
        console.log(temp[i]['imgUrl']);
        str+= `<div class="sec-02__slider-${i+1}" onclick="window.open('${temp[i]['link']}');" style="background-image: url('${temp[i]['imgUrl']}');"></div>`
    }
    $('.sec-02__slider').html(str);
    console.log(str);
}
