diff --git a/assets/global.css b/assets/global.css index bb0e31e..3eb1733 100644 --- a/assets/global.css +++ b/assets/global.css @@ -58,6 +58,10 @@ body { letter-spacing: 5px; } +#pcontent { + white-space: pre; +} + .calendar-wrapper { padding-left: 1em; padding-right: 1em; diff --git a/assets/js/web.js b/assets/js/web.js index 1be14c5..b53624d 100644 --- a/assets/js/web.js +++ b/assets/js/web.js @@ -17,3 +17,17 @@ function monDay(d) { diff = d.getDate() - day + (day == 0 ? -6:1); return new Date(d.setDate(diff)); } + +function weekNumber(d) { + // Copy date so don't modify original + d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())); + // Set to nearest Thursday: current date + 4 - current day number + // Make Sunday's day number 7 + d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay()||7)); + // Get first day of year + var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1)); + // Calculate full weeks to nearest Thursday + var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7); + // Return array of year and week number + return [d.getUTCFullYear(), weekNo]; +} diff --git "a/assets/js/\350\257\227\350\257\215\350\241\250.js" "b/assets/js/\350\257\227\350\257\215\350\241\250.js" new file mode 100644 index 0000000..71d88bb --- /dev/null +++ "b/assets/js/\350\257\227\350\257\215\350\241\250.js" @@ -0,0 +1,19 @@ +var weekPoetry = { + 1: { + "title": "清平乐·别来春半", + "author": "李煜", + "content": "别来春半,\n触目柔肠断。\n砌下落梅如雪乱,\n拂了一身还满。\n雁来音信无凭,\n路遥归梦难成。\n离恨恰如春草,\n更行更远还生。" + }, + + 2: { + "title": "问刘十九", + "author": "白居易", + "content": "绿蚁新醅酒,\n红泥小火炉。\n晚来天欲雪,\n能饮一杯无?" + }, + + 3: { + "title": "江城子·十年生死两茫茫", + "author": "苏轼", + "content": "十年生死两茫茫,\n不思量,自难忘。\n千里孤坟,无处话凄凉。\n纵使相逢应不识,\n尘满面,鬓如霜。\n夜来幽梦忽还乡,\n小轩窗,正梳妆。\n相顾无言,惟有泪千行。\n料得年年肠断处,\n明月夜,短松冈。" + } +} \ No newline at end of file diff --git a/index.html b/index.html index 4d315ca..40972aa 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@
-
+
别来春半,
触目柔肠断。
砌下落梅如雪乱,
@@ -34,8 +34,8 @@
-
清平乐·别来春半
-
李煜
+
清平乐·别来春半
+
李煜
@@ -80,9 +80,11 @@ +