diff --git a/README.md b/README.md index e9c71a1..ef277b4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# Emoji Every Day +--- +layout: default +title: Emoji Every Day +permalink: /about/ +--- An emoji character for (almost) every day. -Data in emoji.yaml. Made for India, but can be extended to other countries. +Data in [`_data/emoji.yaml`](https://github.com/captn3m0/emoji-every-day/blob/main/_data/emoji.yml). Made for India, but can be extended to other countries. Includes: @@ -33,4 +37,9 @@ the proposal isn't accepted yet. Licensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details. +## Why + +Think of this as a poor man's Google Doodle for any website, where you might have daily refreshes. I'm currently using it for [news.tatooine.club](https://news.tatooine.club), +where I wanted to put a 🎄 next to the date for Christmas, but extended it to this project. See [Origin Post](https://tatooine.club/@nemo/111647981554186397) for more details. + [undays]: https://www.un.org/en/observances/list-days-weeks \ No newline at end of file diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..3e12852 --- /dev/null +++ b/_config.yml @@ -0,0 +1,6 @@ +url: "" # the base hostname & protocol for your site, e.g. http://example.com +baseurl: "" # the subpath of your site, e.g. /blog +title: "" # the name of your site, e.g. ACME Corp. +exclude: + - vendor + - test.py \ No newline at end of file diff --git a/emoji.yaml b/_data/emoji.yaml similarity index 99% rename from emoji.yaml rename to _data/emoji.yaml index 42ab956..d7f37a3 100644 --- a/emoji.yaml +++ b/_data/emoji.yaml @@ -324,7 +324,7 @@ link: https://www.wipo.int/ip-outreach/en/ipday/ type: UN - - day_name: International Girls in "Information and Communications Technology" Day + - day_name: International Girls in 'Information and Communications Technology' Day emoji: 👩‍💻 link: https://www.itu.int/en/wgirls-ict/Pages/default.aspx type: UN diff --git a/_includes/emoji-date.html b/_includes/emoji-date.html new file mode 100644 index 0000000..1235f39 --- /dev/null +++ b/_includes/emoji-date.html @@ -0,0 +1,11 @@ +{% assign emojis = site.data.emoji[include.date_key] | default: empty_array %} + +{% if emojis.size > 0 %} + {% for event in emojis %} + {% if event.link %} + {{ event.emoji }} + {% else %} + {{ event.emoji }} + {% endif %} + {% endfor %} +{% endif %} diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..17cdd94 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/_includes/year.html b/_includes/year.html new file mode 100644 index 0000000..bf8e1c1 --- /dev/null +++ b/_includes/year.html @@ -0,0 +1,31 @@ +{% assign current_date = site.time | date: "%m-%d" %} +{% assign epoch = 1704068700 %} +{% assign one_day = 60 | times: 60 | times: 24 %} +{% assign D = epoch %} + +{% for date in (1...366) %} + {% assign D_n = D | date:"%d" %} + {% if D_n == "01" %} + {% assign month = D|date:"%m" %} +
+

{{D|date:"%B"}}

+
+ {% endif %} + {% assign D_x = D|date:"%m-%d"%} + {% assign D_y = D|date:"%Y-%m-%d"%} +
+ {{D|date:"%d"}} +
+ {% include emoji-date.html date_key=D_x %} + {% include emoji-date.html date_key=D_y %} +
+
+ {% assign D = D | plus:one_day %} + {% assign new_month = D|date:"%m" %} + + {% if new_month != month %} + +
+ {% endif %} + +{% endfor %} \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..feb9b82 --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,16 @@ + + + + + + {{ page.title }} - {{ site.title }} + + + +

{{page.title}}

+
+ {{ content }} +
+ {% include footer.html %} + + diff --git a/_sass/base.scss b/_sass/base.scss new file mode 100644 index 0000000..d792eab --- /dev/null +++ b/_sass/base.scss @@ -0,0 +1,17 @@ +$backgroundColor: #ffffff; +$bodyColor: #000000; +$bodyFont: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; + +body { + background: $backgroundColor; + color: $bodyColor; + font-family: $bodyFont; +} + +footer { + margin-top: 20px; + padding: 20px; + text-align: center; + font-size: 0.8em; + color: #aaa; +} \ No newline at end of file diff --git a/assets/css/main.scss b/assets/css/main.scss new file mode 100644 index 0000000..49efead --- /dev/null +++ b/assets/css/main.scss @@ -0,0 +1,69 @@ +--- +--- +@import "base"; +$primary-color: #3498db; +$today-color: #e74c3c; + +h1 { + color: $primary-color; + text-align: center; +} + +.calendar { + display: flex; + flex-wrap: wrap; + margin: 20px; + font-family: Arial, sans-serif; + + .month { + width: 100%; /* Full width on small screens */ + margin: 10px; + padding: 10px; + box-sizing: border-box; + + h2 { + color: $primary-color; + margin-bottom: 10px; + } + + .days { + display: flex; + flex-wrap: wrap; + } + + .day { + width: 14.28%; /* One-seventh of the container */ + box-sizing: border-box; + padding: 10px; + border: 1px solid #ddd; + text-align: center; + + &.today { + background-color: $today-color; + color: #fff; + font-weight: bold; + } + + .emoji { + font-size: 1.2em; + } + + a { + text-decoration: none; + color: inherit; + } + } + } + + @media (min-width: 600px) { + .month { + width: 48%; /* Two months per row on medium screens */ + } + } + + @media (min-width: 768px) { + .month { + width: 31%; /* Three months per row on large screens */ + } + } +} diff --git a/index.md b/index.md new file mode 100644 index 0000000..062aa37 --- /dev/null +++ b/index.md @@ -0,0 +1,7 @@ +--- +layout: default +title: Emoji Calendar 2024 +--- +
+ {% include year.html %} +
\ No newline at end of file