added default popup and minor fixes

This commit is contained in:
Leon van Kammen 2026-09-02 22:45:59 +02:00
parent c1174af3fe
commit cbe5c021d7
6 changed files with 80 additions and 22 deletions

View file

@ -32,7 +32,7 @@ body{
@media (max-width: 470px){
.menu a:nth-child(2){
display: text-decoration:none;
display: none;
border:none;none;
}
}

View file

@ -26,9 +26,7 @@
<a href="https://codeberg.org/coderofsalvation/xrforge-v2">Sourcecode</a> <br>
{if footerlinks then
for i,v in pairs(footerlinks) do
print([[
<a href="]] .. v.url .. [[">]] .. v.title .. [[</a><br>
]])
print('<a href="' .. v.url .. '" ' .. ' onclick="' .. (v.onclick or '') .. '">' .. v.title .. '</a><br>')
end
end}
</td>

View file

@ -6,20 +6,22 @@ ${header}
<iframe border="0" frameborder="0" src="janusweb/index.html#janus.url=${janusurl}&janus.referrer=${referrer}" id="viewer"></iframe>
{if defined(item) and item.parent and item.parent.info then
print([[
<div id="popup" class="content">
<div class="spectrum span" style="top:-1px">
<div></div>
</div>
<noscript>
<img src="${item.parent.thumbnail}" width="100%"/>
</noscript>
<img src="img/close.svg" width="20" class="icon close" onclick="document.querySelector('#popup').style.display = 'none'"/>
]] .. item.parent.info .. [[
</div>
]])
description = item.parent.info
else
description = opts.plugin_global_popup_instructions
end}
<div id="popup" class="content">
<div class="spectrum span" style="top:-1px">
<div></div>
</div>
<noscript>
<img src="${item.parent.thumbnail}" width="100%"/>
</noscript>
<img src="img/close.svg" width="20" class="icon close" onclick="document.querySelector('#popup').style.display = 'none'"/>
${description}
</div>
<script>
// Title- and URL-sync between parent/iframe to foster addressibility
const iframe = document.querySelector("#viewer")

View file

@ -59,7 +59,7 @@ local plugin = {
key='app.opts.plugin_archive_scraper',
title='XR Scraper',
info='archive external links in experiences as local copies',
default = os.getenv('DEBUG') and 'enabled' or "disabled",
default = "disabled",
values={disabled="disabled",enabled="enabled"}
},
{

View file

@ -32,11 +32,12 @@ app.on('util.template', function(data)
data.footerlinks = data.footerlinks or {}
table.insert(data.footerlinks, {
title="<img class='icon download' src='/img/download.svg'>&nbsp;Download data",
url="/" .. app.bin:gsub(".com",".zip")
url="/" .. app.bin:gsub("-.*_.*%.","."):gsub(".com",".zip")
})
table.insert(data.footerlinks, {
title="<img class='icon download' src='/img/download.svg'>&nbsp;Download data+platform",
url="/" .. app.bin
url="/" .. app.bin:gsub("-.*_.*%.","."),
onclick="alert('This will download the platform executable, which runs on WINDOWS/MAC/LINUX.\\n\\nFor MAC/LINUX users it should be made executable first\\n\\nHappy credible exit! \\o/\\n')"
})
end
end
@ -92,6 +93,61 @@ local plugin = {
default = "2D",
values={ ['3D'] = '3D', ['2D'] = '2D' },
},
{
key='app.opts.plugin_global_popup_instructions',
title='Viewer instructions',
info='Default popup for 3D viewer instructions',
default = [[
<h1>Tips to navigate in XR</h1>
<table>
<tr>
<td width="200">
<b>AR/VR headset</b>
</td>
<td>
walk around / use right-longpinch (or thumbstick) for local teleports<br/>
</td>
</tr>
<tr>
<td>
<b>PhoneVR</b>
</td>
<td>
use gaze or bluetooth/mouse to navigate
</td>
</tr>
<tr>
<td>
<b>PhoneAR</b>
</td>
<td>
walk around and tap screen to click
</td>
</tr>
<tr>
<td>
<b>Mobile</b>
</td>
<td>
use the WASD-keys and mousedrag to navigate
</td>
</tr>
<tr>
<td>
<b>Keyboard+Mouse</b>
</td>
<td>
use the WASD-keys and mousedrag to navigate
</td>
</tr>
</table>
<br/>
You've got this!
<br/>
]],
control='textarea',
values=''
},
{
key='app.opts.plugin_global_credible_exit',
title='Credible exit',

View file

@ -23,7 +23,8 @@ download(){
chmod +x /tmp/assimilate
}
rm $OUTDIR/*.bak || true
/tmp/assimilate $OUTDIR/xrforge.com
cp $OUTDIR/xrforge.com $OUTDIR/xrforge-$ARCH.com
/tmp/assimilate $OUTDIR/xrforge-$ARCH.com
}
chmod +x $OUTDIR/*.com
#verify
@ -46,8 +47,9 @@ build(){
download redbean
download janusweb
cd src
zip -yr ../result/bin/xrforge.com * .lua .init.lua .args
test -n "$ARCH" && cp ../result/bin/xrforge.com ../result/bin/xrforge-$ARCH.com
bundle(){ zip -yr $1 * .lua .init.lua .args; }
bundle ../result/bin/xrforge.com
test -n "$ARCH" && bundle ../result/bin/xrforge-$ARCH.com
}
rebuild(){