Browse Source

adjust pow

pull/91/head
AlphaX-Projects 2 years ago
parent
commit
b6d106b2c0
  1. 2
      qortal-ui-plugins/plugins/core/components/ChatModals.js
  2. 2
      qortal-ui-plugins/plugins/core/components/ChatPage.js
  3. 2
      qortal-ui-plugins/plugins/core/components/ChatWelcomePage.js
  4. 2
      qortal-ui-plugins/plugins/core/components/NameMenu.js
  5. 38
      qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js

2
qortal-ui-plugins/plugins/core/components/ChatModals.js

@ -202,7 +202,7 @@ class ChatModals extends LitElement {
const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32); const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32);
hashAry.set(chatBytesHash); hashAry.set(chatBytesHash);
const difficulty = this.balance === 0 ? 12 : 8; const difficulty = this.balance < 4 ? 18 : 8;
const workBufferLength = 8 * 1024 * 1024; const workBufferLength = 8 * 1024 * 1024;
const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap); const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap);

2
qortal-ui-plugins/plugins/core/components/ChatPage.js

@ -704,7 +704,7 @@ class ChatPage extends LitElement {
const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32); const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32);
hashAry.set(chatBytesHash); hashAry.set(chatBytesHash);
const difficulty = this.balance === 0 ? 12 : 8; const difficulty = this.balance < 4 ? 18 : 8;
const workBufferLength = 8 * 1024 * 1024; const workBufferLength = 8 * 1024 * 1024;
const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap); const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap);
let nonce = window.parent.computePow(hashPtr, workBufferPtr, workBufferLength, difficulty); let nonce = window.parent.computePow(hashPtr, workBufferPtr, workBufferLength, difficulty);

2
qortal-ui-plugins/plugins/core/components/ChatWelcomePage.js

@ -430,7 +430,7 @@ class ChatWelcomePage extends LitElement {
const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32); const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32);
hashAry.set(chatBytesHash); hashAry.set(chatBytesHash);
const difficulty = this.balance === 0 ? 12 : 8; const difficulty = this.balance < 4 ? 18 : 8;
const workBufferLength = 8 * 1024 * 1024; const workBufferLength = 8 * 1024 * 1024;
const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap); const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap);

2
qortal-ui-plugins/plugins/core/components/NameMenu.js

@ -548,7 +548,7 @@ class NameMenu extends LitElement {
const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32); const hashAry = new Uint8Array(window.parent.memory.buffer, hashPtr, 32);
hashAry.set(chatBytesHash); hashAry.set(chatBytesHash);
const difficulty = this.balance === 0 ? 12 : 8; const difficulty = this.balance < 4 ? 18 : 8;
const workBufferLength = 8 * 1024 * 1024; const workBufferLength = 8 * 1024 * 1024;
const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap); const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap);

38
qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js

