diff --git a/scripts/autoload/donation_service.gd b/scripts/autoload/donation_service.gd index 3dde971..c0b7308 100644 --- a/scripts/autoload/donation_service.gd +++ b/scripts/autoload/donation_service.gd @@ -5,7 +5,6 @@ const DEFAULT_URL := "https://s3q.ranaze.com/api/donations" const REQUEST_TIMEOUT_SECONDS := 30.0 const POLL_INTERVAL_SECONDS := 3.0 const POLL_LIMIT := 200 -const CHECKOUT_STORAGE_KEY := "ranaze_donation_checkout_url" signal checkout_started(donation_id: String, checkout_url: String) signal donation_status_changed(status: String, donation: Dictionary) @@ -47,7 +46,6 @@ func begin_checkout(amount_cents: int) -> void: if not AuthState.can_send_authenticated_request(): donation_failed.emit("Log in before making a contribution.") return - _prepare_browser_window() checkout_pending = true request_token = AuthState.access_token var headers := PackedStringArray([ @@ -59,7 +57,6 @@ func begin_checkout(amount_cents: int) -> void: JSON.stringify({"amountCents": amount_cents})) if error != OK: checkout_pending = false - _close_browser_window() donation_failed.emit("The secure checkout request could not be started.") @@ -83,18 +80,15 @@ func _on_checkout_completed(result: int, response_code: int, _headers: PackedStr if response_code == 401: AuthState.handle_unauthorized(request_token) if result != HTTPRequest.RESULT_SUCCESS or response_code < 200 or response_code >= 300: - _close_browser_window() donation_failed.emit(_failure_message("Checkout could not be started.", result, response_code, body)) return var parsed: Variant = JSON.parse_string(body.get_string_from_utf8()) if typeof(parsed) != TYPE_DICTIONARY: - _close_browser_window() donation_failed.emit("The donation service returned an invalid response.") return var donation_id := str(parsed.get("donationId", "")) var checkout_url := str(parsed.get("checkoutUrl", "")) if donation_id.is_empty() or not checkout_url.begins_with("https://"): - _close_browser_window() donation_failed.emit("The donation service returned an invalid checkout link.") return active_donation_id = donation_id @@ -137,29 +131,13 @@ func _on_status_completed(result: int, response_code: int, _headers: PackedStrin stop_polling() -func _prepare_browser_window() -> void: - if OS.has_feature("web"): - JavaScriptBridge.eval( - "window.localStorage.removeItem('%s'); var ranazeDonationBridge = new URL('/external-redirect.html?key=%s&provider=Stripe', window.location.origin).href; window.medmindDonationWindow = window.open(ranazeDonationBridge, 'medmind_donation_checkout');" % [CHECKOUT_STORAGE_KEY, CHECKOUT_STORAGE_KEY], - true) - - func _open_checkout_url(url: String) -> void: if OS.has_feature("web"): - JavaScriptBridge.eval( - "var ranazeDonationUrl = %s; window.localStorage.setItem('%s', ranazeDonationUrl); if (window.medmindDonationWindow && !window.medmindDonationWindow.closed) { try { window.medmindDonationWindow.location.replace(ranazeDonationUrl); } catch (_) {} window.medmindDonationWindow.focus(); } else { var ranazeDonationPopup = window.open(ranazeDonationUrl, 'medmind_donation_checkout'); if (ranazeDonationPopup) { window.medmindDonationWindow = ranazeDonationPopup; ranazeDonationPopup.focus(); } else { window.location.assign(ranazeDonationUrl); } }" % [JSON.stringify(url), CHECKOUT_STORAGE_KEY], - true) + JavaScriptBridge.eval("window.location.assign(%s);" % JSON.stringify(url), true) else: OS.shell_open(url) -func _close_browser_window() -> void: - if OS.has_feature("web"): - JavaScriptBridge.eval( - "window.localStorage.removeItem('%s'); if (window.medmindDonationWindow && !window.medmindDonationWindow.closed) { window.medmindDonationWindow.close(); } window.medmindDonationWindow = null;" % CHECKOUT_STORAGE_KEY, - true) - - func _failure_message(prefix: String, result: int, response_code: int, body: PackedByteArray) -> String: if result != HTTPRequest.RESULT_SUCCESS and response_code == 0: return "%s Check your connection and try again." % prefix diff --git a/scripts/ui/login_screen.gd b/scripts/ui/login_screen.gd index d3a4c97..5a4ff9a 100644 --- a/scripts/ui/login_screen.gd +++ b/scripts/ui/login_screen.gd @@ -651,7 +651,7 @@ func _on_reset_confirmed(result: int, code: int, _headers: PackedStringArray, bo func _start_steam() -> void: if OS.has_feature("web"): var popup_result: Variant = JavaScriptBridge.eval( - "window.localStorage.removeItem('%s'); var ranazeSteamBridge = new URL('/external-redirect.html?key=%s&provider=Steam', window.location.origin).href; window.ranazeSteamWindow = window.open(ranazeSteamBridge, 'ranaze_steam'); window.ranazeSteamWindow !== null;" % [STEAM_AUTH_STORAGE_KEY, STEAM_AUTH_STORAGE_KEY], + "window.localStorage.removeItem('%s'); var ranazeSteamBridge = new URL('/external-redirect.html?key=%s&provider=Steam', window.location.origin).href; window.ranazeSteamWindow = window.open(ranazeSteamBridge, 'ranaze_steam', 'popup=yes,width=560,height=720,resizable=yes,scrollbars=yes'); if (window.ranazeSteamWindow) { window.ranazeSteamWindow.blur(); window.focus(); } window.ranazeSteamWindow !== null;" % [STEAM_AUTH_STORAGE_KEY, STEAM_AUTH_STORAGE_KEY], true ) steam_popup_opened = bool(popup_result) diff --git a/web/Dockerfile b/web/Dockerfile index df7381f..214d5b5 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -33,7 +33,7 @@ RUN mkdir -p /build \ && sed -i "s|custom_template/release=\"\"|custom_template/release=\"/root/.local/share/godot/export_templates/${GODOT_TEMPLATE_DIR}/web_nothreads_release.zip\"|" export_presets.cfg \ && godot --headless --editor --path /src --quit \ && godot --verbose --headless --path /src --export-release Web /build/index.html \ - && cp /src/assets/branding/ranaze-mark.png /build/ranaze-loader-icon.png \ + && cp /src/web/ranaze-loader-icon-v1.png /build/ranaze-loader-icon-v1.png \ && cp /src/assets/fonts/Inter-Variable.ttf /build/medmind-inter.ttf \ && cp /src/web/donation-complete.html /build/donation-complete.html \ && cp /src/web/donation-canceled.html /build/donation-canceled.html \ @@ -41,7 +41,7 @@ RUN mkdir -p /build \ && mkdir -p /build/legal \ && cp /src/legal/legal_documents.json /build/legal/legal_documents.json \ && test -s /build/index.html \ - && test -s /build/ranaze-loader-icon.png \ + && test -s /build/ranaze-loader-icon-v1.png \ && test -s /build/medmind-inter.ttf \ && test -s /build/donation-complete.html \ && test -s /build/donation-canceled.html \ diff --git a/web/donation-canceled.html b/web/donation-canceled.html index 29a96cb..f011e45 100644 --- a/web/donation-canceled.html +++ b/web/donation-canceled.html @@ -11,9 +11,9 @@ :root[data-theme=light]{--bg:#f1f5f9;--surface:#fff;--border:#dbe3ef;--text:#0f172a;--muted:#64748b} *{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif} main{width:min(560px,100%);padding:40px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-align:center} - img{width:84px;height:84px;object-fit:contain}h1{margin:22px 0 12px;font-size:30px}p{margin:0;color:var(--muted);font-size:17px;line-height:1.6} + img{width:84px;height:84px;object-fit:contain}h1{margin:22px 0 12px;font-size:30px}p{margin:0;color:var(--muted);font-size:17px;line-height:1.6}a{display:inline-block;margin-top:22px;color:var(--accent);font-weight:700} -
RanaZe

Checkout canceled

No contribution was completed. You can close this tab and return to RanaZe.

+
RanaZe

Checkout canceled

No contribution was completed.

Return to RanaZe
diff --git a/web/donation-complete.html b/web/donation-complete.html index f694d55..6edc761 100644 --- a/web/donation-complete.html +++ b/web/donation-complete.html @@ -11,9 +11,9 @@ :root[data-theme=light]{--bg:#f1f5f9;--surface:#fff;--border:#dbe3ef;--text:#0f172a;--muted:#64748b} *{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif} main{width:min(560px,100%);padding:40px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-align:center} - img{width:84px;height:84px;object-fit:contain}h1{margin:22px 0 12px;font-size:30px}p{margin:0;color:var(--muted);font-size:17px;line-height:1.6}.status{color:var(--success);font-weight:700} + img{width:84px;height:84px;object-fit:contain}h1{margin:22px 0 12px;font-size:30px}p{margin:0;color:var(--muted);font-size:17px;line-height:1.6}.status{color:var(--success);font-weight:700}a{display:inline-block;margin-top:22px;color:var(--accent);font-weight:700} -
RanaZe

Thank you for supporting RanaZe

Your checkout is complete.

You can close this tab and return to RanaZe. Stripe will send your receipt by email.

+
RanaZe

Thank you for supporting RanaZe

Your checkout is complete.

Stripe will send your receipt by email.

Return to RanaZe
diff --git a/web/medmind_shell.html b/web/medmind_shell.html index 8bdcbec..7d3ffa7 100644 --- a/web/medmind_shell.html +++ b/web/medmind_shell.html @@ -171,7 +171,6 @@ display: block; height: 100%; object-fit: contain; - transform: scale(2.1); width: 100%; } @@ -320,7 +319,7 @@
- +
RanaZe diff --git a/web/nginx.conf b/web/nginx.conf index ad7a672..331eca6 100644 --- a/web/nginx.conf +++ b/web/nginx.conf @@ -49,12 +49,18 @@ server { # Godot exports reuse these filenames across releases. Revalidate them so a # newly deployed index never boots an older cached project package. - location ~ ^/(index\.(js|pck|wasm)|ranaze-loader-icon\.png|medmind-inter\.ttf)$ { + location ~ ^/(index\.(js|pck|wasm)|medmind-inter\.ttf)$ { add_header Cache-Control "no-cache, no-store, must-revalidate" always; add_header X-Content-Type-Options "nosniff" always; try_files $uri =404; } + location = /ranaze-loader-icon-v1.png { + add_header Cache-Control "public, max-age=31536000, immutable" always; + add_header X-Content-Type-Options "nosniff" always; + try_files $uri =404; + } + location / { add_header Cache-Control "public, max-age=3600" always; add_header X-Content-Type-Options "nosniff" always; diff --git a/web/ranaze-loader-icon-v1.png b/web/ranaze-loader-icon-v1.png new file mode 100644 index 0000000..d8b6f1d Binary files /dev/null and b/web/ranaze-loader-icon-v1.png differ diff --git a/web/ranaze-loader-icon-v1.png.import b/web/ranaze-loader-icon-v1.png.import new file mode 100644 index 0000000..93c0ef5 --- /dev/null +++ b/web/ranaze-loader-icon-v1.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8l4x7ywr02cr" +path="res://.godot/imported/ranaze-loader-icon-v1.png-a03a63655f2868827958b7c7a5cec183.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://web/ranaze-loader-icon-v1.png" +dest_files=["res://.godot/imported/ranaze-loader-icon-v1.png-a03a63655f2868827958b7c7a5cec183.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1