<template>
    
    <div class="main-header">
        <div class="container-xl">
        <div class="line_flex">
            <div class="logo">
                <router-link to="/">
                    
                    <img src="@/assets/images/cuddlelogo.svg" alt="Cuddle">
                    <!-- <lottie-animation class="lottie-logo" path="./lottie/Logo-Cuddle.json" :width="147" :height="83" /> -->
                </router-link>
                <div class="menu-mobile" @click="openModal">
                    <span></span>
                    <span></span>
                    <span></span>
                </div>
            </div>
            <div class="menu">
                <div id="nav" class="nav-menu">
                    <router-link to="/impact-fund">Impact Fund</router-link>
                    <router-link to="/open-data">Open Data</router-link>
                    <router-link to="/faqs">FAQs</router-link>
                </div>
                <a href="#" target="_blank" class="btn-global">Wallet</a>
            </div>
        </div>
        <div class="main-social">
            <ul>
                <li><a href="#"><img src="@/assets/images/social/icon-1.png"></a></li>
                <li><a href="#"><img src="@/assets/images/social/icon-2.png"></a></li>
                <li><a href="#"><img src="@/assets/images/social/icon-3.png"></a></li>
                <li><a href="#"><img src="@/assets/images/social/icon-4.png"></a></li>
            </ul>
        </div>
        </div>
        <section class="modal_vx" v-if="item">
            <div class="modal_vx_content">
                <div class="modal-line">
                    <img src="@/assets/images/logo2.svg" alt="Cuddle">
                    <div class="close-modal" v-if="item" @click="closeModal">
                        <span class="close-modal-span"></span>
                        <span class="close-modal-span"></span>
                    </div>
                </div>
                <div class="menu">
                    <div id="nav" class="nav-menu" @click="item = false">
                        <router-link to="/impact-fund">Impact Fund</router-link>
                        <router-link to="/open-data">Open Data</router-link>
                        <router-link to="/faqs">FAQs</router-link>
                    </div>
                    <a href="#" target="_blank" class="btn-global">Wallet</a>
                </div>
                <div class="main-social">
                    <ul>
                        <li><a href="#"><img src="@/assets/images/social/icon-1.png"></a></li>
                        <li><a href="#"><img src="@/assets/images/social/icon-2.png"></a></li>
                        <li><a href="#"><img src="@/assets/images/social/icon-3.png"></a></li>
                        <li><a href="#"><img src="@/assets/images/social/icon-4.png"></a></li>
                    </ul>
                </div>
            </div>
        </section>
    </div>
</template>

<script>

// import LottieAnimation from "lottie-vuejs/src/LottieAnimation.vue";


