Skip to content

Commit

Permalink
edited version of cd_drawtextui
Browse files Browse the repository at this point in the history
  • Loading branch information
dojwun authored Aug 3, 2024
1 parent 0bae0f5 commit 2f1efca
Show file tree
Hide file tree
Showing 7 changed files with 827 additions and 0 deletions.
674 changes: 674 additions & 0 deletions casino-ui/LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions casino-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# casinoUi

edited version of dsheedes cd_drawtextui

- Original Creator: https://github.com/dsheedes/cd_drawtextui
35 changes: 35 additions & 0 deletions casino-ui/client/main.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
RegisterNetEvent('casinoUi:ShowUI')
AddEventHandler('casinoUi:ShowUI', function(action, text)
SendNUIMessage({
action = action,
text = text,
})
end)

RegisterNetEvent('casinoUi:HideUI')
AddEventHandler('casinoUi:HideUI', function()
SendNUIMessage({
action = 'hide'
})
end)

function DrawCasinoUi(action, text)
SendNUIMessage({
action = action,
text = text,
})
end

function HideCasinoUi()
SendNUIMessage({
action = 'hide'
})
end

-- RegisterCommand('test', function()
-- exports['casinoUi']:DrawCasinoUi('show', "Diamond Casino Blackjack</p>Balance: $5000Test</br>Bet: 10000Test")
-- Wait(3700)
-- exports['casinoUi']:HideCasinoUi('hide')
-- end, false)


25 changes: 25 additions & 0 deletions casino-ui/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
fx_version 'bodacious'
game 'gta5'

author 'Codesign#2715'
description 'Draw screen UI replacment for 3D text'
version '1.0'

ui_page {
'html/index.html',
}

files {
'html/index.html',
'html/js/script.js',
'html/css/stylesheet.css',
}

client_scripts {
'client/main.lua'
}

exports {
'DrawCasinoUi',
'HideCasinoUi',
}
60 changes: 60 additions & 0 deletions casino-ui/html/css/stylesheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
html, body{
width:100%;
height:100%;
margin:0;
padding:0;
overflow-x:hidden;
}
@keyframes fadeIn {
100% {opacity:1; top:90%; left:45%}
}
@keyframes fadeOut {
0% {opacity:1; top:90%; left:45%}
}
#container{
position:absolute;
top: 90%;
left: 45%;
/* width:10%; */
max-width:25%;
transform: translateY(-50%);
}

.fadeIn{
animation: fadeIn ease 1s forwards;
}
.fadeOut{
animation: fadeOut ease 1s forwards;
}

#box{
width:100%;
background:#25272C;
border-radius:5px;
}

#box:after {
content: '';
position: absolute;
left: 0;
top: 50%;
width: 0;
height: 0;
margin-top: -8px;
margin-left: -8px;
}

#title, #text{
width:calc(100% - 20px);
}

#text{
padding:10px;
color:#fff;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
font-weight: 600;
font-size:17px;
text-align:center;
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}

18 changes: 18 additions & 0 deletions casino-ui/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html5>
<html>
<head>
<title>Box</title>
</head>
<link rel="stylesheet" href="css/stylesheet.css" />
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet">
<body>
<script src="js/script.js"></script>
<div id="container" style="opacity:0">
<div id="box">
<div id="text">
<!-- Press E to open garage. -->
</div>
</div>
</div>
</body>
</html>
10 changes: 10 additions & 0 deletions casino-ui/html/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
window.addEventListener('message', function(event){
if(event.data.action == "show"){
document.getElementById("text").innerHTML = event.data.text;
document.getElementById("container").classList.remove("fadeOut");
document.getElementById("container").classList.add("fadeIn");
} else if(event.data.action == "hide"){
document.getElementById("container").classList.remove("fadeIn");
document.getElementById("container").classList.add("fadeOut");
}
});

0 comments on commit 2f1efca

Please sign in to comment.