@ -56,31 +56,26 @@ class Chat extends LitElement {
--_lumo-grid-secondary-border-color: var(--border2); --_lumo-grid-secondary-border-color: var(--border2);
--mdc-dialog-min-width: 750px; --mdc-dialog-min-width: 750px;
} }
paper-spinner-lite { paper-spinner-lite {
height: 24px; height: 24px;
width: 24px; width: 24px;
--paper-spinner-color: var(--mdc-theme-primary); --paper-spinner-color: var(--mdc-theme-primary);
--paper-spinner-stroke-width: 2px; --paper-spinner-stroke-width: 2px;
} }
*, *,
*:before, *:before,
*:after { *:after {
box-sizing: border-box; box-sizing: border-box;
} }
ul { ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
} }
.container { .container {
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
background: var(--white); background: var(--white);
} }
.people-list { .people-list {
width: 20vw; width: 20vw;
float: left; float: left;
@ -88,7 +83,6 @@ class Chat extends LitElement {
overflow-y: hidden; overflow-y: hidden;
border-right: 3px #ddd solid; border-right: 3px #ddd solid;
} }
.people-list .blockedusers { .people-list .blockedusers {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -98,13 +92,11 @@ class Chat extends LitElement {
border-top: 1px solid var(--border); border-top: 1px solid var(--border);
border-right: 3px #ddd solid; border-right: 3px #ddd solid;
} }
.people-list .search { .people-list .search {
padding-top: 20px; padding-top: 20px;
padding-left: 20px; padding-left: 20px;
padding-right: 20px; padding-right: 20px;
} }
.center { .center {
margin: 0; margin: 0;
position: absolute; position: absolute;
@ -113,7 +105,6 @@ class Chat extends LitElement {
-ms-transform: translateX(-50%); -ms-transform: translateX(-50%);
transform: translateX(-50%); transform: translateX(-50%);
} }
.people-list .create-chat { .people-list .create-chat {
border-radius: 5px; border-radius: 5px;
border: none; border: none;
@ -126,19 +117,16 @@ class Chat extends LitElement {
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }
.people-list .create-chat:hover { .people-list .create-chat:hover {
opacity: .8; opacity: .8;
box-shadow: 0 3px 5px rgba(0, 0, 0, .2); box-shadow: 0 3px 5px rgba(0, 0, 0, .2);
} }
.people-list ul { .people-list ul {
padding: 0; padding: 0;
height: 85vh; height: 85vh;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
} }
.chat { .chat {
width: 80vw; width: 80vw;
height: 100vh; height: 100vh;
@ -149,7 +137,6 @@ class Chat extends LitElement {
color: #434651; color: #434651;
box-sizing: border-box; box-sizing: border-box;
} }
.chat .new-message-bar { .chat .new-message-bar {
display: flex; display: flex;
flex: 0 1 auto; flex: 0 1 auto;
@ -172,17 +159,14 @@ class Chat extends LitElement {
opacity: .85; opacity: .85;
cursor: pointer; cursor: pointer;
} }
.chat .new-message-bar:hover { .chat .new-message-bar:hover {
opacity: .75; opacity: .75;
transform: translateY(-1px); transform: translateY(-1px);
box-shadow: 0 3px 7px rgba(0, 0, 0, .2); box-shadow: 0 3px 7px rgba(0, 0, 0, .2);
} }
.hide-new-message-bar { .hide-new-message-bar {
display: none !important; display: none !important;
} }
.chat .chat-history { .chat .chat-history {
position: absolute; position: absolute;
top: 0; top: 0;
@ -194,7 +178,6 @@ class Chat extends LitElement {
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
} }
.chat .chat-message { .chat .chat-message {
padding: 10px; padding: 10px;
height: 10%; height: 10%;
@ -202,7 +185,6 @@ class Chat extends LitElement {
width: 100%; width: 100%;
background-color: #eee; background-color: #eee;
} }
.chat .chat-message textarea { .chat .chat-message textarea {
width: 90%; width: 90%;
border: none; border: none;
@ -211,7 +193,6 @@ class Chat extends LitElement {
border-radius: 5px; border-radius: 5px;
resize: none; resize: none;
} }
.chat .chat-message button { .chat .chat-message button {
float: right; float: right;
color: #94c2ed; color: #94c2ed;
@ -225,18 +206,15 @@ class Chat extends LitElement {
margin-top: 4px; margin-top: 4px;
margin-right: 4px; margin-right: 4px;
} }
.chat .chat-message button:hover { .chat .chat-message button:hover {
color: #75b1e8; color: #75b1e8;
} }
.online, .online,
.offline, .offline,
.me { .me {
margin-right: 3px; margin-right: 3px;
font-size: 10px; font-size: 10px;
} }
.clearfix:after { .clearfix:after {
visibility: hidden; visibility: hidden;
display: block; display: block;
@ -245,37 +223,30 @@ class Chat extends LitElement {
clear: both; clear: both;
height: 0; height: 0;
} }
.red { .red {
--mdc-theme-primary: red; --mdc-theme-primary: red;
} }
h2 { h2 {
margin:0; margin:0;
} }
h2, h3, h4, h5 { h2, h3, h4, h5 {
color: var(--black); color: var(--black);
font-weight: 400; font-weight: 400;
} }
[hidden] { [hidden] {
display: hidden !important; display: hidden !important;
visibility: none !important; visibility: none !important;
} }
.details { .details {
display: flex; display: flex;
font-size: 18px; font-size: 18px;
} }
.title { .title {
font-weight:600; font-weight:600;
font-size:12px; font-size:12px;
line-height: 32px; line-height: 32px;
opacity: 0.66; opacity: 0.66;
} }
.input { .input {
width: 100%; width: 100%;
border: none; border: none;
@ -286,7 +257,6 @@ class Chat extends LitElement {
resize: none; resize: none;
background: #eee; background: #eee;
} }
.textarea { .textarea {
width: 100%; width: 100%;
border: none; border: none;
@ -342,7 +312,6 @@ class Chat extends LitElement {
</div> </div>
</div> </div>
</div> </div>
<div class="chat"> <div class="chat">
<div id="newMessageBar" class="new-message-bar hide-new-message-bar clearfix" @click=${() => this.scrollToBottom()}> <div id="newMessageBar" class="new-message-bar hide-new-message-bar clearfix" @click=${() => this.scrollToBottom()}>
<span style="flex: 1;">${translate("chatpage.cchange4")}</span> <span style="flex: 1;">${translate("chatpage.cchange4")}</span>
@ -352,21 +321,17 @@ class Chat extends LitElement {
${window.parent.location.pathname !== "/app/q-chat" ? html`${this.renderChatPage(this.chatId)}` : html`${this.renderChatWelcomePage()}`} ${window.parent.location.pathname !== "/app/q-chat" ? html`${this.renderChatPage(this.chatId)}` : html`${this.renderChatWelcomePage()}`}
</div> </div>
</div> </div>
<!-- Start Chatting Dialog --> <!-- Start Chatting Dialog -->
<mwc-dialog id="startChatDialog" scrimClickAction="${this.isLoading ? '' : 'close'}"> <mwc-dialog id="startChatDialog" scrimClickAction="${this.isLoading ? '' : 'close'}">
<div style="text-align:center"> <div style="text-align:center">
<h1>${translate("chatpage.cchange1")}</h1> <h1>${translate("chatpage.cchange1")}</h1>
<hr> <hr>
</div> </div>
<p>${translate("chatpage.cchange6")}</p> <p>${translate("chatpage.cchange6")}</p>
<textarea class="input" ?disabled=${this.isLoading} id="sendTo" placeholder="${translate("chatpage.cchange7")}" rows="1"></textarea> <textarea class="input" ?disabled=${this.isLoading} id="sendTo" placeholder="${translate("chatpage.cchange7")}" rows="1"></textarea>
<p style="margin-bottom:0;"> <p style="margin-bottom:0;">
<textarea class="textarea" @keydown=${(e) => this._textArea(e)} ?disabled=${this.isLoading} id="messageBox" placeholder="${translate("chatpage.cchange8")}" rows="1"></textarea> <textarea class="textarea" @keydown=${(e) => this._textArea(e)} ?disabled=${this.isLoading} id="messageBox" placeholder="${translate("chatpage.cchange8")}" rows="1"></textarea>
</p> </p>
<mwc-button <mwc-button
?disabled="${this.isLoading}" ?disabled="${this.isLoading}"
slot="primaryAction" slot="primaryAction"
@ -383,7 +348,6 @@ class Chat extends LitElement {
${translate("general.close")} ${translate("general.close")}
</mwc-button> </mwc-button>
</mwc-dialog> </mwc-dialog>
<!-- Blocked User Dialog --> <!-- Blocked User Dialog -->
<mwc-dialog id="blockedUserDialog"> <mwc-dialog id="blockedUserDialog">
<div style="text-align:center"> <div style="text-align:center">
@ -846,7 +810,7 @@ class Chat extends LitElement {
hashAry.set(chatBytesHash); hashAry.set(chatBytesHash);
const difficulty = this.balance === 0 ? 12 : 8 const difficulty = this.balance < 4 ? 18 : 8
const workBufferLength = 8 * 1024 * 1024; const workBufferLength = 8 * 1024 * 1024;
const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap) const workBufferPtr = window.parent.sbrk(workBufferLength, window.parent.heap)

Loading…
Cancel
Save