export default {
  name: "TheHeader",
//   components: { LottieAnimation },
  data() {
       return {
           item: false,
       }
   },
  methods: {
    openModal(event) {
      if (event) {
        event.preventDefault();
      }
      this.item = true;
      window.scrollTo({
        top: 0,
        behavior: "smooth"
      });
    },
    closeModal(event) {
      if (event.target.className === "close-modal") this.item = false;
      if (event.target.className === "close-modal-span") this.item = false;
    }
   }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

@font-face {
    font-family: 'filsonproregularregular';
    src: url('../assets/fonts/filsonproregular-regular-webfont.woff2') format('woff2'),
         url('../assets/fonts/filsonproregular-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

$black: #2E3240;
$pink: #D551AD;


body {
    font-family: 'Fredoka One', cursive;
    font-weight: 500;
    background: #ffe2d1;
    word-break: break-word;
}

h1, h2, h3, h4, h5 {
    font-weight: 500;
}

img {
    max-width: 100%;
    height: auto;
}

input,
select,
textarea {
    text-shadow: 0 0 0 transparent;
    box-shadow: 0 0 0 transparent;
    outline: none !important;
}

select {
    appearance: none;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: none !important;
}

a {
    transition: all ease-in-out 0.3s;
}

ul {
    padding: 0;
    margin: 0;
}

:focus {
    outline: none;
}

.aligh-div-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

.col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-9 {
    flex: 0 0 75%;
    max-width: 75%;
}

@media (min-width: 768px) {
  .col-md-2 {
      flex: 0 0 16.666667%;
      max-width: 16.666667%;
  }
  .col-md-3 {
      flex: 0 0 25%;
      max-width: 25%;
  }
  .col-md-4 {
      flex: 0 0 33.333333%;
      max-width: 33.333333%;
  }
  .col-md-5 {
      flex: 0 0 41.666667%;
      max-width: 41.666667%;
  }
  .col-md-6 {
      flex: 0 0 50%;
      max-width: 50%;
  }
  .col-md-7 {
      flex: 0 0 58.333333%;
      max-width: 58.333333%;
  }
  .col-md-8 {
      flex: 0 0 66.666667%;
      max-width: 66.666667%;
  }
  .col-md-9 {
      flex: 0 0 75%;
      max-width: 75%;
  }
  .col-md-10 {
      flex: 0 0 83.333333%;
      max-width: 83.333333%;
  }
}

.col-mb {
  margin-bottom: 10px;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
}

.main-header {
  padding: 20px 30px;
  position: fixed;
  width: 100%;
  left: 0;
  top: 0;
  z-index: 99;
  box-sizing: border-box;
  .logo{
      img{
          width: 142px;
      }
  }
}

.container {
  width: 1440px;
  max-width: 100%;
  margin: 0 auto;
  @media(max-width:1440px) {
      width: 1200px;
  }
}

.container-xl {
    position: relative;
    width: 1800px;
    max-width: 100%;
    margin: 0 auto;
}

.line_flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.d-none {
  display: none !important;
  width: 0;
  height: 0;
  opacity: 0;
}

.btn-global {
    background: $black;
    text-decoration: none;
    color: #fff;
    font-size: 18px;
    line-height: 22px;
    padding: 10px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    img {
        margin-right: 15px;
        width: 30px;
    }
    @media(max-width:768px) {
        padding: 19px 30px;
    }
    @media(min-width:769px) {
        &:hover {
            background: $pink;
        }
    }
}

/*Menu*/
.menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    .nav-menu {
        margin-right: 50px;
        a {
            font-family: 'filsonproregularregular';
            color: #000;
            font-size: 18px;
            line-height: 22px;
            text-decoration: none;
            margin-left: 50px;
            @media(min-width: 1100px) {
                &:hover {
                    color: $pink;
                }
            }
        }
    }
}

/*Social*/

.main-social {
    position: absolute;
    right: 0px;
    top: 140px;
    ul {
        margin: 0;
        padding: 0;
        li {
            list-style: none;
            margin-bottom: 10px;
            a {
                display: flex;
                align-items: center;
                justify-content: center;
                background: $black;
                width: 50px;
                height: 50px;
                border-radius: 50%;
                text-decoration: none;
                img {
                    width: 25px;
                }
                @media(min-width:769px) {
                    &:hover {
                        background: $pink;
                    }
                }
            }
        }
    }
}

/*Responsive*/

.menu-mobile {
    display: none;
}

.main-app {
    width: 1920px;
    max-width: 100%;
    margin: 0 auto;
}

@media(min-width:769px) and (max-width:1200px) {
    .pd-mobile {
        padding: 0 30px;
        box-sizing: border-box;
    }
    .main-app {
        overflow: hidden;
    }
    .menu .nav-menu {
        margin-right: 30px;
    }
}

@media(max-width:768px) {
    .pd-mobile {
        padding: 0 15px;
        box-sizing: border-box;
    }
    .main-app {
        overflow: hidden;
    }
    .menu, .main-social {
        display: none;
    }
    .menu-mobile {
        width: 30px;
        height: 22px;
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        cursor: pointer;
        span {
            display: block;
            width: 100%;
            background: $black;
            height: 3px;
            border-radius: 100px;
        }
    }
    .modal_vx {
        position: fixed;
        top: 0px;
        left: 0px;
        width: 100%;
        height: 100%;
        padding: 0;
        z-index: 9;
        animation: modal 0.3s forwards;
        &::before {
            content: "";
            position: fixed;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            background: $pink;
            z-index: 9;
        }
        &_content {
            position: relative;
            z-index: 9;
            padding: 15px;
            .modal-line {
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 20px;
                img {
                    width: 75.46px;
                }
                .close-modal {
                    width: 30px;
                    height: 30px;
                    display: flex;
                    justify-content: space-between;
                    flex-direction: column;
                    cursor: pointer;
                    span {
                        display: block;
                        width: 100%;
                        background: $black;
                        height: 4px;
                        border-radius: 100px;
                        &:nth-child(1) {
                            transform: rotate(45deg);
                            position: relative;
                            top: 15px;
                        }
                        &:nth-child(2) {
                            transform: rotate(-45deg);
                            position: relative;
                            top: -11px;
                        }
                    }
                }
            }
        }
        .menu {
            display: block;
            .nav-menu {
                margin-right: 0;
                display: flex;
                flex-direction: column;
                margin-bottom: 30px;
                a {
                    font-family: 'Fredoka One', cursive;
                    font-size: 40px;
                    text-align: center;
                    line-height: 60px;
                    margin-left: 0;
                    color: #fff;
                    margin-bottom: 20px;
                }
            }
            .btn-global {
                padding: 19px 30px;
            }
        }
        .main-social {
            display: block;
            position: relative;
            top: 0;
            margin-top: 30px;
            ul {
                display: flex;
                align-items: center;
                justify-content: space-between;
                li {
                    a {
                        width: 62px;
                        height: 62px;
                        img {
                            width: 30px;
                        }
                    }
                }
            }
        }
    }

    @keyframes modal {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes modalleft {
        from {
            transform: translateX(190px);
        }
        to {
            transform: translateX(0px);
        }
    }


    .main-header {
        padding: 15px;
        .logo {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            img {
                width: 80px;
            }
        }
    }
}
.lottie-logo{
    position: relative;
    // top: -14px;
    // left: 10px;  
}
@media (max-width:768px){
    .lottie-logo{
        width: 75px!important;
        height: 40px!important;
    }
}
</style>
