1 2 3
| <span id="memos"></div> <script>async function fetchmemos(e){try{const t=await fetch(`/src/${e}.json`);if(!t.ok)throw new Error;const n=await t.json(),r=document.getElementById("memos"),o=Object.entries(n).sort(((e,t)=>new Date(t[0])-new Date(e[0])));for(const[e,t]of o){const n=document.createElement("div");n.className="entry",n.innerHTML=`<strong>${e}:</strong> ${t}`,r.appendChild(n)}}catch(e){return}}const currentYear=(new Date).getFullYear();fetchmemos(currentYear);</script> <style>#memos {max-width: 600px;margin: 20px auto;padding: 10px;background: #fff;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);border-radius: 8px;}.entry {border-bottom: 1px solid #ddd;padding: 10px 0;}</style>
|