diff --git a/ReallifeGamemode.Client/assets/chat/index.html b/ReallifeGamemode.Client/assets/chat/index.html deleted file mode 100644 index d4354663..00000000 --- a/ReallifeGamemode.Client/assets/chat/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
- -
- - - - \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/chat/style/checkbox.css b/ReallifeGamemode.Client/assets/css/chat/checkbox.css similarity index 94% rename from ReallifeGamemode.Client/assets/chat/style/checkbox.css rename to ReallifeGamemode.Client/assets/css/chat/checkbox.css index 53fddb26..5d5fb115 100644 --- a/ReallifeGamemode.Client/assets/chat/style/checkbox.css +++ b/ReallifeGamemode.Client/assets/css/chat/checkbox.css @@ -1 +1 @@ -input[type=checkbox].css-checkbox{position:absolute;z-index:-1000;left:-1000px;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;}input[type=checkbox].css-checkbox+label.css-label{height:20px;width:20px;display:inline-block;background-repeat:no-repeat;background-position:0 0;cursor:pointer;}input[type=checkbox].css-checkbox:checked+label.css-label:after{content:'x';color:white;}label.css-label{background:#7b3784;border-radius:2px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;} \ No newline at end of file +input[type=checkbox].css-checkbox{position:absolute;z-index:-1000;left:-1000px;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;}input[type=checkbox].css-checkbox+label.css-label{height:20px;width:20px;display:inline-block;background-repeat:no-repeat;background-position:0 0;cursor:pointer;}input[type=checkbox].css-checkbox:checked+label.css-label:after{content:'x';color:white;}label.css-label{background:#7b3784;border-radius:2px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;} diff --git a/ReallifeGamemode.Client/assets/css/chat/main.css b/ReallifeGamemode.Client/assets/css/chat/main.css new file mode 100644 index 00000000..4c92d73d --- /dev/null +++ b/ReallifeGamemode.Client/assets/css/chat/main.css @@ -0,0 +1,92 @@ +*, body, html { + padding: 0; + margin: 0; +} + +#chat, a, body, html { + color: #fff; +} + +body, html { + -webkit-font-smoothing: antialiased; + overflow: hidden; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: calc(.7em + .4vw); + font-weight: 500; + direction: ltr; +} + +a { + text-decoration: none; +} + +.ui_element { + display: none; + position: absolute; + width: 100vw; + height: 100vh; + z-index: 2; +} + +#chat { + display: block; + z-index: 0; + line-height: 1.25; + text-shadow: 1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000; + letter-spacing: .4px; + margin-top: 1em; + margin-left: 1em; +} + +#chat ul#chat_messages { + height: 17.5em; + min-width: 35vw; + max-width: 85vw; + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + overflow-y: auto; + overflow-x: hidden; + list-style-type: none; + margin-bottom: .25em; +} + +#chat ul#chat_messages > li { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + margin-bottom: .25em; +} + +#chat input#chat_msg { + width: 35vw; + outline: 0; + border: none; + border-radius: 3px; + font-size: inherit; + font-weight: inherit; + line-height: inherit; + color: white; + background: rgba(0, 0, 0, 0.5); + padding: .5em; +} + +::-webkit-scrollbar { + width: 11px; +} + +::-webkit-scrollbar-thumb { + background: rgba(255, 17, 0, 0); + border-radius: 20px; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(255, 17, 0, 0); +} +/*# sourceMappingURL=main.css.map */ \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/css/chat/main.css.map b/ReallifeGamemode.Client/assets/css/chat/main.css.map new file mode 100644 index 00000000..a32a063d --- /dev/null +++ b/ReallifeGamemode.Client/assets/css/chat/main.css.map @@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E,YAAY;EACvB,aAAa,EAAE,KAAK;CACrB;;AA1BL,AA6BE,KA7BG,CA6BH,KAAK,AAAA,SAAS,CAAC;EACb,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,IAAI;EACZ,aAAa,EAAE,GAAG;EAElB,SAAS,EAAE,OAAO;EAClB,WAAW,EAAE,OAAO;EACpB,WAAW,EAAE,OAAO;EAEpB,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,kBAAiB;EAE7B,OAAO,EAAE,IAAI;CACd;;AAGH,AAAA,mBAAmB,CAAC;EAClB,KAAK,EAAE,IAAI;CAQZ;;AATD,AAGE,mBAHiB,AAGhB,MAAM,CAAC;EACN,UAAU,EAAE,mBAAmB;EAC/B,aAAa,EAAE,IAAI;CAGpB;;AARH,AAOI,mBAPe,AAGhB,MAAM,AAIJ,MAAM,CAAC;EAAE,UAAU,EAAE,mBAAmB;CAAI", + "sources": [ + "main.scss" + ], + "names": [], + "file": "main.css" +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/css/chat/main.scss b/ReallifeGamemode.Client/assets/css/chat/main.scss new file mode 100644 index 00000000..0fa00fea --- /dev/null +++ b/ReallifeGamemode.Client/assets/css/chat/main.scss @@ -0,0 +1,89 @@ +*, body, html { + padding: 0; + margin: 0 +} + +#chat, a, body, html { + color: #fff +} + +body, html { + -webkit-font-smoothing: antialiased; + overflow: hidden; + font-size: 14px; + user-select: none; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + font-size: calc(.7em + .4vw); + font-weight: 500; + direction: ltr; +} + +a { text-decoration: none; } + +.ui_element { + display: none; + position: absolute; + width: 100vw; + height: 100vh; + z-index: 2 +} + +#chat { + display: block; + z-index: 0; + + line-height: 1.25; + text-shadow: 1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000; + letter-spacing: .4px; + + margin-top: 1em; + margin-left: 1em; + + ul#chat_messages { + height: 17.5em; + min-width: 35vw; + max-width: 85vw; + transform: rotate(0deg); + + overflow-y: auto; + overflow-x: hidden; + + list-style-type: none; + margin-bottom: .25em; + + &> li { + transform: rotate(0deg); + margin-bottom: .25em; + } + } + + input#chat_msg { + width: 35vw; + outline: 0; + border: none; + border-radius: 3px; + + font-size: inherit; + font-weight: inherit; + line-height: inherit; + + color: white; + background: rgba(0, 0, 0, .5); + + padding: .5em; + } +} + +::-webkit-scrollbar { + width: 11px; + + &-thumb { + background: rgba(255, 17, 0, 0); + border-radius: 20px; + + &:hover { background: rgba(255, 17, 0, 0); } + } +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/chat/style/main.css b/ReallifeGamemode.Client/assets/css/chat/main_old.css similarity index 100% rename from ReallifeGamemode.Client/assets/chat/style/main.css rename to ReallifeGamemode.Client/assets/css/chat/main_old.css diff --git a/ReallifeGamemode.Client/assets/chat/fonts/CenturyGothicRegular.ttf b/ReallifeGamemode.Client/assets/font/chat/CenturyGothicRegular.ttf similarity index 100% rename from ReallifeGamemode.Client/assets/chat/fonts/CenturyGothicRegular.ttf rename to ReallifeGamemode.Client/assets/font/chat/CenturyGothicRegular.ttf diff --git a/ReallifeGamemode.Client/assets/chat/fonts/CodeProLC.otf b/ReallifeGamemode.Client/assets/font/chat/CodeProLC.otf similarity index 100% rename from ReallifeGamemode.Client/assets/chat/fonts/CodeProLC.otf rename to ReallifeGamemode.Client/assets/font/chat/CodeProLC.otf diff --git a/ReallifeGamemode.Client/assets/chat/fonts/emoji_unicode.php b/ReallifeGamemode.Client/assets/font/chat/emoji_unicode.php similarity index 100% rename from ReallifeGamemode.Client/assets/chat/fonts/emoji_unicode.php rename to ReallifeGamemode.Client/assets/font/chat/emoji_unicode.php diff --git a/ReallifeGamemode.Client/assets/html/chat/index.html b/ReallifeGamemode.Client/assets/html/chat/index.html new file mode 100644 index 00000000..655c409d --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/chat/index.html @@ -0,0 +1,16 @@ + + + + + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/chat/jquery-1.11.3.min.js b/ReallifeGamemode.Client/assets/js/chat/jquery-1.11.3.min.js similarity index 100% rename from ReallifeGamemode.Client/assets/chat/jquery-1.11.3.min.js rename to ReallifeGamemode.Client/assets/js/chat/jquery-1.11.3.min.js diff --git a/ReallifeGamemode.Client/assets/chat/js/main.js b/ReallifeGamemode.Client/assets/js/chat/main.js similarity index 94% rename from ReallifeGamemode.Client/assets/chat/js/main.js rename to ReallifeGamemode.Client/assets/js/chat/main.js index fe051878..50619991 100644 --- a/ReallifeGamemode.Client/assets/chat/js/main.js +++ b/ReallifeGamemode.Client/assets/js/chat/main.js @@ -1,4 +1,4 @@ -let chat = +let chat = { size: 0, history_limit: 50, @@ -23,8 +23,7 @@ function enableChatInput(enable) { if (enable) { chat.input = $("#chat").append('
').children(":last"); chat.input.children("input").focus(); - } - else { + } else { chat.input.fadeOut('fast', function () { chat.input.remove(); chat.input = null; @@ -65,12 +64,14 @@ var chatAPI = var today = new Date(); if (chatElement === "
  • ") { + var time = today.toLocaleTimeString('de-DE'); + chat.container.append("
  • " + "[" + time + "] " + text + "
  • "); + if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) { - chat.container.append("
  • " + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "
  • "); elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight; - } else { - chat.container.append("
  • " + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "
  • "); } + + // if (!chat.enabled) { elmnt.scrollTo(0, elmnt.scrollHeight); } } else { chat.container.append(chatElement); } @@ -185,4 +186,4 @@ $(document).ready(function () { enableChatInput(false); } }); -}); \ No newline at end of file +}); diff --git a/ReallifeGamemode.Client/assets/chat/js/newMain.js b/ReallifeGamemode.Client/assets/js/chat/newMain.js similarity index 100% rename from ReallifeGamemode.Client/assets/chat/js/newMain.js rename to ReallifeGamemode.Client/assets/js/chat/newMain.js diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 89257c40..abcbd11e 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -39,7 +39,7 @@ game.events.onPlayerCommand((cmd) => { mp.game.vehicle.defaultEngineBehaviour = false; mp.gui.chat.show(false); -const chatbox = mp.browsers.new("package://assets/chat/index.html"); +const chatbox = mp.browsers.new("package://assets/html/chat/index.html"); chatbox.markAsChat(); require('./Gui/house'); @@ -276,4 +276,4 @@ interface VehicleData { export { VehicleData -} \ No newline at end of file +}