trying to port web app starter from PHP
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
String title = first(context.call["title"].to_string(), "Sign in with OAuth");
|
||||
String subtitle = first(context.call["subtitle"].to_string(), "Choose your preferred authentication method");
|
||||
String callback_url = first(context.call["callback_url"].to_string(), starter_link("auth/callback", context));
|
||||
|
||||
DTree services = context.call["services"];
|
||||
if(services.get_type_name() != "array" || services["google"]["name"].to_string() == "")
|
||||
{
|
||||
services["google"]["name"] = "Google";
|
||||
services["google"]["color"] = "#4285f4";
|
||||
services["google"]["icon"] = "fab fa-google";
|
||||
services["google"]["scope"] = "openid email profile";
|
||||
services["google"]["auth_url"] = "https://accounts.google.com/o/oauth2/v2/auth";
|
||||
|
||||
services["github"]["name"] = "GitHub";
|
||||
services["github"]["color"] = "#333333";
|
||||
services["github"]["icon"] = "fab fa-github";
|
||||
services["github"]["scope"] = "user:email";
|
||||
services["github"]["auth_url"] = "https://github.com/login/oauth/authorize";
|
||||
|
||||
services["discord"]["name"] = "Discord";
|
||||
services["discord"]["color"] = "#5865f2";
|
||||
services["discord"]["icon"] = "fab fa-discord";
|
||||
services["discord"]["scope"] = "identify email";
|
||||
services["discord"]["auth_url"] = "https://discord.com/api/oauth2/authorize";
|
||||
|
||||
services["twitch"]["name"] = "Twitch";
|
||||
services["twitch"]["color"] = "#9146ff";
|
||||
services["twitch"]["icon"] = "fab fa-twitch";
|
||||
services["twitch"]["scope"] = "user:read:email";
|
||||
services["twitch"]["auth_url"] = "https://id.twitch.tv/oauth2/authorize";
|
||||
}
|
||||
|
||||
<>
|
||||
<form class="card">
|
||||
<div>
|
||||
<h2><?= title ?></h2>
|
||||
<label><?= subtitle ?></label>
|
||||
</div>
|
||||
<? services.each([&](DTree service, String service_key) {
|
||||
String client_id = context.call[service_key + "_client_id"].to_string();
|
||||
String handler_name = starter_safe_name(service_key);
|
||||
String service_name = service["name"].to_string();
|
||||
String scope = service["scope"].to_string();
|
||||
String auth_url = service["auth_url"].to_string();
|
||||
String store_url = starter_link("auth/store-oauth-session", context);
|
||||
?><div data-service="<?= service_key ?>">
|
||||
<button type="button" class="btn" onclick='initiateOAuth_<?= handler_name ?>()'>
|
||||
<i class="<?= service["icon"].to_string() ?>" style="color: <?= service["color"].to_string() ?>"></i>
|
||||
Continue with <?= service_name ?>
|
||||
</button>
|
||||
<div class="loading" style="display: none;"><span>Connecting...</span></div>
|
||||
<label>Secure authentication via <?= service_name ?></label>
|
||||
<script>
|
||||
window.initiateOAuth_<?= handler_name ?> = function () {
|
||||
const wrapper = document.querySelector('[data-service="<?= service_key ?>"]');
|
||||
if (!wrapper) return;
|
||||
const button = wrapper.querySelector('.btn');
|
||||
const loading = wrapper.querySelector('.loading');
|
||||
if (button) button.style.display = 'none';
|
||||
if (loading) loading.style.display = 'block';
|
||||
|
||||
const clientId = <?: starter_json_string(client_id) ?>;
|
||||
if (!clientId || clientId.indexOf('YOUR_') === 0) {
|
||||
alert('<?= service_name ?> OAuth is not configured yet.');
|
||||
if (button) button.style.display = '';
|
||||
if (loading) loading.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
const state = btoa(Math.random().toString(36).substring(2) + Math.random().toString(36).substring(2)).replace(/[^a-zA-Z0-9]/g, '');
|
||||
const params = new URLSearchParams({
|
||||
client_id: clientId,
|
||||
redirect_uri: <?: starter_json_string(callback_url) ?>,
|
||||
scope: <?: starter_json_string(scope) ?>,
|
||||
response_type: 'code',
|
||||
state: state
|
||||
});
|
||||
|
||||
sessionStorage.setItem('oauth_state', state);
|
||||
sessionStorage.setItem('oauth_service', <?: starter_json_string(service_key) ?>);
|
||||
|
||||
fetch(<?: starter_json_string(store_url) ?>, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({oauth_service: <?: starter_json_string(service_key) ?>, oauth_state: state})
|
||||
}).catch(console.error).finally(() => {
|
||||
window.location.href = <?: starter_json_string(auth_url) ?> + '?' + params.toString();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</div><?
|
||||
}); ?>
|
||||
<div class="banner" id="oauth-status" style="display: none;"></div>
|
||||
</form>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
|
||||
<>
|
||||
<div id="cookie-consent" style="
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--surface);
|
||||
border-top: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-xl);
|
||||
z-index: 9998;
|
||||
padding: 1.5rem;
|
||||
transform: translateY(100%);
|
||||
transition: transform 0.3s ease;
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
" aria-live="polite">
|
||||
<div style="
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1.5rem;
|
||||
flex-wrap: wrap;
|
||||
">
|
||||
<div style="flex: 1; min-width: 300px;">
|
||||
<div style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 0.5rem;
|
||||
">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke='var(--primary)' stroke-width="2" style="flex-shrink: 0;">
|
||||
<path d="M12 2C13.1 2 14 2.9 14 4C14 5.1 13.1 6 12 6C10.9 6 10 5.1 10 4C10 2.9 10.9 2 12 2M21 9V7L15 1L13 3L15 5H3V21A2 2 0 0 0 5 23H19A2 2 0 0 0 21 21V11L19 13V20H5V7H21M9 11V13H7V11H9M13 11V13H11V11H13M17 11V13H15V11H17M9 15V17H7V15H9M13 15V17H11V15H13M17 15V17H15V15H17Z"/>
|
||||
</svg>
|
||||
<h3 style="margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-primary);">Cookie Notice</h3>
|
||||
</div>
|
||||
<p style="margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5;">
|
||||
We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic.
|
||||
<a href="#" id="cookie-policy-link" style="color: var(--primary); text-decoration: none;">Learn more</a>
|
||||
</p>
|
||||
</div>
|
||||
<div style="display: flex; gap: 0.75rem; flex-shrink: 0; align-items: center;">
|
||||
<button id="cookie-reject" style="padding: 0.75rem 1.5rem; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); border-radius: 0.5rem; cursor: pointer;">Reject All</button>
|
||||
<button id="cookie-accept" style="padding: 0.75rem 1.5rem; border: 1px solid var(--primary); background: var(--primary); color: white; border-radius: 0.5rem; cursor: pointer;">Accept All</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
let cookieConsent = document.getElementById('cookie-consent');
|
||||
let acceptButton = document.getElementById('cookie-accept');
|
||||
let rejectButton = document.getElementById('cookie-reject');
|
||||
let policyLink = document.getElementById('cookie-policy-link');
|
||||
if (!cookieConsent) return;
|
||||
|
||||
let COOKIE_NAME = 'cookie_consent';
|
||||
let COOKIE_EXPIRY_DAYS = 365;
|
||||
|
||||
function setCookie(name, value, days) {
|
||||
let expires = new Date();
|
||||
expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
document.cookie = name + '=' + value + ';expires=' + expires.toUTCString() + ';path=/;SameSite=Lax';
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
let nameEQ = name + '=';
|
||||
let ca = document.cookie.split(';');
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function hideBanner() {
|
||||
cookieConsent.style.transform = 'translateY(100%)';
|
||||
setTimeout(() => {
|
||||
cookieConsent.style.display = 'none';
|
||||
}, 300);
|
||||
}
|
||||
|
||||
let existingConsent = getCookie(COOKIE_NAME);
|
||||
if (!existingConsent) {
|
||||
setTimeout(() => {
|
||||
cookieConsent.style.transform = 'translateY(0)';
|
||||
}, 1);
|
||||
}
|
||||
|
||||
acceptButton.addEventListener('click', function() {
|
||||
setCookie(COOKIE_NAME, 'accepted', COOKIE_EXPIRY_DAYS);
|
||||
hideBanner();
|
||||
});
|
||||
|
||||
rejectButton.addEventListener('click', function() {
|
||||
setCookie(COOKIE_NAME, 'rejected', COOKIE_EXPIRY_DAYS);
|
||||
hideBanner();
|
||||
});
|
||||
|
||||
policyLink.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.open('https://example.com/privacy-policy', '_blank');
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
String data_format_bytes(String raw, bool disk = false)
|
||||
{
|
||||
if(trim(raw) == "")
|
||||
return("--");
|
||||
StringList units;
|
||||
units.push_back("B");
|
||||
units.push_back("KB");
|
||||
units.push_back("MB");
|
||||
units.push_back("GB");
|
||||
units.push_back("TB");
|
||||
units.push_back("PB");
|
||||
f64 value = atof(raw.c_str());
|
||||
u32 unit_index = 0;
|
||||
while((value >= 1024.0 || value <= -1024.0) && unit_index < units.size() - 1)
|
||||
{
|
||||
value /= 1024.0;
|
||||
unit_index += 1;
|
||||
}
|
||||
u32 decimals = disk ? (unit_index >= 4 ? 2 : (unit_index >= 1 ? 1 : 0)) : (unit_index == 0 ? 0 : 1);
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), ("%." + std::to_string(decimals) + "f").c_str(), value);
|
||||
return(String(buf) + " " + units[unit_index]);
|
||||
}
|
||||
|
||||
DTree data_format_value(DTree value, DTree row, DTree column)
|
||||
{
|
||||
DTree result;
|
||||
String format = column["format"].to_string();
|
||||
String raw = value.to_string();
|
||||
String sort_value = raw;
|
||||
String display_value = raw;
|
||||
if(format == "number")
|
||||
{
|
||||
display_value = raw;
|
||||
}
|
||||
else if(format == "bytes")
|
||||
{
|
||||
display_value = data_format_bytes(raw, false);
|
||||
}
|
||||
else if(format == "disk-bytes")
|
||||
{
|
||||
display_value = data_format_bytes(raw, true);
|
||||
}
|
||||
else if(format == "percent")
|
||||
{
|
||||
display_value = raw + "%";
|
||||
}
|
||||
else if(format == "duration-ms")
|
||||
{
|
||||
f64 number = atof(raw.c_str());
|
||||
if(number >= 1000.0)
|
||||
{
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), number >= 10000.0 ? "%.0f s" : "%.1f s", number / 1000.0);
|
||||
display_value = buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), number >= 100.0 ? "%.0f ms" : "%.1f ms", number);
|
||||
display_value = buf;
|
||||
}
|
||||
}
|
||||
else if(format == "bool")
|
||||
{
|
||||
bool on = raw == "1" || to_lower(raw) == "true" || to_lower(raw) == "yes";
|
||||
display_value = on ? "Yes" : "No";
|
||||
sort_value = on ? "1" : "0";
|
||||
}
|
||||
result["display"] = display_value;
|
||||
result["sort"] = sort_value;
|
||||
return(result);
|
||||
}
|
||||
|
||||
RENDER:SUMMARY_METRICS(Request& context)
|
||||
{
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
|
||||
<>
|
||||
<div class="dashboard-panel">
|
||||
<? if(title != "" || subtitle != "") { ?>
|
||||
<div class="dashboard-panel-header">
|
||||
<? if(title != "") { ?><h2><?= title ?></h2><? } ?>
|
||||
<? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="dashboard-stat-grid">
|
||||
<? context.call["items"].each([&](DTree item, String key) {
|
||||
String tone = first(item["tone"].to_string(), "info");
|
||||
String href = item["href"].to_string();
|
||||
String tag = href != "" ? "a" : "div";
|
||||
?><<?= tag ?> class="dashboard-stat-card tone-<?= tone ?>"<?= href != "" ? " href=\"" + html_escape(href) + "\"" : "" ?>>
|
||||
<div class="dashboard-stat-label"><?= first(item["label"].to_string(), "Metric") ?></div>
|
||||
<div class="dashboard-stat-value"><?= first(item["value"].to_string(), "--") ?></div>
|
||||
<? if(item["meta"].to_string() != "") { ?><div class="dashboard-stat-meta"><?= item["meta"].to_string() ?></div><? } ?>
|
||||
</<?= tag ?>><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:TIMESERIES_CHART(Request& context)
|
||||
{
|
||||
starter_register_js("js/u-format.js", context);
|
||||
starter_register_js("js/u-timeseries-chart.js", context);
|
||||
|
||||
String chart_id = first(context.call["id"].to_string(), "ts-chart-" + std::to_string((u64)time()));
|
||||
String canvas_id = chart_id + "-canvas";
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
s32 height = std::max(180, (s32)int_val(first(context.call["height"].to_string(), "320")));
|
||||
String x_axis_label = first(context.call["x_axis_label"].to_string(), "Time");
|
||||
String y_axis_left_label = first(context.call["y_axis_left_label"].to_string(), "Value");
|
||||
String y_axis_right_label = context.call["y_axis_right_label"].to_string();
|
||||
String y_axis_left_format = first(context.call["y_axis_left_format"].to_string(), "number");
|
||||
String y_axis_right_format = first(context.call["y_axis_right_format"].to_string(), "number");
|
||||
|
||||
<>
|
||||
<div class="dashboard-panel">
|
||||
<? if(title != "" || subtitle != "") { ?>
|
||||
<div class="dashboard-panel-header">
|
||||
<? if(title != "") { ?><h2><?= title ?></h2><? } ?>
|
||||
<? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<canvas id="<?= canvas_id ?>" class="dashboard-chart-canvas" style="height: <?= std::to_string(height) ?>px"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
if (typeof UTimeSeriesChart === 'undefined') return;
|
||||
var chart = new UTimeSeriesChart(<?: starter_json_string(canvas_id) ?>, {
|
||||
xAxisLabel: <?: starter_json_string(x_axis_label) ?>,
|
||||
yAxisLeftLabel: <?: starter_json_string(y_axis_left_label) ?>,
|
||||
yAxisRightLabel: <?: starter_json_string(y_axis_right_label) ?>,
|
||||
yAxisLeftFormat: <?: starter_json_string(y_axis_left_format) ?>,
|
||||
yAxisRightFormat: <?: starter_json_string(y_axis_right_format) ?>
|
||||
});
|
||||
chart.setData(<?= json_encode(context.call["series"]) ?>, <?= json_encode(context.call["x_labels"]) ?>);
|
||||
window[<?: starter_json_string("chart_" + chart_id) ?>] = chart;
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:SORTABLE_TABLE(Request& context)
|
||||
{
|
||||
starter_register_js("js/u-format.js", context);
|
||||
starter_register_js("js/u-sortable-table.js", context);
|
||||
|
||||
String table_id = first(context.call["id"].to_string(), "sortable-table-" + std::to_string((u64)time()));
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
String empty_label = first(context.call["empty_label"].to_string(), "No data available");
|
||||
|
||||
DTree init_options;
|
||||
init_options["storageKey"] = first(context.call["storage_key"].to_string(), "starter.sort." + table_id);
|
||||
if(context.call["sort"]["column"].to_string() != "")
|
||||
{
|
||||
init_options["initialSort"]["column"] = context.call["sort"]["column"];
|
||||
init_options["initialSort"]["direction"] = first(context.call["sort"]["direction"].to_string(), "asc");
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="dashboard-panel">
|
||||
<? if(title != "" || subtitle != "") { ?>
|
||||
<div class="dashboard-panel-header">
|
||||
<? if(title != "") { ?><h2><?= title ?></h2><? } ?>
|
||||
<? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div class="dashboard-table-wrap">
|
||||
<table id="<?= table_id ?>" class="u-sortable-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<? context.call["columns"].each([&](DTree column, String key) {
|
||||
String align = first(column["align"].to_string(), "left");
|
||||
bool sortable = column["sortable"].to_string() == "" || column["sortable"].to_string() == "1";
|
||||
?><th scope="col" class="align-<?= align ?>"<?= sortable ? "" : " data-sortable=\"false\"" ?>><?= first(column["label"].to_string(), column["key"].to_string(), "Column") ?></th><?
|
||||
}); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<? if(context.call["rows"].get_type_name() != "array" || context.call["rows"]["0"].get_type_name() != "array") { ?>
|
||||
<tr data-empty-row="1"><td colspan="<?= context.call["columns"]._map.size() == 0 ? "1" : std::to_string(context.call["columns"]._map.size()) ?>" class="muted"><?= empty_label ?></td></tr>
|
||||
<? } ?>
|
||||
<? context.call["rows"].each([&](DTree row, String key) {
|
||||
if(row.get_type_name() != "array")
|
||||
return;
|
||||
?><tr><?
|
||||
context.call["columns"].each([&](DTree column, String ckey) {
|
||||
String col_key = column["key"].to_string();
|
||||
DTree formatted = data_format_value(row[col_key], row, column);
|
||||
?><td class="align-<?= first(column["align"].to_string(), "left") ?>" data-sort-value="<?= formatted["sort"].to_string() ?>"><?= formatted["display"].to_string() ?></td><?
|
||||
});
|
||||
?></tr><?
|
||||
}); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
if (typeof USortableTable === 'undefined') return;
|
||||
USortableTable.init(<?: starter_json_string(table_id) ?>, <?= json_encode(init_options) ?>);
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:DATA_TABLE(Request& context)
|
||||
{
|
||||
String table_id = first(context.call["id"].to_string(), "data-grid-" + std::to_string((u64)time()));
|
||||
starter_register_js("js/ag-grid/ag-grid-community.min.js", context);
|
||||
starter_register_css("js/ag-grid/ag-grid.css", context);
|
||||
starter_register_css("js/ag-grid/ag-theme-alpine.css", context);
|
||||
|
||||
DTree columns = context.call["columns"];
|
||||
if((columns.get_type_name() != "array" || columns["0"]["field"].to_string() == "") &&
|
||||
context.call["items"]["0"].get_type_name() == "array")
|
||||
{
|
||||
context.call["items"]["0"].each([&](DTree value, String key) {
|
||||
DTree col;
|
||||
col["field"] = key;
|
||||
col["headerName"] = key;
|
||||
col["sortable"].set_bool(true);
|
||||
col["filter"].set_bool(true);
|
||||
col["resizable"].set_bool(true);
|
||||
columns.push(col);
|
||||
});
|
||||
}
|
||||
|
||||
DTree grid_options;
|
||||
grid_options["pagination"].set_bool(true);
|
||||
grid_options["paginationPageSize"] = first(context.call["options"]["paginationPageSize"].to_string(), "20");
|
||||
grid_options["suppressMenuHide"].set_bool(true);
|
||||
grid_options["animateRows"].set_bool(true);
|
||||
grid_options["columnDefs"] = columns;
|
||||
grid_options["rowData"] = context.call["items"];
|
||||
|
||||
<>
|
||||
<div class="ag-grid-container" style="margin: 1rem 0;">
|
||||
<div class="ag-grid-toolbar" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;padding:0.75rem;background:var(--surface-elevated);border:1px solid var(--border);border-radius:0.5rem 0.5rem 0 0;border-bottom:none;">
|
||||
<div style="display:flex;gap:1rem;align-items:center;flex:1;">
|
||||
<span style="color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;"><?= std::to_string(context.call["items"]._map.size()) ?> rows</span>
|
||||
<input type="text" id="<?= table_id ?>-search" placeholder="Search all columns..." style="padding:0.5rem 0.75rem;border:1px solid var(--border);border-radius:0.375rem;background:var(--surface);color:var(--text-primary);font-size:0.875rem;width:250px;" />
|
||||
</div>
|
||||
<div style="display:flex;gap:0.5rem;">
|
||||
<button id="<?= table_id ?>-export-csv" class="btn btn-outline">Export CSV</button>
|
||||
<button id="<?= table_id ?>-clear-filters" class="btn btn-outline">Clear Filters</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="<?= table_id ?>" class="ag-theme-alpine-dark" style="height: <?= first(context.call["height"].to_string(), "400px") ?>; width: 100%; border: 1px solid var(--border); border-radius: 0 0 0.5rem 0.5rem; overflow: hidden;"></div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
if (typeof agGrid === 'undefined') return;
|
||||
const gridOptions = <?= json_encode(grid_options) ?>;
|
||||
new agGrid.Grid(document.getElementById(<?: starter_json_string(table_id) ?>), gridOptions);
|
||||
document.getElementById(<?: starter_json_string(table_id + "-search") ?>)?.addEventListener('input', function () {
|
||||
gridOptions.api.setQuickFilter(this.value);
|
||||
});
|
||||
document.getElementById(<?: starter_json_string(table_id + "-clear-filters") ?>)?.addEventListener('click', function () {
|
||||
gridOptions.api.setFilterModel(null);
|
||||
gridOptions.api.setQuickFilter('');
|
||||
});
|
||||
document.getElementById(<?: starter_json_string(table_id + "-export-csv") ?>)?.addEventListener('click', function () {
|
||||
gridOptions.api.exportDataAsCsv();
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,604 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
void marketing_default_features(DTree& features)
|
||||
{
|
||||
if(features.get_type_name() == "array" && features["0"]["title"].to_string() != "")
|
||||
return;
|
||||
DTree item;
|
||||
|
||||
item["icon"] = "⚡";
|
||||
item["title"] = "Lightning Fast";
|
||||
item["description"] = "Optimized for speed and performance with modern web technologies.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🎨";
|
||||
item["title"] = "Beautiful Design";
|
||||
item["description"] = "Carefully crafted components with attention to detail and user experience.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "📱";
|
||||
item["title"] = "Mobile First";
|
||||
item["description"] = "Fully responsive design that works perfectly on all devices.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🔧";
|
||||
item["title"] = "Easy to Use";
|
||||
item["description"] = "Simple and intuitive component system for rapid development.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🛡️";
|
||||
item["title"] = "Secure";
|
||||
item["description"] = "Built with security best practices and server-side rendering first.";
|
||||
features.push(item);
|
||||
item.clear();
|
||||
|
||||
item["icon"] = "🚀";
|
||||
item["title"] = "Scalable";
|
||||
item["description"] = "Architecture designed to grow with your application needs.";
|
||||
features.push(item);
|
||||
}
|
||||
|
||||
RENDER:HERO_SECTION(Request& context)
|
||||
{
|
||||
String title = first(context.call["title"].to_string(), "Welcome to the Present");
|
||||
String subtitle = first(context.call["subtitle"].to_string(), "Experience no-quite-modern web development with our cutting-edge framework");
|
||||
String cta_text = first(context.call["cta_text"].to_string(), "Get Started");
|
||||
String cta_link = first(context.call["cta_link"].to_string(), "#");
|
||||
|
||||
<>
|
||||
<div class="hero-section">
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title"><?= title ?></h1>
|
||||
<p class="hero-subtitle"><?= subtitle ?></p>
|
||||
<div class="hero-actions">
|
||||
<a href="<?= cta_link ?>" class="btn btn-large hero-cta"><?= cta_text ?></a>
|
||||
<a href="#features" class="btn btn-outline btn-large">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="floating-card">
|
||||
<div class="card-header"></div>
|
||||
<div class="card-content">
|
||||
<div class="line"></div>
|
||||
<div class="line short"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="floating-elements">
|
||||
<div class="element element-1"></div>
|
||||
<div class="element element-2"></div>
|
||||
<div class="element element-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.hero-section {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
align-items: center;
|
||||
min-height: 70vh;
|
||||
padding: 4rem 2rem;
|
||||
background: var(--bg-gradient);
|
||||
color: var(--text-primary);
|
||||
border-radius: var(--radius-xl);
|
||||
margin-bottom: 4rem;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.hero-section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox=\"0 0 100 100\"><defs><pattern id=\"grain\" width=\"100\" height=\"100\" patternUnits=\"userSpaceOnUse\"><circle cx=\"25\" cy=\"25\" r=\"1\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"75\" cy=\"75\" r=\"1\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"50\" cy=\"10\" r=\"0.5\" fill=\"white\" opacity=\"0.1\"/><circle cx=\"10\" cy=\"90\" r=\"0.5\" fill=\"white\" opacity=\"0.1\"/></pattern></defs><rect width=\"100%\" height=\"100%\" fill=\"url(%23grain)\"/></svg>');
|
||||
}
|
||||
.hero-content { position: relative; z-index: 2; }
|
||||
.hero-title {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.1;
|
||||
background: none;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.hero-subtitle {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
opacity: 0.9;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.hero-cta {
|
||||
background: var(--surface);
|
||||
color: var(--primary);
|
||||
border: none;
|
||||
}
|
||||
.hero-visual {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 400px;
|
||||
}
|
||||
.floating-card {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
width: 280px;
|
||||
animation: float 6s ease-in-out infinite;
|
||||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.card-header {
|
||||
height: 60px;
|
||||
background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
|
||||
border-radius: 8px;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.card-content .line {
|
||||
height: 12px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.card-content .line.short { width: 60%; }
|
||||
.floating-elements { position: absolute; width: 100%; height: 100%; }
|
||||
.element {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
.element-1 { width: 60px; height: 60px; top: 20%; left: 10%; animation: float 4s ease-in-out infinite; }
|
||||
.element-2 { width: 40px; height: 40px; top: 60%; right: 15%; animation: float 5s ease-in-out infinite reverse; }
|
||||
.element-3 { width: 80px; height: 80px; bottom: 20%; left: 20%; animation: float 7s ease-in-out infinite; }
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
||||
50% { transform: translateY(-20px) rotate(10deg); }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.hero-section { grid-template-columns: 1fr; text-align: center; padding: 3rem 1rem; gap: 2rem; }
|
||||
.hero-title { font-size: 2.5rem; }
|
||||
.hero-subtitle { font-size: 1.1rem; }
|
||||
.hero-visual { height: 300px; }
|
||||
.floating-card { width: 240px; padding: 1.5rem; }
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$.ready(() => {
|
||||
const heroTitle = document.querySelector('.hero-title');
|
||||
if (!heroTitle || heroTitle.dataset.typed === '1') return;
|
||||
heroTitle.dataset.typed = '1';
|
||||
const text = heroTitle.textContent;
|
||||
heroTitle.textContent = '';
|
||||
let i = 0;
|
||||
const typeWriter = () => {
|
||||
heroTitle.textContent += text.charAt(i);
|
||||
i += 1;
|
||||
if (i < text.length) setTimeout(typeWriter, 24);
|
||||
};
|
||||
typeWriter();
|
||||
});
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:FEATURES_GRID(Request& context)
|
||||
{
|
||||
DTree features = context.call["features"];
|
||||
marketing_default_features(features);
|
||||
|
||||
<>
|
||||
<div class="features-section" id="features">
|
||||
<div class="features-header">
|
||||
<h2>Why Choose Our Framework?</h2>
|
||||
<p>Discover the powerful features that make development a breeze</p>
|
||||
</div>
|
||||
<div class="features-grid">
|
||||
<? features.each([&](DTree feature, String key) {
|
||||
?><div class="feature-card">
|
||||
<div class="feature-icon"><?: feature["icon"].to_string() ?></div>
|
||||
<h3 class="feature-title"><?= feature["title"].to_string() ?></h3>
|
||||
<p class="feature-description"><?= feature["description"].to_string() ?></p>
|
||||
<div class="feature-overlay"></div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.features-section { padding: 4rem 0; background: var(--bg-color); }
|
||||
.features-header { text-align: center; margin-bottom: 4rem; }
|
||||
.features-header h2 {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.features-header p { font-size: 1.25rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
|
||||
.features-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
.feature-card {
|
||||
background: var(--surface);
|
||||
padding: 2.5rem 2rem;
|
||||
border-radius: var(--radius-xl);
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border);
|
||||
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
}
|
||||
.feature-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-xl); border-color: var(--primary); }
|
||||
.feature-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--primary), var(--secondary));
|
||||
transform: scaleX(0);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.feature-card:hover::before { transform: scaleX(1); }
|
||||
.feature-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 1.5rem;
|
||||
display: inline-block;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
border-radius: 50%;
|
||||
color: white;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
.feature-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
|
||||
.feature-description { color: var(--text-secondary); line-height: 1.6; }
|
||||
.feature-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.feature-card:hover .feature-overlay { opacity: 0.05; }
|
||||
@media (max-width: 768px) {
|
||||
.features-grid { grid-template-columns: 1fr; gap: 1.5rem; padding: 0 0.5rem; }
|
||||
.features-header h2 { font-size: 2rem; }
|
||||
.feature-card { padding: 2rem 1.5rem; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:STATS_SECTION(Request& context)
|
||||
{
|
||||
DTree stats = context.call["stats"];
|
||||
if(stats.get_type_name() != "array" || stats["0"]["label"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
item["number"] = "99.9%"; item["label"] = "Uptime"; stats.push(item); item.clear();
|
||||
item["number"] = "500ms"; item["label"] = "Average Response"; stats.push(item); item.clear();
|
||||
item["number"] = "50K+"; item["label"] = "Active Users"; stats.push(item); item.clear();
|
||||
item["number"] = "24/7"; item["label"] = "Support"; stats.push(item);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="stats-section">
|
||||
<div class="stats-container">
|
||||
<div class="stats-header">
|
||||
<h2>Trusted by Developers Worldwide</h2>
|
||||
<p>Join thousands of developers who have chosen our framework</p>
|
||||
</div>
|
||||
<div class="stats-grid">
|
||||
<? stats.each([&](DTree stat, String key) {
|
||||
?><div class="stat-item">
|
||||
<div class="stat-number"><?= stat["number"].to_string() ?></div>
|
||||
<div class="stat-label"><?= stat["label"].to_string() ?></div>
|
||||
<div class="stat-bar"><div class="stat-fill"></div></div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.stats-section {
|
||||
background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
|
||||
color: var(--text-primary);
|
||||
padding: 4rem 0;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.stats-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; position: relative; z-index: 2; }
|
||||
.stats-header { text-align: center; margin-bottom: 4rem; }
|
||||
.stats-header h2 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 700; }
|
||||
.stats-header p { font-size: 1.25rem; opacity: 0.8; }
|
||||
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; }
|
||||
.stat-item {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
background: var(--glass-bg);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: var(--radius-xl);
|
||||
}
|
||||
.stat-number {
|
||||
font-size: 3rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.5rem;
|
||||
background: linear-gradient(135deg, var(--primary), var(--accent));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.stat-label { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1rem; font-weight: 500; }
|
||||
.stat-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
|
||||
.stat-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); width: 100%; }
|
||||
@media (max-width: 768px) {
|
||||
.stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
|
||||
.stats-header h2 { font-size: 2rem; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.stats-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:BRANDS_SHOWCASE(Request& context)
|
||||
{
|
||||
DTree logos = context.call["logos"];
|
||||
if(logos.get_type_name() != "array" || logos["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
for(s32 i = 1; i <= 6; i++)
|
||||
{
|
||||
item["name"] = "Brand " + std::to_string(i);
|
||||
item["url"] = "img/cat0" + std::to_string(i) + ".jpg";
|
||||
logos.push(item);
|
||||
item.clear();
|
||||
}
|
||||
}
|
||||
String title = first(context.call["title"].to_string(), "Trusted by Leading Companies");
|
||||
|
||||
<>
|
||||
<div class="brands-section">
|
||||
<div class="brands-container">
|
||||
<h3 class="brands-title"><?= title ?></h3>
|
||||
<div class="brands-grid">
|
||||
<? logos.each([&](DTree logo, String key) {
|
||||
?><div class="brand-item">
|
||||
<img src="<?= logo["url"].to_string() ?>" alt="<?= logo["name"].to_string() ?>" />
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.brands-section { padding: 3rem 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
||||
.brands-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; text-align: center; }
|
||||
.brands-title { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 2rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.brands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; align-items: center; }
|
||||
.brand-item { display: flex; align-items: center; justify-content: center; padding: 1rem; border-radius: var(--radius); transition: all 0.3s ease; }
|
||||
.brand-item:hover { transform: scale(1.05); background: var(--surface-hover); }
|
||||
.brand-item img { max-width: 100%; height: auto; opacity: 0.6; transition: opacity 0.3s ease; filter: grayscale(100%); }
|
||||
.brand-item:hover img { opacity: 1; filter: grayscale(0%); }
|
||||
@media (max-width: 768px) {
|
||||
.brands-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
|
||||
.brands-section { padding: 2rem 0; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:TESTIMONIALS(Request& context)
|
||||
{
|
||||
DTree testimonials = context.call["testimonials"];
|
||||
if(testimonials.get_type_name() != "array" || testimonials["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree item;
|
||||
item["name"] = "Sarah Johnson"; item["role"] = "Senior Developer at TechCorp"; item["avatar"] = "img/cat01.jpg"; item["content"] = "This framework has revolutionized our development process."; item["rating"] = "5"; testimonials.push(item); item.clear();
|
||||
item["name"] = "Michael Chen"; item["role"] = "CTO at StartupX"; item["avatar"] = "img/cat02.jpg"; item["content"] = "We switched from our legacy system and saw immediate improvements."; item["rating"] = "5"; testimonials.push(item); item.clear();
|
||||
item["name"] = "Emily Rodriguez"; item["role"] = "Full Stack Developer"; item["avatar"] = "img/cat03.jpg"; item["content"] = "The documentation is excellent and the learning curve is gentle."; item["rating"] = "5"; testimonials.push(item);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="testimonials-section">
|
||||
<div class="testimonials-container">
|
||||
<div class="testimonials-header">
|
||||
<h2>What Developers Say</h2>
|
||||
<p>Don't just take our word for it - hear from the community</p>
|
||||
</div>
|
||||
<div class="testimonials-grid">
|
||||
<? testimonials.each([&](DTree testimonial, String key) {
|
||||
?><div class="testimonial-card">
|
||||
<div class="testimonial-content">
|
||||
<div class="quote-icon">"</div>
|
||||
<p><?= testimonial["content"].to_string() ?></p>
|
||||
<div class="stars"><? for(s32 i = 0; i < int_val(first(testimonial["rating"].to_string(), "5")); i++) { ?><span class="star">★</span><? } ?></div>
|
||||
</div>
|
||||
<div class="testimonial-author">
|
||||
<img src="<?= testimonial["avatar"].to_string() ?>" alt="<?= testimonial["name"].to_string() ?>" class="avatar">
|
||||
<div class="author-info">
|
||||
<div class="author-name"><?= testimonial["name"].to_string() ?></div>
|
||||
<div class="author-role"><?= testimonial["role"].to_string() ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.testimonials-section { padding: 4rem 0; background: var(--bg-color); }
|
||||
.testimonials-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
|
||||
.testimonials-header { text-align: center; margin-bottom: 4rem; }
|
||||
.testimonials-header h2 { font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
|
||||
.testimonials-header p { font-size: 1.25rem; color: var(--text-secondary); }
|
||||
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; }
|
||||
.testimonial-card { background: var(--surface); border-radius: var(--radius-xl); padding: 2.5rem 2rem; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
|
||||
.quote-icon { font-size: 4rem; color: var(--primary); opacity: 0.3; line-height: 1; margin-bottom: 1rem; font-family: serif; }
|
||||
.testimonial-content p { font-size: 1.1rem; line-height: 1.7; color: var(--text-primary); margin-bottom: 1.5rem; }
|
||||
.stars { display: flex; gap: 0.25rem; }
|
||||
.star { color: #fbbf24; font-size: 1.25rem; }
|
||||
.testimonial-author { display: flex; align-items: center; gap: 1rem; }
|
||||
.avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
|
||||
.author-name { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
|
||||
.author-role { color: var(--text-secondary); font-size: 0.9rem; }
|
||||
@media (max-width: 768px) {
|
||||
.testimonials-grid { grid-template-columns: 1fr; gap: 1.5rem; }
|
||||
.testimonial-card { padding: 2rem 1.5rem; }
|
||||
.testimonials-header h2 { font-size: 2rem; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:PRICING_TABLE(Request& context)
|
||||
{
|
||||
DTree plans = context.call["plans"];
|
||||
if(plans.get_type_name() != "array" || plans["0"]["name"].to_string() == "")
|
||||
{
|
||||
DTree plan;
|
||||
DTree feature;
|
||||
|
||||
plan["name"] = "Starter"; plan["price"] = "Free"; plan["period"] = ""; plan["description"] = "Perfect for small projects and learning"; plan["cta"] = "Start Free"; feature = "Up to 3 projects"; plan["features"].push(feature); feature = "Community support"; plan["features"].push(feature); feature = "Basic components"; plan["features"].push(feature); plans.push(plan); plan.clear();
|
||||
plan["name"] = "Pro"; plan["price"] = "$24"; plan["period"] = "/mo"; plan["description"] = "For serious products and teams"; plan["cta"] = "Choose Pro"; plan["popular"].set_bool(true); feature = "Unlimited projects"; plan["features"].push(feature); feature = "Priority support"; plan["features"].push(feature); feature = "Advanced components"; plan["features"].push(feature); plans.push(plan); plan.clear();
|
||||
plan["name"] = "Enterprise"; plan["price"] = "$99"; plan["period"] = "/mo"; plan["description"] = "For larger teams and custom deployments"; plan["cta"] = "Contact Sales"; feature = "Custom integrations"; plan["features"].push(feature); feature = "Dedicated support"; plan["features"].push(feature); feature = "Architecture help"; plan["features"].push(feature); plans.push(plan);
|
||||
}
|
||||
|
||||
<>
|
||||
<div class="pricing-section">
|
||||
<div class="pricing-container">
|
||||
<div class="pricing-header">
|
||||
<h2>Simple Pricing</h2>
|
||||
<p>Choose the plan that fits your product stage.</p>
|
||||
</div>
|
||||
<div class="pricing-grid">
|
||||
<? plans.each([&](DTree plan, String key) {
|
||||
bool popular = plan["popular"].to_string() != "";
|
||||
?><div class="pricing-card<?= popular ? " popular" : "" ?>">
|
||||
<? if(popular) { ?><div class="popular-badge">Most Popular</div><? } ?>
|
||||
<div class="plan-header">
|
||||
<div class="plan-name"><?= plan["name"].to_string() ?></div>
|
||||
<div class="plan-price">
|
||||
<span class="price"><?= plan["price"].to_string() ?></span>
|
||||
<span class="period"><?= plan["period"].to_string() ?></span>
|
||||
</div>
|
||||
<p class="plan-description"><?= plan["description"].to_string() ?></p>
|
||||
</div>
|
||||
<ul class="plan-features">
|
||||
<? plan["features"].each([&](DTree feature, String feature_key) { ?><li><?= feature.to_string() ?></li><? }); ?>
|
||||
</ul>
|
||||
<div class="plan-footer">
|
||||
<button class="btn <?= popular ? "btn-primary" : "btn-outline" ?> btn-large plan-cta"><?= first(plan["cta"].to_string(), "Choose Plan") ?></button>
|
||||
</div>
|
||||
</div><?
|
||||
}); ?>
|
||||
</div>
|
||||
<div class="pricing-footer">
|
||||
<p>All plans include a 30-day money-back guarantee. No setup fees.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.pricing-section { padding: 5rem 0; background: var(--bg-color); }
|
||||
.pricing-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
|
||||
.pricing-header { text-align: center; margin-bottom: 4rem; }
|
||||
.pricing-header h2 { font-size: 2.5rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
|
||||
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
|
||||
.pricing-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-xl); padding: 2.5rem 2rem; position: relative; }
|
||||
.pricing-card.popular { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: scale(1.05); }
|
||||
.popular-badge { position: absolute; top: -1rem; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; padding: 0.5rem 1.5rem; border-radius: 50px; font-size: 0.875rem; font-weight: 600; }
|
||||
.plan-header { text-align: center; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
|
||||
.plan-name { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
|
||||
.price { font-size: 3rem; font-weight: 800; color: var(--primary); }
|
||||
.period { font-size: 1.125rem; color: var(--text-secondary); margin-left: 0.25rem; }
|
||||
.plan-description { color: var(--text-secondary); line-height: 1.6; }
|
||||
.plan-features { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.75rem; }
|
||||
.plan-features li { color: var(--text-primary); }
|
||||
.plan-footer { text-align: center; }
|
||||
.pricing-footer { text-align: center; color: var(--text-secondary); }
|
||||
@media (max-width: 768px) {
|
||||
.pricing-grid { grid-template-columns: 1fr; }
|
||||
.pricing-card.popular { transform: none; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:CTA_SECTION(Request& context)
|
||||
{
|
||||
String title = first(context.call["title"].to_string(), "Ready to Get Started?");
|
||||
String subtitle = first(context.call["subtitle"].to_string(), "Join thousands of developers building amazing applications with our framework.");
|
||||
String cta_text = first(context.call["cta_text"].to_string(), "Start Building Now");
|
||||
String cta_link = first(context.call["cta_link"].to_string(), "#");
|
||||
String secondary_text = first(context.call["secondary_text"].to_string(), "View Documentation");
|
||||
String secondary_link = first(context.call["secondary_link"].to_string(), "#");
|
||||
|
||||
<>
|
||||
<div class="cta-section">
|
||||
<div class="cta-container">
|
||||
<div class="cta-content">
|
||||
<h2 class="cta-title"><?= title ?></h2>
|
||||
<p class="cta-subtitle"><?= subtitle ?></p>
|
||||
<div class="cta-actions">
|
||||
<a href="<?= cta_link ?>" class="btn btn-large cta-primary"><?= cta_text ?></a>
|
||||
<a href="<?= secondary_link ?>" class="btn btn-outline btn-large cta-secondary"><?= secondary_text ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cta-visual">
|
||||
<div class="floating-shapes">
|
||||
<div class="shape shape-1"></div>
|
||||
<div class="shape shape-2"></div>
|
||||
<div class="shape shape-3"></div>
|
||||
<div class="shape shape-4"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.cta-section { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; padding: 5rem 0; position: relative; overflow: hidden; }
|
||||
.cta-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: grid; grid-template-columns: 2fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 2; }
|
||||
.cta-title { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; line-height: 1.1; }
|
||||
.cta-subtitle { font-size: 1.25rem; margin-bottom: 2.5rem; opacity: 0.9; line-height: 1.6; }
|
||||
.cta-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; }
|
||||
.cta-primary { background: white; color: var(--primary); border: 2px solid white; }
|
||||
.cta-secondary { border-color: rgba(255, 255, 255, 0.5); color: white; }
|
||||
.cta-visual { position: relative; height: 300px; display: flex; align-items: center; justify-content: center; }
|
||||
.floating-shapes { position: relative; width: 200px; height: 200px; }
|
||||
.shape { position: absolute; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px); border: 1px solid rgba(255, 255, 255, 0.2); }
|
||||
.shape-1 { width: 80px; height: 80px; border-radius: 20px; top: 0; left: 0; }
|
||||
.shape-2 { width: 60px; height: 60px; border-radius: 50%; top: 20px; right: 0; }
|
||||
.shape-3 { width: 100px; height: 40px; border-radius: 20px; bottom: 40px; left: 20px; }
|
||||
.shape-4 { width: 50px; height: 50px; border-radius: 10px; bottom: 0; right: 30px; transform: rotate(45deg); }
|
||||
@media (max-width: 968px) {
|
||||
.cta-container { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
|
||||
.cta-title { font-size: 2.5rem; }
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.cta-section { padding: 3rem 0; }
|
||||
.cta-title { font-size: 2rem; }
|
||||
.cta-subtitle { font-size: 1.1rem; }
|
||||
.cta-actions { justify-content: center; }
|
||||
}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
String current_theme = starter_theme_value("key", context);
|
||||
String current_label = first(starter_theme_value("label", context), current_theme);
|
||||
String route_path = context.var["starter"]["route"]["l_path"].to_string();
|
||||
|
||||
<>
|
||||
<div id="theme-switcher" style="position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 9999; font-family: inherit;">
|
||||
<style>
|
||||
#theme-switcher .theme-launcher {
|
||||
min-width: 56px;
|
||||
height: 56px;
|
||||
padding: 0 1rem;
|
||||
border-radius: 999px;
|
||||
background: var(--surface, #fff);
|
||||
border: 1px solid var(--border, rgba(0,0,0,0.15));
|
||||
box-shadow: var(--shadow-lg, 0 14px 32px rgba(0,0,0,0.18));
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.65rem;
|
||||
color: var(--text-primary, #111827);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
font: inherit;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
#theme-switcher .theme-launcher:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-xl, 0 22px 42px rgba(0,0,0,0.22));
|
||||
border-color: var(--primary, #2563eb);
|
||||
background: var(--surface-elevated, var(--surface, #fff));
|
||||
}
|
||||
#theme-switcher .theme-launcher-label {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#theme-switcher .theme-menu {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 68px;
|
||||
width: min(280px, calc(100vw - 2rem));
|
||||
padding: 0.6rem;
|
||||
border-radius: 14px;
|
||||
border: 1px solid var(--border, rgba(0,0,0,0.15));
|
||||
background: color-mix(in srgb, var(--surface, #fff) 92%, transparent 8%);
|
||||
box-shadow: var(--shadow-xl, 0 22px 42px rgba(0,0,0,0.22));
|
||||
}
|
||||
#theme-switcher .theme-menu[hidden] {
|
||||
display: none;
|
||||
}
|
||||
#theme-switcher .theme-menu-title {
|
||||
margin: 0 0 0.45rem;
|
||||
padding: 0.1rem 0.25rem 0.35rem;
|
||||
color: var(--text-secondary, #6b7280);
|
||||
font-size: 0.74rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#theme-switcher .theme-menu-list {
|
||||
display: grid;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
#theme-switcher .theme-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.7rem 0.8rem;
|
||||
border-radius: 10px;
|
||||
border: 1px solid transparent;
|
||||
color: var(--text-primary, #111827);
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
#theme-switcher .theme-option:hover {
|
||||
background: color-mix(in srgb, var(--primary, #2563eb) 10%, transparent 90%);
|
||||
border-color: color-mix(in srgb, var(--primary, #2563eb) 22%, transparent 78%);
|
||||
text-decoration: none;
|
||||
}
|
||||
#theme-switcher .theme-option.is-active {
|
||||
background: color-mix(in srgb, var(--primary, #2563eb) 16%, transparent 84%);
|
||||
border-color: color-mix(in srgb, var(--primary, #2563eb) 28%, transparent 72%);
|
||||
}
|
||||
#theme-switcher .theme-option small {
|
||||
color: var(--text-secondary, #6b7280);
|
||||
font-size: 0.76rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
@media (min-width: 860px) {
|
||||
#theme-switcher .theme-launcher-label {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<button id="theme-toggle" class="theme-launcher" aria-haspopup="true" aria-expanded="false" aria-label="Switch theme" title="Switch Theme" type="button">
|
||||
<i class="fas fa-palette" aria-hidden="true"></i>
|
||||
<span class="theme-launcher-label"><?= current_label ?></span>
|
||||
</button>
|
||||
<div id="theme-menu" class="theme-menu" hidden>
|
||||
<div class="theme-menu-title">Available Themes</div>
|
||||
<div class="theme-menu-list">
|
||||
<? starter_cfg("theme/options", context).each([&](DTree theme_info, String theme_key) {
|
||||
StringMap params;
|
||||
params["theme"] = theme_key;
|
||||
String href = starter_link(route_path == "index" ? "" : route_path, params, context);
|
||||
?><a class="theme-option<?= theme_key == current_theme ? " is-active" : "" ?>" href="<?= href ?>">
|
||||
<span><?= theme_info["label"].to_string() ?></span>
|
||||
<? if(theme_key == current_theme) { ?><small>Active</small><? } ?>
|
||||
</a><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const themeMenu = document.getElementById('theme-menu');
|
||||
|
||||
if (!themeToggle || !themeMenu) return;
|
||||
|
||||
themeToggle.addEventListener('click', function() {
|
||||
const isOpen = !themeMenu.hasAttribute('hidden');
|
||||
themeMenu.toggleAttribute('hidden', isOpen);
|
||||
themeToggle.setAttribute('aria-expanded', isOpen ? 'false' : 'true');
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(event) {
|
||||
if (!themeMenu.hasAttribute('hidden') && !document.getElementById('theme-switcher').contains(event.target)) {
|
||||
themeMenu.setAttribute('hidden', 'hidden');
|
||||
themeToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.key === 'Escape' && !themeMenu.hasAttribute('hidden')) {
|
||||
themeMenu.setAttribute('hidden', 'hidden');
|
||||
themeToggle.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER:PROGRESSBAR(Request& context)
|
||||
{
|
||||
starter_register_js("components/gauges/common.js", context);
|
||||
starter_register_css("themes/common/css/gauges.css", context);
|
||||
|
||||
String gauge_id = first(context.call["id"].to_string(), "progressbar-" + std::to_string((u64)time()));
|
||||
String layout = first(context.call["layout"].to_string(), "horizontal");
|
||||
String style = context.call["style"].to_string();
|
||||
String item_style = context.call["item-style"].to_string();
|
||||
String value_style = context.call["value-style"].to_string();
|
||||
String bar_style = context.call["bar-style"].to_string();
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
|
||||
<>
|
||||
<section class="gauge-set progressbar-set progressbar-set-<?= layout ?>" id="<?= gauge_id ?>" style="<?= style ?>">
|
||||
<? if(title != "") { ?>
|
||||
<div class="gauge-set-header">
|
||||
<h3><?= title ?></h3>
|
||||
<? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<? if(layout == "horizontal") { ?>
|
||||
<div class="progressbar-grid progressbar-grid-horizontal">
|
||||
<? context.call["items"].each([&](DTree bar, String bar_id) {
|
||||
DTree merged = context.call["scale"];
|
||||
bar.each([&](DTree item, String key) { merged[key] = item; });
|
||||
String label = first(merged["label"].to_string(), bar_id);
|
||||
String tooltip = merged["tooltip"].to_string();
|
||||
String unit = merged["unit"].to_string();
|
||||
f64 min_value = atof(first(merged["min"].to_string(), "0").c_str());
|
||||
f64 max_value = atof(first(merged["max"].to_string(), "100").c_str());
|
||||
f64 value = atof(first(merged["value"].to_string(), "0").c_str());
|
||||
f64 vrange = max_value - min_value;
|
||||
if(vrange == 0) vrange = 1;
|
||||
s32 pct = (s32)std::max(0.0, std::min(100.0, ((value - min_value) / vrange) * 100.0));
|
||||
String color = first(merged["color"].to_string(), "var(--primary)");
|
||||
?><section class="gauge-card progressbar-card progressbar-card-horizontal" title="<?= tooltip ?>" style="<?= item_style ?>">
|
||||
<div class="progressbar-card-head">
|
||||
<div class="gauge-metric-label progressbar-label"><?= label ?></div>
|
||||
<div class="gauge-metric-value progressbar-value" style="<?= value_style ?>" id="<?= gauge_id ?>-<?= bar_id ?>-value"><?= merged["value"].to_string() + unit ?></div>
|
||||
</div>
|
||||
<div class="progressbar-background progressbar-background-horizontal">
|
||||
<div class="progressbar-bar" id="<?= gauge_id ?>-<?= bar_id ?>-bar" style="background-color: <?= color ?>; <?= bar_style ?> width: <?= std::to_string(pct) ?>%;"></div>
|
||||
</div>
|
||||
<? if(tooltip != "") { ?><div class="gauge-metric-meta progressbar-meta"><?= tooltip ?></div><? } ?>
|
||||
</section><?
|
||||
}); ?>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<div class="progressbar-grid progressbar-grid-vertical" style="--progressbar-height: <?= first(context.call["height"].to_string(), "240") ?>px;">
|
||||
<? context.call["items"].each([&](DTree bar, String bar_id) {
|
||||
DTree merged = context.call["scale"];
|
||||
bar.each([&](DTree item, String key) { merged[key] = item; });
|
||||
String label = first(merged["label"].to_string(), bar_id);
|
||||
String tooltip = merged["tooltip"].to_string();
|
||||
String unit = merged["unit"].to_string();
|
||||
f64 min_value = atof(first(merged["min"].to_string(), "0").c_str());
|
||||
f64 max_value = atof(first(merged["max"].to_string(), "100").c_str());
|
||||
f64 value = atof(first(merged["value"].to_string(), "0").c_str());
|
||||
f64 vrange = max_value - min_value;
|
||||
if(vrange == 0) vrange = 1;
|
||||
s32 pct = (s32)std::max(0.0, std::min(100.0, ((value - min_value) / vrange) * 100.0));
|
||||
String color = first(merged["color"].to_string(), "var(--primary)");
|
||||
?><section class="gauge-card progressbar-card progressbar-card-vertical" title="<?= tooltip ?>" style="<?= item_style ?>">
|
||||
<div class="gauge-metric-label progressbar-label"><?= label ?></div>
|
||||
<div class="progressbar-background progressbar-background-vertical">
|
||||
<div class="progressbar-bar" id="<?= gauge_id ?>-<?= bar_id ?>-bar" style="background-color: <?= color ?>; <?= bar_style ?> height: <?= std::to_string(pct) ?>%;"></div>
|
||||
</div>
|
||||
<div class="gauge-metric-value progressbar-value" style="<?= value_style ?>" id="<?= gauge_id ?>-<?= bar_id ?>-value"><?= merged["value"].to_string() + unit ?></div>
|
||||
<? if(tooltip != "") { ?><div class="gauge-metric-meta progressbar-meta"><?= tooltip ?></div><? } ?>
|
||||
</section><?
|
||||
}); ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
</section>
|
||||
<? if(context.call["listen"].to_string() != "") { ?>
|
||||
<script>
|
||||
window.ProgressbarComponents = window.ProgressbarComponents || {
|
||||
start_listen : function(prop) {
|
||||
$.events.on('value-broadcast', function(data) {
|
||||
if(!prop.items || !prop.items[data.name]) return;
|
||||
let bar = Object.assign({}, prop.scale || {}, prop.items[data.name]);
|
||||
let vrange = (Number(bar.max || 100) - Number(bar.min || 0));
|
||||
if (!vrange) vrange = 1;
|
||||
let pct = Math.min(100, Math.max(0, (Number(data.value) - Number(bar.min || 0)) / vrange * 100));
|
||||
let barEl = document.getElementById(prop.id + '-' + data.name + '-bar');
|
||||
let valueEl = document.getElementById(prop.id + '-' + data.name + '-value');
|
||||
if (valueEl) valueEl.textContent = data.value + (bar.unit || '');
|
||||
if (barEl) {
|
||||
if (prop.layout === 'vertical') barEl.style.height = pct + '%';
|
||||
else barEl.style.width = pct + '%';
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
ProgressbarComponents.start_listen(<?= json_encode(context.call) ?>);
|
||||
</script>
|
||||
<? } ?>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:NEEDLEGAUGE(Request& context)
|
||||
{
|
||||
starter_register_css("themes/common/css/gauges.css", context);
|
||||
String gauge_id = first(context.call["id"].to_string(), "needlegauge-" + std::to_string((u64)time()));
|
||||
String style = context.call["style"].to_string();
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
s32 size = (s32)int_val(first(context.call["size"].to_string(), "200"));
|
||||
|
||||
<>
|
||||
<section class="gauge-set needlegauge-set" id="<?= gauge_id ?>" style="<?= style ?>">
|
||||
<? if(title != "") { ?><div class="gauge-set-header"><h3><?= title ?></h3><? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?></div><? } ?>
|
||||
<div class="needlegauge-grid">
|
||||
<? context.call["items"].each([&](DTree item, String item_id) {
|
||||
String label = first(item["label"].to_string(), item_id);
|
||||
String tooltip = item["tooltip"].to_string();
|
||||
String unit = item["unit"].to_string();
|
||||
f64 min_value = atof(first(item["min"].to_string(), "0").c_str());
|
||||
f64 max_value = atof(first(item["max"].to_string(), "100").c_str());
|
||||
f64 value = atof(first(item["value"].to_string(), "0").c_str());
|
||||
f64 pct = (value - min_value) / (max_value - min_value == 0 ? 1.0 : (max_value - min_value));
|
||||
pct = std::max(0.0, std::min(1.0, pct));
|
||||
f64 angle = -2.6 + pct * 2.2;
|
||||
?><section class="gauge-card needlegauge-card">
|
||||
<div class="gauge-metric-label needlegauge-label-head"><?= label ?></div>
|
||||
<div class="needlegauge-visual">
|
||||
<svg width="<?= std::to_string(size) ?>" height="<?= std::to_string(size / 1.8) ?>" viewBox="0 0 200 120" class="needlegauge-svg">
|
||||
<path d="M 20 100 A 80 80 0 0 1 180 100" fill="none" stroke='var(--border)' stroke-width="10" opacity="0.3"/>
|
||||
<line id="<?= gauge_id ?>-<?= item_id ?>-needle" class="needle" x1="100" y1="100" x2="40" y2="100" stroke='var(--primary)' stroke-width="4" stroke-linecap="round" style="transform-origin: 100px 100px; transform: rotate(<?= std::to_string(angle) ?>rad); transition: transform 0.3s ease;"/>
|
||||
<circle cx="100" cy="100" r="7" fill='var(--primary)'/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="needlegauge-info">
|
||||
<div class="gauge-metric-value needlegauge-value" id="<?= gauge_id ?>-<?= item_id ?>-value"><?= item["value"].to_string() + unit ?></div>
|
||||
<? if(tooltip != "") { ?><div class="gauge-metric-meta needlegauge-meta"><?= tooltip ?></div><? } ?>
|
||||
</div>
|
||||
</section><?
|
||||
}); ?>
|
||||
</div>
|
||||
</section>
|
||||
<? if(context.call["listen"].to_string() != "") { ?>
|
||||
<script>
|
||||
window.NeedlegaugeComponents = window.NeedlegaugeComponents || {
|
||||
start_listen : function(prop) {
|
||||
$.events.on('value-broadcast', function(data) {
|
||||
if(!prop.items || !prop.items[data.name]) return;
|
||||
let item = Object.assign({}, prop.scale || {}, prop.items[data.name]);
|
||||
let min = Number(item.min || 0);
|
||||
let max = Number(item.max || 100);
|
||||
let pct = (Number(data.value) - min) / ((max - min) || 1);
|
||||
pct = Math.min(1, Math.max(0, pct));
|
||||
let angle = -2.6 + pct * 2.2;
|
||||
let needle = document.getElementById(prop.id + '-' + data.name + '-needle');
|
||||
let valueEl = document.getElementById(prop.id + '-' + data.name + '-value');
|
||||
if (needle) needle.style.transform = 'rotate(' + angle + 'rad)';
|
||||
if (valueEl) valueEl.textContent = data.value + (item.unit || '');
|
||||
});
|
||||
}
|
||||
};
|
||||
NeedlegaugeComponents.start_listen(<?= json_encode(context.call) ?>);
|
||||
</script>
|
||||
<? } ?>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:ARCGAUGE(Request& context)
|
||||
{
|
||||
starter_register_js("components/gauges/common.js", context);
|
||||
starter_register_css("themes/common/css/gauges.css", context);
|
||||
String gauge_id = first(context.call["id"].to_string(), "arcgauge-" + std::to_string((u64)time()));
|
||||
String title = context.call["title"].to_string();
|
||||
String subtitle = context.call["subtitle"].to_string();
|
||||
String style = context.call["style"].to_string();
|
||||
|
||||
<>
|
||||
<div class="arcgauge-set" id="<?= gauge_id ?>" style="<?= style ?>">
|
||||
<? if(title != "") { ?><div class="arcgauge-set-header"><h3><?= title ?></h3><? if(subtitle != "") { ?><p><?= subtitle ?></p><? } ?></div><? } ?>
|
||||
<div class="arcgauge-grid">
|
||||
<? context.call["items"].each([&](DTree item, String item_id) {
|
||||
f64 value = atof(first(item["value"].to_string(), "0").c_str());
|
||||
f64 max_value = atof(first(item["max"].to_string(), "100").c_str());
|
||||
s32 precision = (s32)int_val(first(item["precision"].to_string(), "1"));
|
||||
f64 pct = max_value > 0.0 ? std::max(0.0, std::min(100.0, (value / max_value) * 100.0)) : 0.0;
|
||||
f64 arc_length = (pct / 100.0) * 157.08;
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), ("%." + std::to_string(precision) + "f").c_str(), value);
|
||||
?><section class="arcgauge-card">
|
||||
<div class="arcgauge-label"><?= first(item["label"].to_string(), item_id) ?></div>
|
||||
<svg class="arcgauge-svg" viewBox="0 0 120 68" aria-hidden="true">
|
||||
<path class="arcgauge-track" d="M 10 60 A 50 50 0 0 1 110 60" fill="none" stroke-width="5" stroke-linecap="round"/>
|
||||
<path id="<?= gauge_id ?>-<?= item_id ?>-arc" class="arcgauge-arc-dyn" d="M 10 60 A 50 50 0 0 1 110 60" fill="none" stroke='var(--success, #10b981)' stroke-width="5" stroke-linecap="round" stroke-dasharray="<?= std::to_string(arc_length) ?> 157.08"/>
|
||||
<text id="<?= gauge_id ?>-<?= item_id ?>-text" class="arcgauge-value" x="60" y="47" text-anchor="middle"><?= String(buf) + item["unit"].to_string() ?></text>
|
||||
<text class="arcgauge-caption" x="60" y="62" text-anchor="middle"><?= first(item["caption"].to_string(), "") ?></text>
|
||||
</svg>
|
||||
<div class="arcgauge-meta" id="<?= gauge_id ?>-<?= item_id ?>-meta"><?= first(item["meta"].to_string(), "--") ?></div>
|
||||
</section><?
|
||||
}); ?>
|
||||
</div>
|
||||
</div>
|
||||
<? if(context.call["listen"].to_string() != "") { ?>
|
||||
<script>
|
||||
window.ArcgaugeComponents = window.ArcgaugeComponents || {
|
||||
start_listen : function(prop) {
|
||||
$.events.on('value-broadcast', function(data) {
|
||||
if(!prop.items || !prop.items[data.name]) return;
|
||||
const item = Object.assign({}, prop.items[data.name]);
|
||||
if (typeof GaugeComponents !== 'undefined') {
|
||||
GaugeComponents.updateArcGauge({
|
||||
arcId: prop.id + '-' + data.name + '-arc',
|
||||
textId: prop.id + '-' + data.name + '-text',
|
||||
metaId: prop.id + '-' + data.name + '-meta',
|
||||
value: Number(data.value),
|
||||
max: Number(item.max || 100),
|
||||
suffix: item.unit || '',
|
||||
precision: item.precision,
|
||||
color: item.color,
|
||||
meta: data.meta != null ? data.meta : null
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
ArcgaugeComponents.start_listen(<?= json_encode(context.call) ?>);
|
||||
</script>
|
||||
<? } ?>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
DTree user = starter_current_user(context);
|
||||
bool signed_in = user["email"].to_string() != "";
|
||||
String wrapper_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-card" : "nav-account nav-menu";
|
||||
String links_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-links" : "";
|
||||
String name_class = starter_theme_value("key", context) == "localfirst" ? "admin-account-name" : "account-name";
|
||||
|
||||
<>
|
||||
<div class="<?= wrapper_class ?>">
|
||||
<? if(signed_in) { ?>
|
||||
<span class="<?= name_class ?>"><?= first(user["username"].to_string(), user["email"].to_string(), "Account") ?></span>
|
||||
<? if(links_class != "") { ?><div class="<?= links_class ?>"><? } ?>
|
||||
<a href="<?= starter_link("account/profile", context) ?>">Profile</a>
|
||||
<a href="<?= starter_link("account/logout", context) ?>">Logout</a>
|
||||
<? if(links_class != "") { ?></div><? } ?>
|
||||
<? } else { ?>
|
||||
<? if(links_class != "") { ?><div class="<?= links_class ?>"><? } ?>
|
||||
<a href="<?= starter_link("account/login", context) ?>">Login</a>
|
||||
<? if(starter_cfg("users/enable_signup", context).to_string() != "") { ?>
|
||||
<a href="<?= starter_link("account/register", context) ?>">Register</a>
|
||||
<? } ?>
|
||||
<? if(links_class != "") { ?></div><? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
if(context.var["starter"]["embed_mode"].to_string() != "")
|
||||
return;
|
||||
|
||||
String text = first(starter_theme_value("footer_text", context), starter_cfg_string("site/name", context));
|
||||
String inner_class = starter_theme_value("key", context) == "portal-light" ? "footer-inner" : "";
|
||||
|
||||
<>
|
||||
<footer>
|
||||
<? if(inner_class != "") { ?>
|
||||
<div class="<?= inner_class ?>"><p><?= text ?></p></div>
|
||||
<? } else { ?>
|
||||
<div style="max-width: 1200px; margin: 0 auto; padding: 0 1rem;"><p><?= text ?></p></div>
|
||||
<? } ?>
|
||||
</footer>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
|
||||
String page_type = first(context.var["starter"]["page_type"].to_string(), "html");
|
||||
if(context.flags.status >= 300 && context.flags.status < 400)
|
||||
return;
|
||||
|
||||
if(page_type == "blank")
|
||||
{
|
||||
print(context.call["main_html"].to_string());
|
||||
return;
|
||||
}
|
||||
|
||||
if(page_type == "json")
|
||||
{
|
||||
context.header["Content-Type"] = "application/json";
|
||||
context.header["Cache-Control"] = "no-cache, no-store, must-revalidate";
|
||||
if(context.var["starter"]["json"].get_type_name() == "array")
|
||||
{
|
||||
print(json_encode(context.var["starter"]["json"]));
|
||||
}
|
||||
else
|
||||
{
|
||||
print(context.call["main_html"].to_string());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
String theme_key = starter_theme_value("key", context);
|
||||
bool embed_mode = context.var["starter"]["embed_mode"].to_string() == "1";
|
||||
String body_class = embed_mode ? "embed-mode" : "";
|
||||
if(theme_key == "portal-dark")
|
||||
body_class = "portal-theme portal-dark-theme dark-theme" + String(embed_mode ? " embed-mode" : "");
|
||||
else if(theme_key == "portal-light")
|
||||
body_class = "portal-theme portal-light-theme" + String(embed_mode ? " embed-mode" : "");
|
||||
else if(theme_key == "localfirst")
|
||||
body_class = "admin-page localfirst-theme dark-theme" + String(embed_mode ? " embed-mode" : "");
|
||||
else if(theme_key == "retro-gaming")
|
||||
body_class = embed_mode ? "embed-mode" : "";
|
||||
|
||||
<>
|
||||
<!doctype html>
|
||||
<html class="<?= starter_html_class(context) ?>" lang="en" data-theme-key="<?= starter_theme_value("key", context) ?>">
|
||||
<head>
|
||||
<? render_component("page_shell:HEAD", context.call, context); ?>
|
||||
</head>
|
||||
<body<?: body_class != "" ? " class=\"" + html_escape(body_class) + "\"" : "" ?>>
|
||||
<? if(theme_key == "retro-gaming") { ?><div class="retro-stars"></div><? } ?>
|
||||
<? if(!embed_mode) { ?>
|
||||
<?: component("../example/theme-switcher", context) ?>
|
||||
<? if(theme_key != "localfirst") { ?>
|
||||
<?: component("../basic/cookie-consent", context) ?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
|
||||
<? if(theme_key == "localfirst") { ?>
|
||||
<div class="admin-shell">
|
||||
<nav class="admin-nav">
|
||||
<div class="admin-nav-header">
|
||||
<a class="admin-nav-title" href="<?= starter_link("", context) ?>">
|
||||
<img class="admin-nav-logo-img" src="<?= starter_asset_url("themes/localfirst/img/local_first_logo.png", context) ?>" alt="<?= starter_cfg_string("site/name", context) ?>" />
|
||||
</a>
|
||||
</div>
|
||||
<? starter_cfg("menu", context).each([&](DTree menu_item, String menu_key) {
|
||||
if(menu_item["hidden"].to_string() == "1")
|
||||
return;
|
||||
String current_path = context.var["starter"]["route"]["l_path"].to_string();
|
||||
bool active = menu_key != "" && (current_path == menu_key || current_path.rfind(menu_key + "/", 0) == 0);
|
||||
?><a class="admin-nav-item<?= active ? " active" : "" ?>" href="<?= starter_menu_href(menu_key, menu_item, context) ?>"><?= menu_item["title"].to_string() ?></a><?
|
||||
}); ?>
|
||||
</nav>
|
||||
<div class="admin-main">
|
||||
<? if(!embed_mode) { ?>
|
||||
<div class="admin-toolbar">
|
||||
<?: component("account_links", context) ?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<div id="content" class="admin-content">
|
||||
<?: context.call["main_html"].to_string() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<? } else { ?>
|
||||
<?: component("standard_nav", context) ?>
|
||||
<div id="content"<?: embed_mode ? " class=\"embed-content\"" : "" ?>>
|
||||
<?: context.call["main_html"].to_string() ?>
|
||||
</div>
|
||||
<?: component("footer", context) ?>
|
||||
<? } ?>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:HEAD(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
String title = first(context.var["starter"]["page_title"].to_string(), starter_cfg_string("site/default_page_title", context));
|
||||
String description = first(starter_theme_value("meta_description", context), "UCE starter example");
|
||||
String theme_color = first(starter_theme_value("theme_color", context), "#0f172a");
|
||||
String icon = starter_asset_url(starter_theme_value("path", context) + "icon.png", context);
|
||||
|
||||
<>
|
||||
<meta charset="utf-8">
|
||||
<title><?= title + " | " + starter_cfg_string("site/name", context) ?></title>
|
||||
<meta name="description" content="<?= description ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="<?= theme_color ?>">
|
||||
<link rel="apple-touch-icon" href="<?= icon ?>" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="<?= icon ?>" />
|
||||
<? starter_render_registered_css(context); ?>
|
||||
<? starter_render_registered_js(context); ?>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
starter_boot(context);
|
||||
|
||||
<>
|
||||
<nav<?: starter_theme_value("key", context) == "portal-dark" || starter_theme_value("key", context) == "dark" || starter_theme_value("key", context) == "retro-gaming" ? " class=\"nav-shell\"" : "" ?>>
|
||||
<div class="nav-menu">
|
||||
<a href="<?= starter_link("", context) ?>"><?= starter_cfg_string("site/name", context) ?></a>
|
||||
<? starter_cfg("menu", context).each([&](DTree menu_item, String menu_key) {
|
||||
if(menu_item["hidden"].to_string() == "1")
|
||||
return;
|
||||
?><a href="<?= starter_menu_href(menu_key, menu_item, context) ?>"><?= menu_item["title"].to_string() ?></a><?
|
||||
}); ?>
|
||||
</div>
|
||||
<?: component("account_links", context) ?>
|
||||
</nav>
|
||||
</>
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
#load "../../lib/app.uce"
|
||||
|
||||
RENDER:APP_FRAME(Request& context)
|
||||
{
|
||||
starter_register_css("themes/common/css/workspace.css", context);
|
||||
starter_register_js("js/u-workspace-shell.js", context);
|
||||
String id = context.call["id"].to_string();
|
||||
String overlay_id = context.call["overlay_id"].to_string();
|
||||
String class_name = context.call["class"].to_string();
|
||||
<>
|
||||
<div<?: id != "" ? " id=\"" + html_escape(id) + "\"" : "" ?> class="ws-app<?= class_name != "" ? " " + html_escape(class_name) : "" ?>">
|
||||
<?: context.call["sidebar_html"].to_string() ?>
|
||||
<div<?: overlay_id != "" ? " id=\"" + html_escape(overlay_id) + "\"" : "" ?> class="ws-sidebar-overlay"></div>
|
||||
<main class="ws-main"><?: context.call["main_html"].to_string() ?></main>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:EMPTY_STATE(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-empty-state<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<div class="ws-empty-icon"><i class="<?= first(context.call["icon_class"].to_string(), "fas fa-layer-group") ?>"></i></div>
|
||||
<h2><?= context.call["title"].to_string() ?></h2>
|
||||
<p><?= context.call["text"].to_string() ?></p>
|
||||
<?: context.call["action_html"].to_string() ?>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:LIST_STATE(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-list-state<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>"><? if(context.call["icon_class"].to_string() != "") { ?><i class="<?= context.call["icon_class"].to_string() ?>"></i><? } ?><span><?= context.call["text"].to_string() ?></span></div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:MOBILE_BAR(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-mobile-bar<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<button<?: context.call["button_id"].to_string() != "" ? " id=\"" + html_escape(context.call["button_id"].to_string()) + "\"" : "" ?> class="ws-mobile-toggle" title="Toggle sidebar" type="button">
|
||||
<i class="<?= first(context.call["icon_class"].to_string(), "fas fa-bars") ?>"></i>
|
||||
</button>
|
||||
<span class="ws-mobile-title"><?= context.call["title"].to_string() ?></span>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:PANEL_HEADER(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-panel-header<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<div class="ws-panel-title-group">
|
||||
<h2><?= context.call["title"].to_string() ?></h2>
|
||||
<? if(context.call["subtitle"].to_string() != "") { ?><p class="ws-subtitle"><?= context.call["subtitle"].to_string() ?></p><? } ?>
|
||||
</div>
|
||||
<? if(context.call["actions_html"].to_string() != "") { ?><div class="ws-header-actions"><?: context.call["actions_html"].to_string() ?></div><? } ?>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:PANEL(Request& context)
|
||||
{
|
||||
<>
|
||||
<section<?: context.call["id"].to_string() != "" ? " id=\"" + html_escape(context.call["id"].to_string()) + "\"" : "" ?> class="ws-panel<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<?: context.call["header_html"].to_string() ?>
|
||||
<?: context.call["body_html"].to_string() ?>
|
||||
</section>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:SECTION_HEAD(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-section-head<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<h3><?= context.call["title"].to_string() ?></h3>
|
||||
<? if(context.call["actions_html"].to_string() != "") { ?><div class="ws-header-actions"><?: context.call["actions_html"].to_string() ?></div><? } ?>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:SECTION(Request& context)
|
||||
{
|
||||
<>
|
||||
<section<?: context.call["id"].to_string() != "" ? " id=\"" + html_escape(context.call["id"].to_string()) + "\"" : "" ?> class="ws-section<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<?: context.call["header_html"].to_string() ?>
|
||||
<?: context.call["body_html"].to_string() ?>
|
||||
</section>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:SIDEBAR_SHELL(Request& context)
|
||||
{
|
||||
<>
|
||||
<aside<?: context.call["id"].to_string() != "" ? " id=\"" + html_escape(context.call["id"].to_string()) + "\"" : "" ?> class="ws-sidebar<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<?: context.call["top_html"].to_string() ?>
|
||||
<?: context.call["body_html"].to_string() ?>
|
||||
</aside>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:SIDEBAR_TOOLBAR(Request& context)
|
||||
{
|
||||
<>
|
||||
<div class="ws-sidebar-top<?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>">
|
||||
<?: context.call["action_html"].to_string() ?>
|
||||
<div class="ws-search-wrap">
|
||||
<i class="fas fa-search ws-search-icon"></i>
|
||||
<input type="search"<?: context.call["search_input_id"].to_string() != "" ? " id=\"" + html_escape(context.call["search_input_id"].to_string()) + "\"" : "" ?> name="<?= first(context.call["search_input_name"].to_string(), "search") ?>" class="ws-search-input" placeholder="<?= first(context.call["search_placeholder"].to_string(), "Search...") ?>" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:STATUS_PILL(Request& context)
|
||||
{
|
||||
String variant = to_lower(first(context.call["variant"].to_string(), "neutral"));
|
||||
<>
|
||||
<span class="ws-status-pill ws-status-pill-<?= variant ?><?= context.call["class"].to_string() != "" ? " " + html_escape(context.call["class"].to_string()) : "" ?>"><?= first(context.call["label"].to_string(), context.call["text"].to_string()) ?></span>
|
||||
</>
|
||||
}
|
||||
Reference in New Issue
Block a user