text: new Vue({
    el: "#app",
    data: {
      author: "cs-tao",
      authorLink: "https://home.cs-tao.cc",
      musicText: "music",
      musicUrl:
        "https://frytea.com/assets/homepage.mp3",
      copyright: " © 2019",
      signature:
        "对月吟诗，煮雪烹茶",
      blogUrl: "https://blog.frytea.com",
      avatarUrl:
        "https://mywebsite.nos-eastchina1.126.net/V1.2/myself-sidi.jpg",
      blogText: "宋天伦",
      leaveTitle: "(●—●) 哎呦，崩溃啦！",
      returnTitle: "o(≧∇≦o) 啊咧，又好了……",
      baiduTongjiToken: "f804ad502296fc2c05980df30ef929f4",
      auth: "7f1a65908b05238c21c134c764c89e28",
      authed: false,
      musicPlay: false,
      publicLinks: [
        {
          type: "mail",
          link:
            "mailto:songtianlun@frytea.com",
          name: "MAIL",
          iconClass: "icon-mail"
        },
        {
          type: "github",
          link: "https://github.com/songtianlun/",
          name: "GitHub",
          iconClass: "icon-github"
        },
        {
          type: "portainer-io",
          link: "https://guide.frytea.com",
          name: "gallery",
          iconClass: "fa fa-sitemap"
        },
        {
          type: "rss",
          link: "https://data.frytea.com",
          name: "RSS",
          iconClass: "fa fa-share-square"
        }
      ],
      privateLinks: [
        {
          type: "lover",
          link: "https://drive.frytea.com/",
          name: "lover",
          iconClass: "fa fa-cloud"
        },
        {
          type: "gogs",
          link: "https://music.frytea.com/",
          name: "gogs",
          iconClass: "fa fa-music"
        },
        {
          type: "docker-web",
          link: "https://share.frytea.com/",
          name: "docker-web",
          iconClass: "fa fa-leaf"
        },
        {
          type: "portainer-io",
          link: "https://photo.frytea.com/",
          name: "portainer-io",
          iconClass: "fa fa-photo"
        },
        {
          type: "cloud",
          link: "http://114.116.67.239/geoserver/",
          name: "cloud",
          iconClass: "fa fa-map"
        }
      ]
    },
    head: {
      title: function() {
        return {
          inner: "宋天伦",
          separator: "·"
        };
      },
      meta: [
        { name: "description", c: "Homepage of CS-Tao", id: "desc" },
        { name: "baidu-site-verification", content: "JEjptqwb98" }
      ],
      link: [
        {
          rel: "icon",
          href: "/favicon.png",
          sizes: "16x16",
          type: "image/x-icon"
        }
      ]
    },
    mounted() {
      // this.checkMusicPlay();
      this.checkAuth();
      this.baiduTongji(this.baiduTongjiToken);
      var OriginTitile = document.title,
        titleTime;
      var app = this;
      document.addEventListener("visibilitychange", function() {
        if (document.hidden) {
          document.title = app.leaveTitle;
          clearTimeout(titleTime);
        } else {
          document.title = app.returnTitle;
          titleTime = setTimeout(function() {
            document.title = OriginTitile;
          }, 2000);
        }
      });
    },
    methods: {
      checkAuth() {
        if (
          !!localStorage.homepageAuthForCSTaoOrFriend &&
          localStorage.homepageAuthForCSTaoOrFriend === this.auth
        )
          this.authed = true;
        else this.authed = false;
      },
      baiduTongji(token) {
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?" + token;
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(hm, s);
        })();
      },
      lockClicked () {
        this.checkAuth()
        if (this.authed) localStorage.homepageAuthForCSTaoOrFriend = null;
        else window.location = './authentication/index.html'
        this.checkAuth()
      },
      musicClicked () {
        var audio = document.getElementById('bgm')
        if (!this.musicPlay) {
          localStorage.homepageMusicPlay = 1
          this.musicPlay = true
          if (audio !== null && audio.paused)
            audio.play()
        } else {
          localStorage.homepageMusicPlay = 0
          this.musicPlay = false
          if (audio !== null && !audio.paused)
            audio.pause()
        }
      },
      checkMusicPlay () {
        var audio = document.getElementById('bgm')
        if (localStorage.homepageMusicPlay && localStorage.homepageMusicPlay == 1) {
          this.musicPlay = true
          if (audio !== null && audio.paused)
            audio.play()
        }
        else {
          this.musicPlay = false
          if (audio !== null && !audio.paused)
            audio.pause()
        }
      }
    }
  });
  