first commit
This commit is contained in:
commit
dd6a740645
37 files changed
+5424
No files matched your search
+161
@@ -0,0 +1,161 @@
|
||||
:root {
|
||||
--bg: #f6f5f2;
|
||||
--surface: #ffffff;
|
||||
--text: #1d1d1f;
|
||||
--muted: #6b6b70;
|
||||
--border: #e3e1dc;
|
||||
--accent: #2f6f5e;
|
||||
--accent-text: #ffffff;
|
||||
--danger: #b3402f;
|
||||
--running: #e8f3ef;
|
||||
--warn: #b7791f;
|
||||
--radius: 10px;
|
||||
color-scheme: light dark;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #151517;
|
||||
--surface: #1f1f22;
|
||||
--text: #ececef;
|
||||
--muted: #9a9aa2;
|
||||
--border: #2f2f34;
|
||||
--accent: #5fb39a;
|
||||
--accent-text: #0d1f1a;
|
||||
--danger: #e0705e;
|
||||
--running: #1d2e29;
|
||||
--warn: #e0a84a;
|
||||
}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
}
|
||||
a { color: var(--accent); }
|
||||
h1, h2 { margin: 0 0 .75rem; font-weight: 600; }
|
||||
h2 { font-size: 1.1rem; }
|
||||
|
||||
.topbar {
|
||||
display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
|
||||
padding: .75rem max(16px, calc((100vw - 960px) / 2));
|
||||
background: var(--surface); border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
|
||||
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
|
||||
.topbar nav a {
|
||||
padding: .35rem .75rem; border-radius: 999px; color: var(--muted); text-decoration: none;
|
||||
}
|
||||
.topbar nav a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; }
|
||||
|
||||
main { max-width: 960px; margin: 1.5rem auto; padding: 0 16px; display: grid; gap: 1rem; }
|
||||
|
||||
.card {
|
||||
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
|
||||
padding: 1.25rem; min-width: 0;
|
||||
}
|
||||
.card.archived { opacity: .65; }
|
||||
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
|
||||
.card-head h2 { margin: 0; }
|
||||
.total { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.1rem; }
|
||||
|
||||
.row { display: flex; gap: .5rem; align-items: center; }
|
||||
.row.wrap { flex-wrap: wrap; }
|
||||
.grow { flex: 1; min-width: 0; }
|
||||
.row.grow input { flex: 1; min-width: 0; }
|
||||
.stack { display: grid; gap: .35rem; }
|
||||
.muted, .empty { color: var(--muted); }
|
||||
.empty { margin: .25rem 0; }
|
||||
.nowrap { white-space: nowrap; }
|
||||
|
||||
input, select, button { font: inherit; color: inherit; }
|
||||
input, select {
|
||||
background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
|
||||
padding: .45rem .6rem; min-width: 0; max-width: 100%;
|
||||
}
|
||||
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
|
||||
.title-input { font-weight: 600; font-size: 1.05rem; }
|
||||
label { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
|
||||
|
||||
.btn {
|
||||
border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
|
||||
padding: .45rem .9rem; cursor: pointer; white-space: nowrap;
|
||||
}
|
||||
.btn:hover { border-color: var(--muted); }
|
||||
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
|
||||
.btn.danger { color: var(--danger); }
|
||||
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
|
||||
.htmx-request .btn, .btn.htmx-request { opacity: .6; }
|
||||
|
||||
.badge { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); color: var(--muted); }
|
||||
|
||||
/* Timer */
|
||||
.timer.is-running { background: var(--running); border-color: var(--color, var(--accent)); border-left-width: 6px; }
|
||||
.current { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
|
||||
.current-project { font-size: 1.3rem; font-weight: 600; }
|
||||
.clock { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
|
||||
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: .5rem; }
|
||||
.note { color: var(--muted); font-size: .9rem; }
|
||||
|
||||
/* Tables */
|
||||
.table-wrap { overflow-x: auto; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; }
|
||||
th, td { padding: .5rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
|
||||
tr:last-child td { border-bottom: 0; }
|
||||
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
.time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
|
||||
.client { color: var(--muted); }
|
||||
tr.running { background: var(--running); }
|
||||
tr.editing td { background: var(--bg); }
|
||||
tr.editing input, tr.editing select { width: 100%; }
|
||||
td.actions { text-align: right; white-space: nowrap; }
|
||||
.warn { color: var(--warn); cursor: help; }
|
||||
|
||||
/* Colors */
|
||||
.dot {
|
||||
display: inline-block; width: .65rem; height: .65rem; border-radius: 50%;
|
||||
background: var(--color); margin-right: .4rem; vertical-align: baseline; flex: none;
|
||||
}
|
||||
.client-card { border-left: 6px solid var(--color); }
|
||||
input[type="color"] {
|
||||
width: 2.2rem; height: 2.2rem; padding: .15rem; flex: none; cursor: pointer;
|
||||
}
|
||||
.projects input[type="color"] { width: 1.8rem; height: 1.8rem; }
|
||||
|
||||
/* Projects list */
|
||||
.projects { list-style: none; margin: 0 0 1rem; padding: 0; }
|
||||
.projects li {
|
||||
display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap;
|
||||
padding: .4rem 0; border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.projects li.archived { opacity: .6; }
|
||||
|
||||
/* Periods & reports */
|
||||
.presets { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .75rem; }
|
||||
.presets a {
|
||||
padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border);
|
||||
color: var(--muted); text-decoration: none; font-size: .9rem;
|
||||
}
|
||||
.presets a[aria-current="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
|
||||
.filters { margin-bottom: 1rem; }
|
||||
.report .label { width: 35%; }
|
||||
.bar-cell { width: 50%; vertical-align: middle; }
|
||||
.bar { height: .7rem; border-radius: 4px; background: var(--color, var(--accent)); min-width: 2px; }
|
||||
.report tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
|
||||
|
||||
#toast {
|
||||
position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
|
||||
background: var(--danger); color: #fff; padding: .6rem 1rem; border-radius: 8px;
|
||||
max-width: calc(100vw - 32px); box-shadow: 0 4px 16px rgb(0 0 0 / .2);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.current { grid-template-columns: 1fr auto; }
|
||||
.current .btn { grid-column: 1 / -1; }
|
||||
.start { grid-template-columns: 1fr; }
|
||||
.report .label { width: auto; }
|
||||
.bar-cell { width: 30%; }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Live clock for the running timer.
|
||||
function tick() {
|
||||
for (const el of document.querySelectorAll(".clock[data-started]")) {
|
||||
const secs = Math.max(0, Math.floor((Date.now() - Date.parse(el.dataset.started)) / 1000));
|
||||
const h = Math.floor(secs / 3600);
|
||||
const m = String(Math.floor((secs % 3600) / 60)).padStart(2, "0");
|
||||
const s = String(secs % 60).padStart(2, "0");
|
||||
el.textContent = `${h}:${m}:${s}`;
|
||||
}
|
||||
}
|
||||
tick();
|
||||
setInterval(tick, 1000);
|
||||
|
||||
// Show server errors from htmx requests in a toast.
|
||||
let toastTimer;
|
||||
function toast(message) {
|
||||
const el = document.getElementById("toast");
|
||||
el.textContent = message;
|
||||
el.hidden = false;
|
||||
clearTimeout(toastTimer);
|
||||
toastTimer = setTimeout(() => (el.hidden = true), 5000);
|
||||
}
|
||||
document.body.addEventListener("htmx:responseError", (event) => {
|
||||
const html = new DOMParser().parseFromString(event.detail.xhr.responseText, "text/html");
|
||||
toast(html.getElementById("error-message")?.textContent || "Une erreur est survenue");
|
||||
});
|
||||
document.body.addEventListener("htmx:sendError", () => toast("Serveur injoignable"));
|
||||
|
||||
// Confirmation for plain (non-htmx) destructive forms.
|
||||
document.addEventListener("submit", (event) => {
|
||||
const message = event.target.dataset.confirm;
|
||||
if (message && !confirm(message)) event.preventDefault();
|
||||
});
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
var htmx=function(){"use strict";const Q={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=cn(e,t||"post");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,allowScriptTags:true,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:"204",swap:false},{code:"[23]..",swap:true},{code:"[45]..",swap:false,error:true}],allowNestedOobSwaps:true},parseInterval:null,_:null,version:"2.0.4"};Q.onLoad=j;Q.process=kt;Q.on=ye;Q.off=be;Q.trigger=he;Q.ajax=Rn;Q.find=u;Q.findAll=x;Q.closest=g;Q.remove=z;Q.addClass=K;Q.removeClass=G;Q.toggleClass=W;Q.takeClass=Z;Q.swap=$e;Q.defineExtension=Fn;Q.removeExtension=Bn;Q.logAll=V;Q.logNone=_;Q.parseInterval=d;Q._=e;const n={addTriggerHandler:St,bodyContains:le,canAccessLocalStorage:B,findThisElement:Se,filterValues:hn,swap:$e,hasAttribute:s,getAttributeValue:te,getClosestAttributeValue:re,getClosestMatch:o,getExpressionVars:En,getHeaders:fn,getInputValues:cn,getInternalData:ie,getSwapSpecification:gn,getTriggerSpecs:st,getTarget:Ee,makeFragment:P,mergeObjects:ce,makeSettleInfo:xn,oobSwap:He,querySelectorExt:ae,settleImmediately:Kt,shouldCancel:ht,triggerEvent:he,triggerErrorEvent:fe,withExtensions:Ft};const r=["get","post","put","delete","patch"];const H=r.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)=="ms"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)=="s"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)=="m"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function te(e,t){return ee(e,t)||ee(e,"data-"+t)}function c(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function ne(){return document}function m(e,t){return e.getRootNode?e.getRootNode({composed:t}):ne()}function o(e,t){while(e&&!t(e)){e=c(e)}return e||null}function i(e,t,n){const r=te(t,n);const o=te(t,"hx-disinherit");var i=te(t,"hx-inherit");if(e!==t){if(Q.config.disableInheritance){if(i&&(i==="*"||i.split(" ").indexOf(n)>=0)){return r}else{return null}}if(o&&(o==="*"||o.split(" ").indexOf(n)>=0)){return"unset"}}return r}function re(t,n){let r=null;o(t,function(e){return!!(r=i(t,ue(e),n))});if(r!=="unset"){return r}}function h(e,t){const n=e instanceof Element&&(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector);return!!n&&n.call(e,t)}function T(e){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return""}}function q(e){const t=new DOMParser;return t.parseFromString(e,"text/html")}function L(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function A(e){const t=ne().createElement("script");se(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}return t}function N(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function I(e){Array.from(e.querySelectorAll("script")).forEach(e=>{if(N(e)){const t=A(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){O(e)}finally{e.remove()}}})}function P(e){const t=e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i,"");const n=T(t);let r;if(n==="html"){r=new DocumentFragment;const i=q(e);L(r,i.body);r.title=i.title}else if(n==="body"){r=new DocumentFragment;const i=q(t);L(r,i.body);r.title=i.title}else{const i=q('<body><template class="internal-htmx-wrapper">'+t+"</template></body>");r=i.querySelector("template").content;r.title=i.title;var o=r.querySelector("title");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){if(Q.config.allowScriptTags){I(r)}else{r.querySelectorAll("script").forEach(e=>e.remove())}}return r}function oe(e){if(e){e()}}function t(e,t){return Object.prototype.toStrinLine truncated
|
||||
Reference in new issue
Block a user