+ {{#each-in @report.data.post_received_reactions as |emojiName count|}}
+
+ {{replaceEmoji (concat ":" emojiName ":")}}
+ {{this.cleanEmoji emojiName}}
+ {{count}} times
+
+ {{/each-in}}
- page 2
+
+
+
+ {{#each-in @report.data.post_used_reactions as |emojiName count|}}
+
+
{{replaceEmoji (concat ":" emojiName ":")}}
+
{{this.computePercentage count}}
+
+
+ {{/each-in}}
+
+
Total number of reactions:
+ {{this.totalPostUsedReactions}}
+
+
}
diff --git a/assets/javascripts/discourse/components/reports/reading-time.gjs b/assets/javascripts/discourse/components/reports/reading-time.gjs
new file mode 100644
index 0000000..c16be52
--- /dev/null
+++ b/assets/javascripts/discourse/components/reports/reading-time.gjs
@@ -0,0 +1,13 @@
+import Component from "@glimmer/component";
+
+export default class ReadingTime extends Component {
+
+
+ Reading time
+
+
+
+ page 2
+
+
+}
diff --git a/assets/javascripts/discourse/components/reports/word-cloud.gjs b/assets/javascripts/discourse/components/reports/word-cloud.gjs
new file mode 100644
index 0000000..fde9398
--- /dev/null
+++ b/assets/javascripts/discourse/components/reports/word-cloud.gjs
@@ -0,0 +1,9 @@
+import Component from "@glimmer/component";
+
+export default class WordCloud extends Component {
+
+
+ Word cloud
+
+
+}
diff --git a/assets/javascripts/discourse/components/rewind.gjs b/assets/javascripts/discourse/components/rewind.gjs
index 9aa0fff..665b7d8 100644
--- a/assets/javascripts/discourse/components/rewind.gjs
+++ b/assets/javascripts/discourse/components/rewind.gjs
@@ -1,25 +1,44 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
+import { on } from "@ember/modifier";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
+import { schedule } from "@ember/runloop";
import { eq } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
+import ActivityCalendar from "discourse/plugins/discourse-rewind/discourse/components/reports/activity-calendar";
+import BestPosts from "discourse/plugins/discourse-rewind/discourse/components/reports/best-posts";
+import BestTopics from "discourse/plugins/discourse-rewind/discourse/components/reports/best-topics";
+import FavoriteCategories from "discourse/plugins/discourse-rewind/discourse/components/reports/favorite-categories";
+import FavoriteTags from "discourse/plugins/discourse-rewind/discourse/components/reports/favorite-tags";
+import FBFF from "discourse/plugins/discourse-rewind/discourse/components/reports/fbff";
import Reactions from "discourse/plugins/discourse-rewind/discourse/components/reports/reactions";
+import ReadingTime from "discourse/plugins/discourse-rewind/discourse/components/reports/reading-time";
+import WordCloud from "discourse/plugins/discourse-rewind/discourse/components/reports/word-cloud";
export default class Rewind extends Component {
@tracked rewind = [];
@tracked fullScreen = true;
+ @tracked loadingRewind = false;
+
+ @action
+ registerScrollWrapper(element) {
+ this.scrollWrapper = element;
+ }
@action
async loadRewind() {
try {
+ this.loadingRewind = true;
this.rewind = await ajax("/rewinds");
} catch (e) {
popupAjaxError(e);
+ } finally {
+ this.loadingRewind = false;
}
}
@@ -28,30 +47,86 @@ export default class Rewind extends Component {
this.fullScreen = !this.fullScreen;
}
- reportComponentForIdentifier(identifier) {
- if (identifier === "reactions") {
- return Reactions;
+ @action
+ handleEscape(event) {
+ if (this.fullScreen && event.key === "Escape") {
+ this.fullScreen = false;
}
}
-
- {{#each this.rewind as |report|}}
- {{#if (eq report.identifier "reactions")}}
-
-
+
+ {{#if this.loadingRewind}}
+
+
+
Crunching your data...
+ {{else}}
+
+
+
+
+ {{#if this.showPrev}}
+
+ {{/if}}
+
+ {{#if this.showNext}}
+
+ {{/if}}
{{/if}}
- {{/each}}
+
}
diff --git a/assets/stylesheets/common/activity-calendar.scss b/assets/stylesheets/common/activity-calendar.scss
new file mode 100644
index 0000000..3045f7c
--- /dev/null
+++ b/assets/stylesheets/common/activity-calendar.scss
@@ -0,0 +1,25 @@
+.rewind-report-page.-activity-calendar {
+ .rewind-calendar {
+ tr {
+ border: none;
+ }
+ }
+
+ .rewind-calendar-cell {
+ height: 10px;
+ width: 10px;
+
+ &.-empty {
+ background: var(--tertiary-very-low);
+ }
+ &.-low {
+ background: var(--tertiary-low);
+ }
+ &.-medium {
+ background: var(--tertiary-medium);
+ }
+ &.-high {
+ background: var(--tertiary-hig);
+ }
+ }
+}
diff --git a/assets/stylesheets/common/card.scss b/assets/stylesheets/common/card.scss
index 3a9d0d9..6751925 100644
--- a/assets/stylesheets/common/card.scss
+++ b/assets/stylesheets/common/card.scss
@@ -1,2 +1,11 @@
.rewind-card {
+ box-shadow: 0 0 0 1px var(--primary-300), 0 0 0 4px var(--primary-100);
+ border-radius: calc(var(--d-border-radius) / 2);
+ display: flex;
+ flex-direction: column;
+ text-align: center;
+ padding: 1em;
+ box-sizing: border-box;
+ align-items: center;
+ justify-content: center;
}
diff --git a/assets/stylesheets/common/index.scss b/assets/stylesheets/common/index.scss
index 9cf8794..6560dd3 100644
--- a/assets/stylesheets/common/index.scss
+++ b/assets/stylesheets/common/index.scss
@@ -1,3 +1,6 @@
@import "rewind";
@import "report";
@import "card";
+@import "post-received-reactions";
+@import "post-used-reactions";
+@import "activity-calendar";
diff --git a/assets/stylesheets/common/post-received-reactions.scss b/assets/stylesheets/common/post-received-reactions.scss
new file mode 100644
index 0000000..bf6b60f
--- /dev/null
+++ b/assets/stylesheets/common/post-received-reactions.scss
@@ -0,0 +1,16 @@
+.rewind-report-page.-post-received-reactions {
+ .rewind-reactions-chart {
+ display: flex;
+ gap: 1em;
+ }
+
+ .rewind-card {
+ width: 177px;
+ height: 190px;
+
+ .emoji {
+ width: 72px;
+ height: 72px;
+ }
+ }
+}
diff --git a/assets/stylesheets/common/post-used-reactions.scss b/assets/stylesheets/common/post-used-reactions.scss
new file mode 100644
index 0000000..354c1c4
--- /dev/null
+++ b/assets/stylesheets/common/post-used-reactions.scss
@@ -0,0 +1,20 @@
+.rewind-report-page.-post-used-reactions {
+ display: flex;
+ gap: 1em;
+
+ .rewind-reactions-chart {
+ display: flex;
+ flex-direction: column;
+ gap: 1em;
+ }
+
+ .rewind-reactions-row {
+ display: flex;
+ gap: 1em;
+ }
+
+ .rewind-reactions-bar {
+ background: var(--tertiary);
+ height: 50px;
+ }
+}
diff --git a/assets/stylesheets/common/report.scss b/assets/stylesheets/common/report.scss
index 9a4fd59..38f1ffd 100644
--- a/assets/stylesheets/common/report.scss
+++ b/assets/stylesheets/common/report.scss
@@ -9,6 +9,4 @@
box-sizing: border-box;
font-weight: 700;
font-size: var(--font-up-2);
- height: 100cqh;
- width: 100cqw;
}
diff --git a/assets/stylesheets/common/rewind.scss b/assets/stylesheets/common/rewind.scss
index 0cef51c..28f7dca 100644
--- a/assets/stylesheets/common/rewind.scss
+++ b/assets/stylesheets/common/rewind.scss
@@ -1,14 +1,11 @@
-.rewind {
- width: 280px;
- height: 400px;
- background-color: var(--secondary);
+.rewind-container {
border-radius: var(--d-border-radius);
- overflow-y: auto;
- overflow-x: hidden;
- border: 1px solid var(--primary-very-low);
box-sizing: border-box;
position: relative;
- container-type: size;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 2em 4em;
&.-fullscreen {
top: 0;
@@ -16,14 +13,69 @@
right: 0;
bottom: 0;
z-index: 9999;
- width: 100vw;
+ width: calc(100vw - (100vw - 100%) + 2px);
height: 100vh;
position: fixed;
+ background: rgba(255, 255, 255, 0.5);
+ border-radius: 16px;
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
+ backdrop-filter: blur(4.9px);
+ -webkit-backdrop-filter: blur(4.9px);
}
}
-.rewind__exit-fullscreen-btn {
- position: sticky;
- top: 5px;
- left: calc(100% - 45px);
+.rewind {
+ width: 100vw;
+ height: 100vh;
+ max-height: 100%;
+ max-width: 100%;
+ background-color: var(--secondary);
+ box-shadow: 0 0 0 1px var(--primary-300), 0 0 0 4px var(--primary-100);
+ border-radius: calc(var(--d-border-radius) / 2);
+ container-type: size;
+ position: relative;
+}
+
+.rewind__scroll-wrapper {
+ overflow-y: auto;
+ overflow-x: hidden;
+ height: 100%;
+ width: 100%;
+ position: relative;
+}
+
+.rewind__exit-fullscreen-btn {
+ position: absolute;
+ top: 5px;
+ right: 20px;
+ z-index: 1;
+}
+
+.rewind__prev-btn {
+ position: absolute;
+ bottom: 5px;
+ left: 5px;
+ z-index: 1;
+}
+
+.rewind__next-btn {
+ position: absolute;
+ bottom: 5px;
+ right: 5px;
+ z-index: 1;
+}
+
+.rewind-loader {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 100cqh;
+ gap: 1em;
+ box-sizing: border-box;
+
+ &__text {
+ font-weight: 700;
+ font-size: var(--font-up-2);
+ }
}
diff --git a/assets/stylesheets/mobile/report.scss b/assets/stylesheets/mobile/report.scss
index 8c813f8..d6646f0 100644
--- a/assets/stylesheets/mobile/report.scss
+++ b/assets/stylesheets/mobile/report.scss
@@ -1,4 +1,2 @@
.report-page {
- width: 100vw;
- height: 100vh;
}
diff --git a/assets/stylesheets/mobile/rewind.scss b/assets/stylesheets/mobile/rewind.scss
index 65efbd9..f905afa 100644
--- a/assets/stylesheets/mobile/rewind.scss
+++ b/assets/stylesheets/mobile/rewind.scss
@@ -1,7 +1,7 @@
-.rewind {
- background-color: var(--secondary);
- border-radius: var(--d-border-radius);
- overflow-y: auto;
- overflow-x: hidden;
- border: 1px solid var(--primary-very-low);
+.rewind-container {
+ padding: 1em;
+ box-sizing: border-box;
+}
+
+.rewind {
}