use hbox instead of richtextlabel for nested text tags, complete invite creation

This commit is contained in:
Face
2025-08-23 14:45:45 +03:00
parent 00b78f86fb
commit e19d4b7f61
12 changed files with 205 additions and 134 deletions

View File

@@ -47,7 +47,7 @@
<input id="password" type="password" placeholder="Password" required="true" />
<button type="submit" id="submit">Log In</button>
</form>
<p style="text-center mt-4 text-[#999999] text-base">Don't have an account? <a href="/signup.html">Register here</a></p>
<p style="text-center mt-4 text-[#999999] text-sm">Don't have an account? <a href="/signup.html">Register here</a></p>
<p id="log-output" style="min-h-24"></p>
</div>

View File

@@ -46,7 +46,7 @@
}
.form-input {
w-full p-3 border border-gray-600 rounded-md bg-[#374151] text-white active:border-red-500
w-64 p-3 border border-gray-600 rounded-md bg-[#374151] text-white active:border-red-500
}
.card {

View File

@@ -7,6 +7,7 @@ local tldSelector = gurt.select('#tld-selector')
local loadingElement = gurt.select('#tld-loading')
local displayElement = gurt.select('#invite-code-display')
local remainingElement = gurt.select('#remaining')
local redeemBtn = gurt.select('#redeem-invite-btn')
local options
@@ -169,6 +170,10 @@ local function createInvite()
displayElement.text = 'Invite code: ' .. inviteCode .. ' (copied to clipboard)'
displayElement:show()
Clipboard.write(inviteCode)
user.registrations_remaining = user.registrations_remaining - 1
updateUserInfo()
print('Invite code created and copied to clipboard: ' .. inviteCode)
else
print('Failed to create invite: ' .. response:text())
@@ -197,7 +202,11 @@ local function redeemInvite(code)
updateUserInfo()
-- Clear form
gurt.select('#invite-code-input').text = ''
gurt.select('#invite-code-input').value = ''
redeemBtn.text = 'Success!'
gurt.setTimeout(function()
redeemBtn.text = 'Redeem'
end, 1000)
else
local error = response:text()
showError('redeem-error', 'Failed to redeem invite: ' .. error)
@@ -236,8 +245,8 @@ end)
gurt.select('#create-invite-btn'):on('click', createInvite)
gurt.select('#redeem-invite-btn'):on('click', function()
local code = gurt.select('#invite-code-input').text
redeemBtn:on('click', function()
local code = gurt.select('#invite-code-input').value
if code and code ~= '' then
redeemInvite(code)
end

View File

@@ -61,7 +61,7 @@
<input id="confirm-password" type="password" placeholder="Confirm Password" required="true" />
<button type="submit" id="submit">Create Account</button>
</form>
<p style="text-center mt-4 text-[#999999] text-base">Already have an account? <a href="index.html">Login here</a></p>
<p style="text-center mt-4 text-[#999999] text-sm">Already have an account? <a href="index.html">Login here</a></p>
<p id="log-output" style="min-h-24"></p>
</div>