Added rotation handling (beta!) Don't expand them if you don't wish to show them, report any performance issues and such to me
parent
38f3e88f72
commit
64bfab91f5
@ -1,21 +1,30 @@ |
||||
export default function listenActWebSocket(callback) { |
||||
const url = new URLSearchParams(window.location.search) |
||||
const wsUri = `${url.get('HOST_PORT')}BeforeLogLineRead` || undefined |
||||
const ws = new WebSocket(wsUri) |
||||
ws.onerror = () => listenActWebSocket() |
||||
ws.onmessage = function (e, m) { //PING
|
||||
if (e.data === '.') return ws.send('.') //PONG
|
||||
|
||||
const obj = JSON.parse(e.data) |
||||
if(obj.msgtype === 'SendCharName') |
||||
{ |
||||
return callback(obj.msg) |
||||
} |
||||
else if(obj.msgtype === 'Chat') |
||||
{ |
||||
const code = obj.msg.substring(0, 2) //first 2 numbers POG
|
||||
const handleCodes = new Set([ |
||||
'00', |
||||
'01', |
||||
'02', |
||||
'21', |
||||
'22', |
||||
'33' |
||||
]) |
||||
|
||||
if(code === '21' || code === '22') return callback(obj.msg) //NetworkAbility or NetworkAoeAbility
|
||||
} |
||||
} |
||||
} |
||||
export default function listenActWebSocket( callback ) { |
||||
const url = new URLSearchParams(window.location.search) |
||||
const wsUri = `${url.get("HOST_PORT")}BeforeLogLineRead` || undefined |
||||
const ws = new WebSocket(wsUri) |
||||
ws.onerror = () => ws.close() |
||||
ws.onclose = () => setTimeout(() => { listenActWebSocket( callback ) }, 1000) |
||||
ws.onmessage = function(e, m) { |
||||
if (e.data === ".") return ws.send(".") //PING
|
||||
|
||||
const obj = JSON.parse(e.data); |
||||
if (obj.msgtype === "SendCharName") { |
||||
return callback(obj.msg, null) |
||||
} else if (obj.msgtype === "Chat") { |
||||
const code = obj.msg.substring(0, 2) //first 2 numbers POG
|
||||
|
||||
if (handleCodes.has(code)) return callback(obj.msg, code) //NetworkAbility or NetworkAoeAbility
|
||||
} |
||||
} |
||||
|
||||
return ws |
||||
} |
||||
|
@ -1,25 +1,27 @@ |
||||
.action-icon { |
||||
animation-duration: 10s; |
||||
animation-name: action-move; |
||||
animation-timing-function: linear; |
||||
animation-fill-mode: forwards; |
||||
position: absolute; |
||||
.action-move { |
||||
animation-duration: 10s; |
||||
animation-name: action-move; |
||||
animation-timing-function: linear; |
||||
animation-fill-mode: forwards; |
||||
position: absolute; |
||||
} |
||||
|
||||
.gcd { |
||||
width: 3rem; |
||||
vertical-align: top; |
||||
} |
||||
|
||||
.ogcd { |
||||
width: 2rem; |
||||
vertical-align: top; |
||||
} |
||||
|
||||
@keyframes action-move { |
||||
from { |
||||
transform: translateX(calc(100vw - 3rem)); |
||||
} |
||||
from { |
||||
transform: translateX(calc(100vw - 3rem)); |
||||
} |
||||
|
||||
to { |
||||
transform: translateX(-3rem); |
||||
} |
||||
to { |
||||
transform: translateX(-3rem); |
||||
} |
||||
} |
@ -1,16 +1,15 @@ |
||||
body { |
||||
margin: 0; |
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", |
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", |
||||
sans-serif; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
font-size: 16px; |
||||
margin: 0; |
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", |
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", |
||||
sans-serif; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
font-size: 16px; |
||||
} |
||||
|
||||
html { |
||||
margin: 0; |
||||
height: 100vh; |
||||
overflow: hidden; |
||||
background-color: rgba(20, 20, 20, 0.3); |
||||
margin: 0; |
||||
height: 100vh; |
||||
overflow: hidden; |
||||
} |
Loading…
Reference in new issue