OSDN Git Service

[更新]エンターキーを押してくださいの文字サイズを修正
[alterlinux/lightdm-webkit2-theme-alter.git] / js / splashscreen.js
index c375e62..4ec77da 100644 (file)
 *
 */
 text=[]
-if (window.navigator.language === "en" || window.navigator.language === "en-US" ||window.navigator.language === "fr"  ||window.navigator.language === "es-ES" ) {
-  text[0]="Press any key to login"
-  text[1]="Welcome Back"
+if (window.navigator.language === "en" || window.navigator.language === "en-US" ||window.navigator.language === "en-GB" ||window.navigator.language === "en-CA" ||window.navigator.language === "en-AU" ||window.navigator.language === "es-ES" ) {
+  text[0]="Press any EnterKey to login"
+  text[1]="WELCOME BACK"
   text[2]="Select Session"
   text[3]="User"
   text[4]="Password"
 }
+else if(window.navigator.language === "fr" || window.navigator.language === "fr-CA" ){
+  text[0] = "Appuyez sur n'importe quelle touche EnterKey pour vous connecter"
+  text[1] = "Bienvenue à nouveau"
+  text[2] = "Sélectionner une session"
+  text[3] = "Utilisateur"
+  text[4] = "Mot de passe"
+}
+else if(window.navigator.language === "zh" || window.navigator.language === "zh-CN" || window.navigator.language === "zh-TW" ){
+  text[0] ="按任意Enter键登录"
+  text[1] ="欢迎回来"
+  text[2] ="选择会话"
+  text[3] ="用户"
+  text[4] ="密码"
+}
 else {
-  text[0]="任意のキーを押すとログインできます。"
+  text[0]="Enterキーを押すとログインできます。"
   text[1]="ようこそ"
   text[2]="セレクトセッション"
   text[3]="ユーザー"
   text[4]="パスワード"
 }
-document.onkeydown = function (e){
-  document.getElementById("inputPassword").focus();
-};
-
+// document.onkeydown = function (e){
+//   document.getElementById("inputPassword").focus();
+// };
+document.onselectstart = function(){return false;};
 class SplashScreen {
   constructor() {
     /* Speed of SplashScreen transitions */
@@ -66,11 +80,11 @@ class SplashScreen {
         // },{
           "format": ["h:mm", "A"],
           "css": [
-            {"font-size": "65pt", "font-weight": 200 },
-            {"font-size": "30pt", "font-weight": "lighter", "margin-left": "10pt"}
+            {"font-size": "40pt", "font-weight": 200 },
+            {"font-size": "20pt", "font-weight": "lighter", "margin-left": "10pt"}
           ],
           "parent-css": {
-            "margin-top": "40vh",
+            "margin-top": "45vh",
             "color": "white",
             "font-family": "MyFont",
             "text-align": "center",
@@ -81,9 +95,9 @@ class SplashScreen {
         "html": [{
           "html":"<text style='display: none' class='active-appear'>"+text[0]+"</text>",
           "css": {
-            "margin-top": "5vh",
+            "margin-top": "40vh",
             "font-weight": "200",
-            "font-size": "23pt",
+            "font-size": "12pt",
             "text-align": "center",
             "color": "rgba(255, 255, 255, 0.8)"
           }
@@ -168,6 +182,7 @@ class SplashScreen {
     front end to implement spcific behaivours while the user is active */
     this.$el.click(() => {
       this._open();
+      document.getElementById("inputPassword").focus();
     }).mousemove((e) => {
       if (!this._isActive())
       $(this).trigger("active", e)
@@ -341,6 +356,7 @@ class SplashScreen {
         case 32:
         case 13: // Enter key
         if (this._state == "closed")
+        document.getElementById("inputPassword").focus();
         this._open();
         break;
         case 27: // ESC key
@@ -350,8 +366,8 @@ class SplashScreen {
         this._open();
         break;
         default:
-        if (this._state == "closed")
-        this._open();
+        // // if (this._state == "closed")
+        // // this._open();
         break;
       }