Integrate swipe and d-pad to transit entry_view #2

Merged
joshlaymon merged 10 commits from develop into main 2025-09-07 17:58:35 +00:00
Showing only changes of commit 8468cee088 - Show all commits

View File

@ -57,6 +57,15 @@
<span class="slider"></span>
</label>
</div>
<!-- Swipe navigation (client-side pref) -->
<div class="cc-row" style="margin-top:10px;">
<label class="cc-label">Swipe to navigate entries (mobile)</label>
<label class="switch">
<input id="swipeNavToggle" type="checkbox">
<span class="slider"></span>
</label>
</div>
</div>
</section>
@ -159,7 +168,7 @@
</div>
</div>
<!-- Toast -->
<!-- Toast for Clear History -->
<div id="toast-clear-history"
style="position:fixed; right:16px; bottom:16px; padding:10px 14px; border-radius:10px;
background:#111827; color:#fff; box-shadow:0 6px 20px rgba(0,0,0,.25);
@ -200,21 +209,6 @@
.swatch[data-theme="midnight"]{background:linear-gradient(135deg,#0b1220,#1c2741);}
.swatch[data-theme="forest"]{background:linear-gradient(135deg,#d7f3e2,#92c7a3);}
.swatch[data-theme="sandstone"]{background:linear-gradient(135deg,#f7efe4,#e4d2b6);}
/* Windows 95 swatch */
/* Windows 95 swatch */
.swatch[data-theme="win95"] {
background: linear-gradient(to bottom, #000080 0 30%, #c0c0c0 30% 100%);
border: 2px solid #808080;
border-top-color: #fff; /* top highlight */
border-left-color: #fff; /* left highlight */
border-right-color: #404040;
border-bottom-color: #404040;
border-radius: 0; /* blocky, no rounded corners */
box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #000;
font-family: "MS Sans Serif", sans-serif;
position: relative;
overflow: hidden;
}
.swatch-name{background:rgba(255,255,255,.8);padding:2px 6px;border-radius:8px;font-size:12px;color:#0f172a;}
/* Security accent */
.cc-sec{position:relative;overflow:hidden;color:#0f172a;}
@ -235,19 +229,18 @@
<script>
(function(){
// Helpers
// Helpers already present in your file (unchanged)
function getCookie(name){ const m=document.cookie.match("(^|;)\\s*"+name+"\\s*=\\s*([^;]+)"); return m?m.pop():""; }
function setTheme(name){
var v='{{ APP_VERSION }}';
var link=document.getElementById('theme-css');
if(link) link.href='{% static "themes/" %}'+name+'.css?v='+v; // << cache-busted preview
if(link) link.href='{% static "themes/" %}'+name+'.css';
document.documentElement.setAttribute('data-theme',name);
try{ localStorage.setItem('theme',name); }catch(e){}
if(name==='classic'){ document.body.classList.add('themed-bg'); } else { document.body.classList.remove('themed-bg'); }
var hidden=document.getElementById('theme-hidden'); if(hidden) hidden.value=name;
}
// Clear history
// Clear history (unchanged)
(function(){
var btn=document.getElementById("clear-history-btn");
var toast=document.getElementById("toast-clear-history");
@ -263,13 +256,10 @@
});
})();
// Save from tiles
window.saveTheme = function(){
// Hidden input already holds current pick; just submit
return true;
};
// Save from tiles (unchanged)
window.saveTheme = function(){ return true; };
// Swatch instant preview + set hidden value
// Swatch instant preview (unchanged)
document.querySelectorAll('.swatch').forEach(btn=>{
btn.addEventListener('click',()=>{
const name=btn.getAttribute('data-theme');
@ -277,7 +267,7 @@
});
});
// Highlight toggle
// Highlight toggle (server-backed, unchanged)
(async function(){
const toggle=document.getElementById("highlightHitsToggle");
if(!toggle) return;
@ -295,4 +285,7 @@
})();
})();
</script>
<!-- NEW: client-side swipe preference wiring -->
<script src="{% static 'js/settings-swipe.js' %}"></script>
{% endblock %}