diff --git a/fonts/FOT-KurokaneStd-EB.eot b/fonts/FOT-KurokaneStd-EB.eot
deleted file mode 100644
index f4cb4d5f..00000000
Binary files a/fonts/FOT-KurokaneStd-EB.eot and /dev/null differ
diff --git a/fonts/FOT-KurokaneStd-EB.svg b/fonts/FOT-KurokaneStd-EB.svg
deleted file mode 100644
index ae91e1d6..00000000
--- a/fonts/FOT-KurokaneStd-EB.svg
+++ /dev/null
@@ -1,31051 +0,0 @@
-
-
-
diff --git a/fonts/FOT-KurokaneStd-EB.ttf b/fonts/FOT-KurokaneStd-EB.ttf
deleted file mode 100644
index 8edcaffc..00000000
Binary files a/fonts/FOT-KurokaneStd-EB.ttf and /dev/null differ
diff --git a/fonts/FOT-KurokaneStd-EB.woff b/fonts/FOT-KurokaneStd-EB.woff
deleted file mode 100644
index 40ebea0c..00000000
Binary files a/fonts/FOT-KurokaneStd-EB.woff and /dev/null differ
diff --git a/fonts/fa-solid-900.eot b/fonts/fa-solid-900.eot
deleted file mode 100644
index e9941719..00000000
Binary files a/fonts/fa-solid-900.eot and /dev/null differ
diff --git a/fonts/fa-solid-900.svg b/fonts/fa-solid-900.svg
deleted file mode 100644
index 00296e95..00000000
--- a/fonts/fa-solid-900.svg
+++ /dev/null
@@ -1,5034 +0,0 @@
-
-
-
diff --git a/fonts/fa-solid-900.ttf b/fonts/fa-solid-900.ttf
deleted file mode 100644
index 25abf389..00000000
Binary files a/fonts/fa-solid-900.ttf and /dev/null differ
diff --git a/fonts/fa-solid-900.woff b/fonts/fa-solid-900.woff
deleted file mode 100644
index 23ee6634..00000000
Binary files a/fonts/fa-solid-900.woff and /dev/null differ
diff --git a/fonts/zpix.eot b/fonts/zpix.eot
deleted file mode 100644
index de900494..00000000
Binary files a/fonts/zpix.eot and /dev/null differ
diff --git a/fonts/zpix.svg b/fonts/zpix.svg
deleted file mode 100644
index 879fa889..00000000
--- a/fonts/zpix.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/fonts/zpix.ttf b/fonts/zpix.ttf
deleted file mode 100644
index b1675163..00000000
Binary files a/fonts/zpix.ttf and /dev/null differ
diff --git a/fonts/zpix.woff b/fonts/zpix.woff
deleted file mode 100644
index ff201d7b..00000000
Binary files a/fonts/zpix.woff and /dev/null differ
diff --git a/index.html b/index.html
index e8a39c54..d4adb064 100644
--- a/index.html
+++ b/index.html
@@ -16,12 +16,29 @@
location.href = "multi.html" + location.search; //跳到多人模式
}
- var browser_i18n = (navigator.language||navigator.userLanguage); //获取浏览器语言
- var hasLanguage = languageList.filter(function(l){ //筛选出符合的语言
- return browser_i18n.indexOf(l.i18n)>=0;
- });
- language = hasLanguage.length?hasLanguage[hasLanguage.length-1]:languageList[0]; //没有找到指定语言的情况下,自动用默认的语言
- document.head.querySelector("#language-css").href = "languages/"+language.i18n+".css";
+ let browser_i18n = (navigator.language||navigator.userLanguage); //获取浏览器语言
+ let currentLanguage = languageList.find(lang => { //筛选出符合的语言
+ if (lang.i18n_RegExp)
+ {
+ return lang.i18n_RegExp.test(browser_i18n); //匹配正则表达式
+ }else
+ {
+ return browser_i18n.includes(lang.i18n); //文字上的搜索包含
+ }
+ }) || languageList[0]; //没有找到指定语言的情况下,自动用第一个语言(英语)
+
+ document.head.querySelector("#language-css").href = "languages/"+currentLanguage.i18n+".css";
+
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register('service-worker.js', {scope: './'})
+ .then(function(registration) {
+ console.log('service worker 注册成功',registration);
+ }).catch(function(error) {
+ console.error('servcie worker 注册失败',error);
+ });
+ } else {
+ console.error('浏览器不支持 servcie worker');
+ }