<!DOCTYPE html>
<html>
<head>
    <title>WIXON Blog</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/css/uikit.min.css"/>
    <link rel="stylesheet" href="/static/css/style.css"/>
    <!-- include libraries(jQuery, bootstrap) -->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <!-- include summernote css/js -->
    <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.4/imagesloaded.pkgd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/4.2.2/masonry.pkgd.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/js/uikit.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.6.16/js/uikit-icons.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

    {% block staticfiles %}{% endblock %}
</head>
<body>
    <div class="nav__div">
        <span class="uk-icon menu__open" uk-icon="icon: menu"></span>
        <span class="nav__title">WXNNER BLOG</span>
    </div>

    <div class="menu__wrap">
        <div class="menu__close"><button class="uk-icon" uk-icon="icon: close"></button></div>
        <div class="menu__box">
            <ul>
                <li><a href="#a">최신테크뉴스</a></li>
                <li><a href="#a">WXN 뉴스</a></li>
                <li><a href="#a">IT 요즘</a></li>
                <li><a href="#a">IT활용자료(윅슨전용)</a></li>
                <li><a href="#a">ETC</a></li>
            </ul>
        </div>
        <ul class="login__section">
            {% if g.is_login %}
                <li>
                    <a class="user__nav__open" href="#">{{ g.user_info.mb_name }} <span class="uk-icon" uk-icon="icon: triangle-down"></span></a>
                    <div class="login_nav">
                        <ul>
                            <li class="uk-active"><a href="/write">포스트 작성</a></li>
                            <li class="uk-active"><a target="_blank" href="http://www.wixon.co.kr/backS1te">관리자 페이지</a></li>
                            <li class="uk-active"><a href="/logout">LOGOUT</a></li>
                        </ul>
                    </div>
                </li>
            {% else %}
                <li class="login__btn"><a href="/login">LOGIN</a></li>
            {% endif %}
        </ul>
    </div>

    <div class="wixon__wrap">
        <header>
            <div class="header__inner">
                <h1><a href="/"><img src="/static/images/logo.png" alt="WIXON" /></a></h1>
            </div>
        </header>

    {% block content %}{% endblock %}

<script>
    $(document).ready(function(){
        // 로그인 메뉴 활성화
        let check_state = 0;

        $(".login__section .user__nav__open").click(function(){
            if(check_state != 0){
                $(this).find("span").attr("uk-icon","icon: triangle-down");
                check_state = 0;
            }else{
                 $(this).find("span").attr("uk-icon","icon: triangle-up");
                 check_state = 1;
            }
            $(".login_nav").toggle(300);
        });

        // 메뉴 토글
        $(".menu__open").click(function() {
            $(".menu__wrap").show();
            $(".nav__div").animate({"right":"-68px"}, 300, function(){
                $(".menu__wrap").animate({"right":"0"}, 700);
            });
        });

        $('.menu__close').click(function() {
            $(".menu__wrap").animate({"right":"-440px"}, 700, function(){
                $(".menu__wrap").hide();
                $(".nav__div").animate({"right":"0"}, 300);
            });
        });
    })
</script>