OSDN Git Service

Add an App( app/user ) and Update an App( app/settings ) [0.2.0] dev/addUser
authormtsgi <oq@live.jp>
Fri, 10 May 2019 07:03:58 +0000 (16:03 +0900)
committermtsgi <oq@live.jp>
Fri, 10 May 2019 07:03:58 +0000 (16:03 +0900)
app/kish [new submodule]
app/settings/define.json
app/settings/user.html
app/user/default.html [new file with mode: 0644]
app/user/define.json [new file with mode: 0644]
app/user/icon.png [new file with mode: 0644]
app/user/user.css [new file with mode: 0644]
app/user/user.js [new file with mode: 0644]
system.js

diff --git a/app/kish b/app/kish
new file mode 160000 (submodule)
index 0000000..36db72a
--- /dev/null
+++ b/app/kish
@@ -0,0 +1 @@
+Subproject commit 36db72a498cf3ed104d313401e0d425aab688d4a
index fbd09dc..e0ff56e 100644 (file)
@@ -2,7 +2,7 @@
     "id": "settings",
     "name": "設定",
     "icon": "icon.png",
-    "version": "3.1.1",
+    "version": "3.1.2",
     "author": "kit",
 
     "support": {
index 9532182..c22d52e 100644 (file)
@@ -7,6 +7,9 @@
     }
     else $(".settings-user-currentpassword").text("未設定です");
     $(".settings-open-userpage > span").css("color", localStorage.getItem("kit-user-color") );
+    $(".settings-open-userpage").on("click", ()=>{
+        launch("user");
+    });
     if( localStorage.getItem("kit-lock") == "true" ){
         $("#settings-user-lockdisp").prop('checked', true);
     }
@@ -25,7 +28,7 @@
 <a class='btn settings-default'><span class='fa fa-arrow-circle-left'></span>設定</a>
 <h3><span class='fa fa-user-cog'></span> ユーザー設定</h3>
 <h4>ユーザー情報</h4>
-<div class='btn settings-open-userpage'><span class="fa fa-user"></span><div id="settings-user-username">?</div>ユーザーページを開く</div>
+<div class='btn settings-open-userpage'><span class="fa fa-user"></span><div id="settings-user-username">[username]</div>ユーザーページを開く</div>
 
 <span class="fa fa-address-card"></span>ユーザー名 <a onclick="S.alert('ユーザー名','表示される名前です')" class="kit-hyperlink far fa-question-circle"></a><br>
 <input type='text' class='textbox' id='settings-username'>
diff --git a/app/user/default.html b/app/user/default.html
new file mode 100644 (file)
index 0000000..80c59c6
--- /dev/null
@@ -0,0 +1,11 @@
+<a class="kit-button fa fa-lock" id="user-lock"></a>
+<div id="user-box">
+       <div id="user-icon"></div>
+    <div id="user-info">
+        <div id="user-name">[username]</div>
+        <div id="user-type">ユーザー</div>
+    </div>
+</div>
+<div style="text-align: right">
+    <a class="kit-hyperlink" id="user-settings">ユーザーに関する設定</a>
+</div>
\ No newline at end of file
diff --git a/app/user/define.json b/app/user/define.json
new file mode 100644 (file)
index 0000000..522429e
--- /dev/null
@@ -0,0 +1,20 @@
+{
+    "id": "user",
+    "name": "ユーザー",
+    "icon": "icon.png",
+    "version": "1.0.0",
+    "author": "kit",
+
+    "size": {
+        "width": 400
+    },
+
+    "support": {
+        "darkmode": true,
+        "fullscreen": true
+    },
+
+    "view": "default.html",
+    "script": "user.js",
+    "css": "user.css"
+}
\ No newline at end of file
diff --git a/app/user/icon.png b/app/user/icon.png
new file mode 100644 (file)
index 0000000..acb9f0f
Binary files /dev/null and b/app/user/icon.png differ
diff --git a/app/user/user.css b/app/user/user.css
new file mode 100644 (file)
index 0000000..93d3e8c
--- /dev/null
@@ -0,0 +1,36 @@
+#user-box{
+  display: flex;
+  border-bottom: 1px solid #a0a0a0;
+}
+#user-icon{
+       display: inline-block;
+       background : white;
+       width: 60px;
+       height: 60px;
+       margin: 5px;
+  margin-bottom: 15px;
+       border-radius: 999px;
+       box-shadow: 0px 1px 4px 0 rgba(0,0,0,.4), inset 0px -2px 15px 5px rgba(255,255,255,.4);
+       border: 3px solid #ffffff;
+}
+#user-icon:after{
+       content: "";
+       display: inline-block;
+       background : rgba(255,255,255,.2);
+       box-shadow: 0px 1px 10px 0px rgba(0,0,0,.1);
+       width: 60px;
+       height: 30px;
+       border-radius: 999px 999px 0px 0px;
+}
+#user-info{
+  padding: 6px;
+  font-size: 24px;
+}
+#user-type{
+  opacity: .5;
+  font-size: 15px;
+}
+#user-lock{
+  position: absolute;
+  right: 6px;
+}
\ No newline at end of file
diff --git a/app/user/user.js b/app/user/user.js
new file mode 100644 (file)
index 0000000..cd5230f
--- /dev/null
@@ -0,0 +1,8 @@
+((_pid) => {
+    S.dom(_pid, "#user-name").text(System.username);
+    S.dom(_pid, "#user-icon").css( "background", localStorage.getItem( "kit-user-color" ) );
+    S.dom(_pid, "#user-lock").on("click", System.lock);
+    S.dom(_pid, "#user-settings").on("click", ()=>{
+        launch("settings", { "view": "user" });
+    });
+})(pid);
\ No newline at end of file
index 8d9f859..4a6e88c 100644 (file)
--- a/system.js
+++ b/system.js
@@ -247,6 +247,10 @@ function kit() {
         }
     });
 
+    $("#kit-header-user").on("click", ()=>{
+        launch("user");
+    });
+
     //コンテキストメニュー
     $(":root section:not(#desktop-l)").on("contextmenu", function() {
         let _ptelem = $( document.elementFromPoint(S.mouseX, S.mouseY) );