$(function () {
    $(".inter_base.hydrated").click(function () {
        console.log($(this).index())
        $(this).addClass('active_nav').siblings().removeClass('active_nav');
        var c_index = $(this).index();
        var t = 0;
        switch (c_index) {
            case 0:
                t = 0;
                break;
            case 1:
                t = $(".color_person").offset().top;
                break;
            case 2:
                t = $(".color_work").offset().top;
                break;
            case 3:
                t = $(".color_love").offset().top;
        }
        console.log(t);
        $("html, body").animate({scrollTop:  Math.round(t) - 50});
    })
})
!function (x) {
    function w() {
        var v, u, t, tes, s = x.document, r = s.documentElement, a = r.getBoundingClientRect().width;
        if (!v && !u) {
            var n = !!x.navigator.appVersion.match(/AppleWebKit.*Mobile.*/);
            v = x.devicePixelRatio;
            tes = x.devicePixelRatio;
            v = n ? v : 1, u = 1 / v
        }
        if (a >= 640) {
            r.style.fontSize = "40px"
        } else {
            if (a <= 320) {
                r.style.fontSize = "20px"
            } else {
                r.style.fontSize = a / 320 * 20 + "px"
            }
        }
    }

    x.addEventListener("resize", function () {
        w()
    });
    w()
}(window)