diff --git a/[esx]/esx_context/config.lua b/[esx]/esx_context/config.lua index 909b3805..c8812138 100644 --- a/[esx]/esx_context/config.lua +++ b/[esx]/esx_context/config.lua @@ -1 +1 @@ -PREVIEW_KEYBIND = false -- "LMENU" \ No newline at end of file +PREVIEW_KEYBIND = "LMENU" \ No newline at end of file diff --git a/[esx]/esx_context/index.html b/[esx]/esx_context/index.html index 27168ec1..c44b7d3e 100644 --- a/[esx]/esx_context/index.html +++ b/[esx]/esx_context/index.html @@ -142,6 +142,61 @@ ::-webkit-scrollbar-thumb:hover { background: rgb(30,30,30); } + + .container { + display: flex; + position: relative; + cursor: pointer; + font-size: 14px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + flex-direction: row-reverse; + align-items: center; + justify-content: flex-end; + gap: 5px; + } + + /* Hide the browser's default checkbox */ + .container input { + position: relative; + opacity: 0; + cursor: pointer; + height: 0; + width: 0; + } + + /* Create a custom checkbox */ + .checkmark { + position: relative; + height: 10px; + width: 10px; + border-radius: 8px; + background-color: #eee; + } + + /* On mouse-over, add a grey background color */ + .container:hover input ~ .checkmark { + background-color: #ccc; + } + + /* When the checkbox is checked, add a blue background */ + .container input:checked ~ .checkmark { + background-color: #2196F3; + } + + /* Create the checkmark/indicator (hidden when not checked) */ + .checkmark:after { + content: ""; + position: relative; + display: none; + } + + /* Show the checkmark when checked */ + .container input:checked ~ .checkmark:after { + display: block; + } @@ -204,50 +259,72 @@ } if (ele.input) { - let input = CreateElement("input","",div) - input.type = ele.inputType + if (ele.inputType == "radio") { + for (let j=0;j diff --git a/[esx]/esx_context/main.lua b/[esx]/esx_context/main.lua index 6f3634d7..5a879643 100644 --- a/[esx]/esx_context/main.lua +++ b/[esx]/esx_context/main.lua @@ -131,6 +131,8 @@ RegisterNUICallback("changed",function(data) end elseif ele.inputType == "text" then ele.inputValue = data.value + elseif ele.inputType == "radio" then + ele.inputValue = data.value end end)