diff --git a/client.lua b/client.lua new file mode 100644 index 0000000..4fc382c --- /dev/null +++ b/client.lua @@ -0,0 +1,62 @@ +--[[ + Discord: https://discord.gg/xJT9XYDHkW + Script by 76B Store + + Copyright (c) 2023 76B Store. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +--]] + +local QBCore = exports['qb-core']:GetCoreObject() + +function Show(title, content) + SendNUIMessage({ + action = "open", + title = title, + content = content + }) +end + +function Close() + print("[76B Store] Closing NUI") + SendNUIMessage({ + action = "close", + }) +end + +exports("Show", Show) + +RegisterCommand('open', function(source, args, rawCommand) + if #args < 2 then + Show(args[1]) + return + end + + print(args[1]) + print("[76B Store] Opening UI with title: " .. args[1] .. ", content: " .. args[2]) + + -- Assuming Show is a function defined elsewhere in your script + Show(args[1], args[2]) +end) + + +RegisterCommand('close', function(source, args, RawCommand) + print("[76B Store] Closing NUI") + Close() +end) diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 0000000..b692690 --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,16 @@ +fx_version 'cerulean' +game 'gta5' + +author 'Your Name' +description 'Your Resource Description' +version '1.0.0' + +ui_page 'index.html' + +files { + 'index.html', + 'styles.css', + 'script.js', +} + +client_script 'client.lua' diff --git a/index.html b/index.html new file mode 100644 index 0000000..a6253f2 --- /dev/null +++ b/index.html @@ -0,0 +1,22 @@ + + + + + + + + + + Towing Contractor + + +
+
+ Waiting for orders... +
+
+
+
Chicken Burger 1x and Sousage 3x
+
+ + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..cc256f4 --- /dev/null +++ b/script.js @@ -0,0 +1,42 @@ +// Wrap your code in an immediately-invoked function expression to avoid polluting the global scope +(function() { + // Cache frequently used elements to avoid repeatedly querying the DOM + var mainElement = document.getElementById("main"); + var content1Element = document.getElementById("content1"); + var content2Element = document.getElementById("content2"); + + // Set initial style for the main element + mainElement.style.display = "none"; + + // Event listener for messages + window.addEventListener("message", function(event) { + if (event.data.action === "open") { + // Update main element style + mainElement.style.display = "block"; + + // Check if content is undefined and update content2 element style accordingly + content2Element.style.display = (event.data.content === undefined) ? "none" : "block"; + + // Update content elements + content1Element.innerHTML = event.data.title; + content2Element.innerHTML = event.data.content; + + // Use jQuery to animate the main element + $('#main').animate({ + 'margin-left': '-5%' + }); + } else if (event.data.action === "close") { + // Use jQuery to animate the main element + $('#main').animate({ + 'margin-left': '-30%' + }); + + // Set a timeout to hide the main element and clear content after animation + setTimeout(function() { + mainElement.style.display = "none"; + content1Element.innerHTML = ""; + content2Element.innerHTML = ""; + }, 1000); + } + }); +})(); diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..3af2a69 --- /dev/null +++ b/styles.css @@ -0,0 +1,72 @@ +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap'); +body { + margin: 0; + padding: 0; + height: 100vh; + display: flex; + justify-content: flex-start; + align-items: center; +} + +.container { + text-align: center; + margin-left: -17%; /* Abstand zur linken Seite anpassen */ + max-width: 30%; /* Maximale Breite des Containers */ + min-width: 30%; /* Maximale Breite des Containers */ +} + +.title { + font-family: 'Roboto', sans-serif; + color: rgb(1, 255, 158); + font-size: 20px; + font-weight: bold; + margin-bottom: 10px; + position: relative; + display: inline-block; + margin-left: -3%; +} + +.separator { + content: ""; + height: 5px; + width: 60%; + display: block; + left: 0; + right: 0; + border-radius: 50%; + align-content: center; + background: rgb(255,255,255); + background: linear-gradient(90deg, rgba(255,255,255,0.014443277310924318) 0%, rgba(140,140,140,1) 33%, rgba(181,181,181,1) 66%, rgba(255,255,255,0) 100%); + + bottom: 0; + margin-left: 18%; +} +.separator2 { + content: ""; + height: 5px; + width: 30%; + display: block; + left: 0; + right: 0; + align-content: center; + background: rgb(1, 255, 158); + box-shadow: 0px 5px 30px #01ff9e, 0px -5px 30px #01ff9e; + margin-left: 33%; + margin-top: -0.9%; +} + + +.content { + font-family: 'Roboto', sans-serif; + margin-top: 5%; + margin-left: 29%; + border-radius: 10px; + border: 1px solid rgb(128, 128, 128); + background-color: rgba(109, 109, 109, 0.397); + max-width: 30%; /* Maximale Breite des Containers */ + min-width: 20%; /* Maximale Breite des Containers */ + font-size: 16px; + overflow-wrap: break-word; + padding: 5%; + color: white; +} \ No newline at end of file