e
This commit is contained in:
parent
702bab121c
commit
9aa690dfc4
37 changed files with 0 additions and 0 deletions
48
resources/[jobs]/[crime]/r_bridge/ui/client.lua
Normal file
48
resources/[jobs]/[crime]/r_bridge/ui/client.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
local isTextUiOpen = false
|
||||
local isHelpTextVisible = false
|
||||
|
||||
Core.Ui = {}
|
||||
|
||||
function Core.Ui.ShowTextUi(key, text)
|
||||
SendNUIMessage({
|
||||
type = "text-ui",
|
||||
display = true,
|
||||
key = key,
|
||||
text = text
|
||||
})
|
||||
isTextUiOpen = true
|
||||
end
|
||||
|
||||
function Core.Ui.HideTextUi()
|
||||
SendNUIMessage({
|
||||
type = "text-ui",
|
||||
display = false
|
||||
})
|
||||
isTextUiOpen = false
|
||||
end
|
||||
|
||||
function Core.Ui.isTextUiOpen()
|
||||
return isTextUiOpen
|
||||
end
|
||||
|
||||
function Core.Ui.ShowHelpText(text)
|
||||
SendNUIMessage({
|
||||
type = "help-text",
|
||||
display = true,
|
||||
text = text
|
||||
})
|
||||
PlaySoundFrontend(-1, "Click", "DLC_HEIST_HACKING_SNAKE_SOUNDS", false)
|
||||
isHelpTextVisible = true
|
||||
end
|
||||
|
||||
function Core.Ui.HideHelpText()
|
||||
SendNUIMessage({
|
||||
type = "help-text",
|
||||
display = false
|
||||
})
|
||||
isHelpTextVisible = false
|
||||
end
|
||||
|
||||
function Core.Ui.isHelpTextVisible()
|
||||
return isHelpTextVisible
|
||||
end
|
||||
23
resources/[jobs]/[crime]/r_bridge/ui/index.html
Normal file
23
resources/[jobs]/[crime]/r_bridge/ui/index.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>r_bridge</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="game-screen">
|
||||
<div class="help-text" id="help-text"> This is a help text. </div>
|
||||
<div class="text-ui" id="text-ui">
|
||||
<button>E</button>
|
||||
<p>Interact</p>
|
||||
</div>
|
||||
</div>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
24
resources/[jobs]/[crime]/r_bridge/ui/script.js
Normal file
24
resources/[jobs]/[crime]/r_bridge/ui/script.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
window.addEventListener('message', function (event) {
|
||||
if (event.data.type === "help-text") {
|
||||
let helpText = document.querySelector('.help-text');
|
||||
if (event.data.display) {
|
||||
helpText.style.opacity = 1;
|
||||
helpText.textContent = event.data.text;
|
||||
} else {
|
||||
helpText.style.opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.data.type === "text-ui") {
|
||||
let textUI = document.querySelector('.text-ui');
|
||||
let key = document.querySelector('.text-ui button');
|
||||
let text = document.querySelector('.text-ui p');
|
||||
if (event.data.display) {
|
||||
key.textContent = event.data.key;
|
||||
text.textContent = event.data.text;
|
||||
textUI.style.opacity = 1;
|
||||
} else {
|
||||
textUI.style.opacity = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
82
resources/[jobs]/[crime]/r_bridge/ui/styles.css
Normal file
82
resources/[jobs]/[crime]/r_bridge/ui/styles.css
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
/* background-image: url('https://i.ytimg.com/vi/NQryvJ1qNZs/maxresdefault.jpg');
|
||||
background-color: #333;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat; */
|
||||
}
|
||||
|
||||
.game-screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
/* background-color: rgba(0, 0, 0, 0.5); */
|
||||
}
|
||||
|
||||
.help-text {
|
||||
display: block;
|
||||
opacity: 0;
|
||||
transition: all ease-in-out 0.2s;
|
||||
position: absolute;
|
||||
top: 1%;
|
||||
left: 10px;
|
||||
background-color: rgba(18, 18, 18, 0.85);
|
||||
border: 1px solid rgba(114, 76, 157, 0.1);
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.25), 0px 0px 1px rgba(255, 255, 255, 0.25);
|
||||
padding: 10px 15px;
|
||||
color: #f1f1f1;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.text-ui {
|
||||
display: flex;
|
||||
opacity: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all ease-in-out 0.2s;
|
||||
color: white;
|
||||
padding: 8px 10px;
|
||||
background-color: rgba(18, 18, 18, 0.85);
|
||||
border: 1px solid rgba(114, 76, 157, 0.1);
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
text-transform: uppercase;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
right: 15px;
|
||||
transform: translateY(-50%);
|
||||
z-index: 1000;
|
||||
flex-direction: row;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-ui button {
|
||||
font-weight: 700;
|
||||
margin-right: 6px;
|
||||
padding: 6px 9px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
background: #6E6D70;
|
||||
box-shadow: 0px 0.5px 1px rgba(0, 0, 0, 0.1), inset 0px 0.5px 0.5px rgba(255, 255, 255, 0.5), 0px 0px 0px 0.5px rgba(0, 0, 0, 0.12);
|
||||
color: #DFDEDF;
|
||||
}
|
||||
|
||||
.text-ui p {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #DFDEDF;
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue