save state
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<head>
|
||||
<link type="text/rcss" href="html.rcss"/>
|
||||
<link type="text/rcss" href="phone.rcss"/>
|
||||
<script src="scripts.lua"></script>
|
||||
<title>Fullscreen Mobile UI</title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -15,7 +16,12 @@
|
||||
|
||||
<div id="content">
|
||||
<div class="header-section">
|
||||
<h1>Hello omar 3 hello! and hello LEO 2 Hello!</h1>
|
||||
<h1>Mosis Service</h1>
|
||||
</div>
|
||||
|
||||
<div class="button-section">
|
||||
<button id="action-button" class="primary-button" onclick="onButtonClick()">Click Me!</button>
|
||||
<button id="reset-button" class="secondary-button" onclick="onResetClick()">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -105,4 +105,55 @@ h1 {
|
||||
|
||||
.nav-item:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
/* Button Section */
|
||||
.button-section {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
/* Primary Button Style */
|
||||
.primary-button {
|
||||
font-family: LatoLatin;
|
||||
font-size: 4em;
|
||||
padding: 30px 60px;
|
||||
margin: 20px;
|
||||
background-color: #3498db;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.primary-button:hover {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
.primary-button:active {
|
||||
background-color: #1c5a85;
|
||||
}
|
||||
|
||||
/* Secondary Button Style */
|
||||
.secondary-button {
|
||||
font-family: LatoLatin;
|
||||
font-size: 3em;
|
||||
padding: 20px 40px;
|
||||
margin: 20px;
|
||||
background-color: #7f8c8d;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.secondary-button:hover {
|
||||
background-color: #95a5a6;
|
||||
}
|
||||
|
||||
.secondary-button:active {
|
||||
background-color: #5d6d6e;
|
||||
}
|
||||
36
src/main/assets/scripts.lua
Normal file
36
src/main/assets/scripts.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
-- MosisService Lua Scripts
|
||||
-- Button click handlers and UI logic
|
||||
|
||||
-- Counter to track button clicks
|
||||
click_count = 0
|
||||
|
||||
-- Button click handler
|
||||
function onButtonClick()
|
||||
click_count = click_count + 1
|
||||
print("Button clicked! Count: " .. click_count)
|
||||
|
||||
-- Update the button text to show click count
|
||||
local document = rmlui.contexts["default"].documents[1]
|
||||
if document then
|
||||
local button = document:GetElementById("action-button")
|
||||
if button then
|
||||
button.inner_rml = "Clicked " .. click_count .. " times"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset counter function
|
||||
function onResetClick()
|
||||
click_count = 0
|
||||
print("Counter reset!")
|
||||
|
||||
local document = rmlui.contexts["default"].documents[1]
|
||||
if document then
|
||||
local button = document:GetElementById("action-button")
|
||||
if button then
|
||||
button.inner_rml = "Click Me!"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print("Lua scripts loaded successfully!")
|
||||
Reference in New Issue
Block a user