Prima implementazione pagina "Attività"

This commit is contained in:
2026-06-08 09:25:29 +02:00
parent 4661922633
commit b7955f0e1f
34 changed files with 1582 additions and 266 deletions
+78 -5
View File
@@ -7,7 +7,6 @@
}
a, .btn-link {
/*color: #006bb7;*/
text-decoration: none;
color: inherit;
}
@@ -23,7 +22,8 @@ a, .btn-link {
}
.content {
padding-top: 1.1rem;
padding-top: 1.5rem;
padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}
h1:focus {
@@ -76,9 +76,11 @@ h1:focus {
}
.page-title {
/*text-align: center;*/
font-size: x-large;
font-size: 1.4rem;
font-weight: 700;
color: var(--darker-color);
margin: 0;
line-height: 1.2;
}
@supports (-webkit-touch-callout: none) {
@@ -92,7 +94,6 @@ h1:focus {
z-index: 1;
}
#app {
padding-top: env(safe-area-inset-top);
height: 100vh;
@@ -102,3 +103,75 @@ h1:focus {
padding-left: env(safe-area-inset-left);
}
}
/* ─── Bottom sheet — custom MudDialog (ChiusuraModal, AllegatiModal) ─── */
.mud-dialog.bottom-sheet {
position: fixed;
left: 0;
right: 0;
bottom: 0;
margin: 0 auto;
width: 100%;
max-width: 600px;
max-height: 92vh;
border-radius: 24px 24px 0 0;
display: flex;
flex-direction: column;
overflow: hidden;
padding-bottom: env(safe-area-inset-bottom, 0px);
box-shadow: 0 -8px 40px rgba(31, 30, 90, 0.22);
animation: bottom-sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mud-dialog.bottom-sheet .mud-dialog-title {
padding: 0;
margin: 0;
flex-shrink: 0;
}
.mud-dialog.bottom-sheet .mud-dialog-content {
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
min-height: 0;
flex: 1;
}
@keyframes bottom-sheet-up {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.sheet-grabber {
width: 40px;
height: 4px;
border-radius: 100px;
background: #d8d8e4;
margin: 0.6rem auto 0.1rem;
}
.sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.6rem 1.2rem 0.7rem;
border-bottom: 1px solid #f0f0f0;
}
.sheet-title {
display: flex;
align-items: center;
gap: 0.45rem;
font-size: 0.98rem;
font-weight: 700;
color: var(--darker-color);
}
.sheet-close {
background: #f0f0f5 !important;
color: #666 !important;
}
+78
View File
@@ -0,0 +1,78 @@
window.signaturePad = {
instances: {},
init(canvasId, dotNetRef) {
const canvas = document.getElementById(canvasId);
if (!canvas) return;
const ctx = canvas.getContext('2d');
ctx.strokeStyle = '#1a1a2e';
ctx.lineWidth = 2;
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
let drawing = false;
function getPos(e) {
const rect = canvas.getBoundingClientRect();
const src = e.touches ? e.touches[0] : e;
return {
x: (src.clientX - rect.left) * (canvas.width / rect.width),
y: (src.clientY - rect.top) * (canvas.height / rect.height)
};
}
function start(e) {
e.preventDefault();
drawing = true;
const pos = getPos(e);
ctx.beginPath();
ctx.moveTo(pos.x, pos.y);
}
function move(e) {
if (!drawing) return;
e.preventDefault();
const pos = getPos(e);
ctx.lineTo(pos.x, pos.y);
ctx.stroke();
}
function end(e) {
if (!drawing) return;
drawing = false;
ctx.closePath();
if (dotNetRef) {
dotNetRef.invokeMethodAsync('OnSignatureChanged', canvas.toDataURL('image/png'));
}
}
canvas.addEventListener('mousedown', start);
canvas.addEventListener('mousemove', move);
canvas.addEventListener('mouseup', end);
canvas.addEventListener('mouseleave', end);
canvas.addEventListener('touchstart', start, { passive: false });
canvas.addEventListener('touchmove', move, { passive: false });
canvas.addEventListener('touchend', end);
this.instances[canvasId] = { canvas, ctx };
},
clear(canvasId) {
const instance = this.instances[canvasId];
if (!instance) return;
instance.ctx.clearRect(0, 0, instance.canvas.width, instance.canvas.height);
},
getDataUrl(canvasId) {
const instance = this.instances[canvasId];
return instance ? instance.canvas.toDataURL('image/png') : null;
},
isEmpty(canvasId) {
const instance = this.instances[canvasId];
if (!instance) return true;
const data = instance.ctx.getImageData(0, 0, instance.canvas.width, instance.canvas.height).data;
return !data.some(v => v !== 0);
}
};