Tidy CRUD task and priority layout
This commit is contained in:
parent
35626f8087
commit
9d7c652c81
36
wrapper.js
36
wrapper.js
@ -2,10 +2,40 @@ import http from 'node:http';
|
|||||||
|
|
||||||
const originalEnd = http.ServerResponse.prototype.end;
|
const originalEnd = http.ServerResponse.prototype.end;
|
||||||
|
|
||||||
|
const layoutPatch = `<style id="layout-v3">
|
||||||
|
.card{padding:20px}
|
||||||
|
.add{grid-template-columns:minmax(0,1fr) 132px 92px;align-items:stretch;gap:10px}
|
||||||
|
.add input,.add select,.add button{height:46px}
|
||||||
|
.task{grid-template-columns:40px minmax(0,1fr) 82px;gap:10px 12px;align-items:start;padding:16px 0}
|
||||||
|
.task>form:first-child{margin-top:2px}
|
||||||
|
.task>form:first-child button{width:40px;height:40px;padding:0}
|
||||||
|
.inline-edit{grid-template-columns:minmax(0,1fr) 126px 72px;gap:8px;align-items:center}
|
||||||
|
.inline-edit input,.inline-edit select,.inline-edit button{height:44px}
|
||||||
|
.actions{align-self:start;justify-content:flex-end}
|
||||||
|
.actions button{height:44px;min-width:76px}
|
||||||
|
.priority{margin-top:8px}
|
||||||
|
@media(max-width:700px){
|
||||||
|
.wrap{padding:24px 14px}
|
||||||
|
.card{padding:14px}
|
||||||
|
.add{grid-template-columns:minmax(0,1fr) 120px}
|
||||||
|
.add button{grid-column:1/-1}
|
||||||
|
.task{grid-template-columns:40px minmax(0,1fr)}
|
||||||
|
.actions{grid-column:2;justify-content:flex-start}
|
||||||
|
.inline-edit{grid-template-columns:minmax(0,1fr) 110px}
|
||||||
|
.inline-edit button{grid-column:1/-1;width:max-content}
|
||||||
|
}
|
||||||
|
@media(max-width:480px){
|
||||||
|
.add{grid-template-columns:1fr}
|
||||||
|
.add select,.add button{grid-column:auto}
|
||||||
|
.inline-edit{grid-template-columns:1fr}
|
||||||
|
.inline-edit button{grid-column:auto;width:100%}
|
||||||
|
.actions{grid-column:1/-1;margin-left:52px}
|
||||||
|
}
|
||||||
|
</style>`;
|
||||||
|
|
||||||
http.ServerResponse.prototype.end = function (chunk, encoding, callback) {
|
http.ServerResponse.prototype.end = function (chunk, encoding, callback) {
|
||||||
if (typeof chunk === 'string' && chunk.includes('</body>')) {
|
if (typeof chunk === 'string' && chunk.includes('</head>')) {
|
||||||
const badge = '<div style="position:fixed;right:16px;bottom:16px;background:#1f6feb;color:#fff;padding:8px 12px;border-radius:999px;font:600 12px system-ui;box-shadow:0 8px 24px #0006">v2 · live update</div>';
|
chunk = chunk.replace('</head>', `${layoutPatch}</head>`);
|
||||||
chunk = chunk.replace('</body>', `${badge}</body>`);
|
|
||||||
}
|
}
|
||||||
return originalEnd.call(this, chunk, encoding, callback);
|
return originalEnd.call(this, chunk, encoding, callback);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user