updated "cooked today" feature
This commit is contained in:
@@ -1273,7 +1273,9 @@ data:
|
|||||||
.mw-name { padding:10px 12px 4px; font-weight:700; opacity:.95; line-height:1.3; overflow-wrap:break-word; word-break:break-word; }
|
.mw-name { padding:10px 12px 4px; font-weight:700; opacity:.95; line-height:1.3; overflow-wrap:break-word; word-break:break-word; }
|
||||||
.mw-stats { padding:0 12px 6px; font-size:11px; opacity:.5; }
|
.mw-stats { padding:0 12px 6px; font-size:11px; opacity:.5; }
|
||||||
.mw-acts { padding:0 12px 10px; display:flex; gap:10px; opacity:.8; font-size:12px; }
|
.mw-acts { padding:0 12px 10px; display:flex; gap:10px; opacity:.8; font-size:12px; }
|
||||||
.mw-acts a, .mw-link { text-decoration:none; color:inherit; display:block; }
|
.mw-acts a, .mw-link, .mw-cook { text-decoration:none; color:inherit; display:block; }
|
||||||
|
.mw-cook { cursor:pointer; }
|
||||||
|
.mw-done { opacity:.4; pointer-events:none; cursor:default; }
|
||||||
.mw-p, .mw-n { position:absolute; top:75px; transform:translateY(-50%); width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,0.6); color:#fff; align-items:center; justify-content:center; font-size:11px; cursor:pointer; z-index:5; display:none; }
|
.mw-p, .mw-n { position:absolute; top:75px; transform:translateY(-50%); width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,0.6); color:#fff; align-items:center; justify-content:center; font-size:11px; cursor:pointer; z-index:5; display:none; }
|
||||||
.mw-p { left:6px; }
|
.mw-p { left:6px; }
|
||||||
.mw-n { right:6px; }
|
.mw-n { right:6px; }
|
||||||
@@ -1305,7 +1307,7 @@ data:
|
|||||||
<div class="mw-name">{{ $r.String "name" }}</div>
|
<div class="mw-name">{{ $r.String "name" }}</div>
|
||||||
</a>
|
</a>
|
||||||
{{ if gt $cooked 0 }}<div class="mw-stats">Cooked {{ $cooked }}× before</div>{{ end }}
|
{{ if gt $cooked 0 }}<div class="mw-stats">Cooked {{ $cooked }}× before</div>{{ end }}
|
||||||
<div class="mw-acts"><a href="{{ $url }}" target="_blank">Open</a> <a href="{{ $cook }}" target="_blank">Cooked today ✔</a></div>
|
<div class="mw-acts"><a href="{{ $url }}" target="_blank">Open</a> <span class="mw-cook" onclick="fetch('{{ $cook }}').then(function(r){if(r.ok){this.textContent='✓ Logged';this.classList.add('mw-done')}else{this.textContent='⚠ Error'}}.bind(this)).catch(function(){this.textContent='⚠ Error'}.bind(this))">Cooked today ✔</span></div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user