// Dom7

var $$ = Dom7;

// Theme

var text = {};

var app = new Framework7({

  root: '#app', // App root element

  id: 'com.s1.shop',

  el: '#app',

  name: 'Framework7', // App name

  theme: 'ios',

  //pushState: false,

    iosTranslucentBars: ![],

    iosTranslucentModals: ![],

  routes: routes,

});

const config = {

  storage_key: 'sh96'

};

let ar = {

  'lang': [{"code":"id","lang":"Indonesia"},{"code":"en","lang":"English"}],

  'sex': {1:'Laki-laki',2:'Perempuan'},

  'gelar': {1:'Tuan',2:'Nyonya',3:'Nona',4:'Anak'}

};

function checkConnection(url) {}

var auth_data_member = get_localstorage('member');

if(auth_data_member.status==true) {

  console.log(auth_data_member.status)

  document.getElementById('toolbar_bottom').style.display = 'block';

  let dt=auth_data_member.data;

  //console.log(dt) 

  $("#user_name").html(dt.nama_member); 

  $("#user_subtitle").html(dt.email); 

  account_image_reload();

  new_release_home();

  random_home();

  bystock_home();

  //items_pria();

} else {

  document.getElementById('signout').style.display = 'none'; 

  document.getElementById('toolbar_bottom').style.display = 'none'; 

  console.log('not logged')

  app.views.main.router.navigate('/signin/');

}

$$('#signout')['on']('click', function() {

    console.log('app signout ready')    

    remove_localstorage('member');

    remove_localstorage('member_img');

    remove_localstorage('item_pria');

    app.views.main.router.navigate('/signin/');

    window.location.reload();

});

$$('.logout')['on']('click', function() {

    console.log('app logout ready')    

    remove_localstorage('member');

    remove_localstorage('member_img');

    remove_localstorage('item_pria');

    app.views.main.router.navigate('/signin/');

    window.location.reload();

});



var dl = get_localstorage('lang');

if(dl.status==true) {

  let lang=dl.data;

  console.log(lang);

  lang_change(lang)

} else {

  let lang='id';

  console.log(lang);

  lang_change(lang)

}