From 66f7ca890f503090c5a4253d9c6e54d2766b0fa3 Mon Sep 17 00:00:00 2001 From: Peter Date: Fri, 22 Jul 2022 14:41:17 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20Remade=20Statistics=20U.I=20+=20?= =?UTF-8?q?Graph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Data.js | 789 ++++++++++++++++++++++++++++++------ components/Upload.js | 5 +- components/json/events.json | 109 +++++ pages/index.css | 27 ++ 4 files changed, 794 insertions(+), 136 deletions(-) diff --git a/components/Data.js b/components/Data.js index 1e8c7e6..47cbe61 100644 --- a/components/Data.js +++ b/components/Data.js @@ -342,6 +342,542 @@ function makeData(data) { const data_day = data.map((v, i) => [day[i], v]); return data_day; } + +const statIcons = { + acceptedInstantInvite: ( + + add_link + + ), + activityUpdated: ( + + detection_and_zone + + ), + addChannelRecipient: ( + + group_add + + ), + addReaction: ( + + add_reaction + + ), + appCrashed: ( + + emergency_home + + ), + applicationClosed: ( + + phonelink_lock + + ), + applicationCreated: ( + + phonelink_ring + + ), + applicationDeleted: ( + + phonelink_erase + + ), + appOpened: ( + + pinch_zoom_out + + ), + botAbused: ( + + smart_toy + + ), + botTokenCompromised: ( + + sentiment_very_dissatisfied + + ), + callReportProblem: ( + + phone_disabled + + ), + captchaServed: ( + + add_to_home_screen + + ), + captchaSolved: ( + + security_update_good + + ), + changeLogClosed: ( + + file_open + + ), + changeLogOpened: ( + + folder_off + + ), + channelDeleted: ( + + delete + + ), + channelOpened: ( + + ads_click + + ), + channelPermissionsOverwriteUpdated: ( + + drive_file_rename_outline + + ), + channelUpdated: ( + + task + + ), + closeTutorial: ( + + close_fullscreen + + ), + copyInstantInvite: ( + + copy_all + + ), + createChannel: ( + + create_new_folder + + ), + createEmoji: ( + + face_retouching_natural + + ), + createGuild: ( + + group + + ), + createGuildViewed: ( + + diversity_1 + + ), + createInstantInvite: ( + + draw + + ), + customStatusUpdated: ( + + system_update + + ), + dataRequestCompleted: ( + + where_to_vote + + ), + deleteEmoji: ( + + face_retouching_off + + ), + deleteGuild: ( + + group_off + + ), + devPortalPageViewed: ( + + document_scanner + + ), + dmListViewed: ( + + pageview + + ), + emailOpened: ( + + mark_email_read + + ), + emailSent: ( + + outgoing_mail + + ), + externalDynamicLinkReceived: ( + + share + + ), + friendAddViewed: ( + + streetview + + ), + friendRequestFailed: ( + + person_remove + + ), + friendsListViewed: ( + + featured_play_list + + ), + giftCodeCopied: ( + + difference + + ), + giftCodeCreated: ( + + control_point_duplicate + + ), + giftCodeRevoked: ( + + crisis_alert + + ), + giftCodeSent: ( + + redeem + + ), + guildBotAdded: ( + + precision_manufacturing + + ), + guildDiscoveryViewed: ( + + explore + + ), + guildInsightsSettingsCtaClicked: ( + + ads_click + + ), + guildJoined: ( + + groups_2 + + ), + guildMemberUpdated: ( + + manage_accounts + + ), + guildRoleUpdated: ( + + settings_accessibility + + ), + guildSettingsDiscoveryViewed: ( + + settings_applications + + ), + guildSettingsUpdated: ( + + settings_suggest + + ), + guildViewed: ( + + preview + + ), + inboxChannelClicked: ( + + archive + + ), + inviteAppOpened: ( + + door_open + + ), + inviteOpened: ( + + pinch_zoom_out + + ), + inviteSent: ( + + outbox + + ), + inviteViewed: ( + + preview + + ), + joinCall: ( + + call + + ), + joinGuildViewed: ( + + preview + + ), + joinVoiceChannel: ( + + record_voice_over + + ), + keyboardModeToggled: ( + + keyboard + + ), + keyboardShortcutUsed: ( + + keyboard_hide + + ), + leaveGuild: ( + + exit_to_app + + ), + leaveVoiceChannel: ( + + voice_over_off + + ), + loginAttempted: ( + + fmd_bad + + ), + loginSuccessful: ( + + login + + ), + memberListViewed: ( + + preview + + ), + messageAttachmentUpdated: ( + + attach_email + + ), + messageEdited: ( + + edit + + ), + messageEditUpArrow: ( + + arrow_drop_up + + ), + modalDismissed: ( + + cancel_presentation + + ), + newLoginLocation: ( + + add_location_alt + + ), + notificationClicked: ( + + notification_add + + ), + notificationSettingsUpdated: ( + + edit_notifications + + ), + oauth2AuthorizeAccepted: ( + + task_alt + + ), + oauth2AuthorizeViewed: ( + + pageview + + ), + openModal: ( + + present_to_all + + ), + openPopout: ( + + open_in_full + + ), + permissionsRequested: ( + + request_page + + ), + pinMessage: ( + + push_pin + + ), + promotionViewed: ( + + shopping_cart_checkout + + ), + removeReaction: ( + + remove + + ), + replyStarted: ( + + reply + + ), + ringCall: ( + + ring_volume + + ), + screenshareFailed: ( + + cast + + ), + searchClosed: ( + + search_off + + ), + searchOpened: ( + + search + + ), + searchResultExpanded: ( + + zoom_in + + ), + searchResultSortChanged: ( + + query_stats + + ), + searchResultViewed: ( + + manage_search + + ), + searchStarted: ( + + ), + sendMessage: ( + + send + + ), + slashCommandUsed: ( + + extension + + ), + startCall: ( + + phone_in_talk + + ), + subscriptionCanceled: ( + + unsubscribe + + ), + transactionCompleted: ( + + price_check + + ), + updateNote: ( + + edit_note + + ), + updateUserSettings: ( + + manage_accounts + + ), + userAccountUpdated: ( + + admin_panel_settings + + ), + userAvatarUpdated: ( + + account_circle + + ), + userPhoneUpdated: ( + + mobile_friendly + + ), + videoStreamEnded: ( + + stop_screen_share + + ), + videoStreamStarted: ( + + connected_tv + + ), + viewAsRolesSelected: ( + + view_timeline + + ), + voiceDisconnect: ( + + mic_off + + ), + webhookCreated: ( + + webhook + + ), + webhookDeleted: ( + + webhook + + ), +}; export default function Data(props) { const [topDMs, setTopDMs] = useState([]); const [topChannels, setTopChannels] = useState([]); @@ -939,7 +1475,13 @@ export default function Data(props) {
-
+
{data?.dataFile ? "Their" : "Your"}
Favorite @@ -1460,7 +2002,13 @@ export default function Data(props) {
{" "} - + Active Hours{" "} @@ -1604,13 +2150,19 @@ export default function Data(props) {
- + Top Users {data?.messages?.topDMs && data?.messages?.topDMs?.length > 0 ? (
@@ -1635,7 +2187,7 @@ export default function Data(props) { { setTimeout(() => { @@ -1718,7 +2270,7 @@ export default function Data(props) {
-
+
{m?.messageCount ? (
-
+
{m?.messageCount ? (
{" "} - + Top Channels {data?.messages?.topChannels && data?.messages?.topChannels?.length > 0 ? ( @@ -2288,7 +2846,7 @@ export default function Data(props) { { setTimeout(() => { @@ -2374,7 +2932,7 @@ export default function Data(props) {
-
+
{m?.messageCount ? (
-
+
{m?.messageCount ? (
- + {data?.dataFile ? "Their" : "Your"}
Discord
Bots
{" "} @@ -3173,7 +3737,13 @@ export default function Data(props) {
- + Statistics{" "} - -
    + {" "} +

    + If emojis don't load kindly refresh the page or wait. +

    +
    {data?.statistics ? Object.keys(data?.statistics)?.map((t, i) => { if (!t) return; if (EventsJSON?.events[t]) { return ( -
  • -
    -

    - -

    {" "} - {EventsJSON?.events[t]} +
    +
    + {statIcons[t] ? ( + +
    + {statIcons[t]} +
    +
    + ) : ( + "" + )} + +
    ${data?.statistics[t]}` + ) + .replace( + /{you}/g, + data?.dataFile ? "They" : "You" + ), + }} + />
    -
  • +
    ); } else if (t === "averageMessages") { return ( -
  • -
    - {data?.dataFile ? "They " : "You "} send ~{" "} -

    - -

    - Average Messages messages per day,{" "} -

    - -

    {" "} - messages per week,{" "} -

    - -

    {" "} - messages per month, and{" "} -

    - -

    {" "} - messages per year. -
    -
  • +
    + - {data?.dataFile ? "They " : "You "} send ~ + {data?.statistics[t].day} Average Messages messages per + day, {data?.statistics[t].week} messages per week,{" "} + {data?.statistics[t].month} messages per month, and{" "} + {data?.statistics[t].year} messages per year. +
    ); } else if (t === "averageOpenCount") { return ( -
  • -
    - {data?.dataFile ? "They " : "You "} open Discord ~{" "} -

    - -

    - times per day,{" "} -

    - -

    {" "} - times per week,{" "} -

    - -

    {" "} - times per month, and{" "} -

    - -

    {" "} - times per year. -
    -
  • +
    + - {data?.dataFile ? "They " : "You "} open discord ~ + {data?.statistics[t].day} times per + day, {data?.statistics[t].week} times per week,{" "} + {data?.statistics[t].month} times per month, and{" "} + {data?.statistics[t].year} times per year. +
    ); } }) : "This option was disabled"} -
+
-
+
-
Made by{" "} diff --git a/components/json/events.json b/components/json/events.json index a844c6d..622a8c2 100644 --- a/components/json/events.json +++ b/components/json/events.json @@ -137,5 +137,114 @@ "voiceDisconnect": "Disconnected From Voice", "webhookCreated": "Created Webhooks", "webhookDeleted": "Deleted Webhooks" + }, + "e_dsc": { + "acceptedInstantInvite": "{you} Accepted {count} Instant Invites", + "activityUpdated": "{you} have {count} Updated Activities", + "addChannelRecipient": "{you} Added Channel Recipients {count} times", + "addReaction": "{you} Added {count} reactions", + "appCrashed": "{you} have {count} Crashed Apps", + "applicationClosed": "{you} Closed {count} Applications", + "applicationCreated": "{you} Created {count} Applications", + "applicationDeleted": "{you} deleted {count} Applications", + "appOpened": "{you} Opened {count} Apps", + "botAbused": "{you} Abused {count} Bots", + "botTokenCompromised": "{you} have {count} Compromised Bot Tokens", + "callReportProblem": "{you} Reported {count} Calls", + "captchaServed": "{you} served {count} captchas", + "captchaSolved": "{you} solved {count} Captchas", + "changeLogClosed": "{you} Closed {count} Change Logs", + "changeLogOpened": "{you} Opened {count} Change Logs", + "channelDeleted": "{you} Deleted {count} Channels", + "channelOpened": "{you} Opened {count} Channels", + "channelPermissionsOverwriteUpdated": "{you} Updated {count} Channel Permissions Overwrites", + "channelUpdated": "{you} Updated {count} Channels", + "closeTutorial": "{you} Closed {count} Tutorials", + "copyInstantInvite": "{you} Copied {count} Instant Invites", + "createChannel": "{you} Created {count} Channels", + "createEmoji": "{you} Created {count} Emojis", + "createGuild": "{you} Created {count} Guilds", + "createGuildViewed": "{you} Opened Create Guild Modal {count} times", + "createInstantInvite": "{you} Created {count} Instant Invites", + "customStatusUpdated": "{you} Updated {count} Custom Statuses", + "dataRequestCompleted": "{you} Completed {count} Data Package Requests", + "deleteEmoji": "{you} Deleted {count} Emojis", + "deleteGuild": "{you} Deleted {count} Guilds", + "devPortalPageViewed": "{you} Viewed Discord's Dev Portal {count} times", + "dmListViewed": "{you} Viewed {count} Direct Messages", + "emailOpened": "{you} {count} Emails Opened", + "emailSent": "{you} Sent {count} Emails", + "externalDynamicLinkReceived": "{you} Received {count} External Dynamic Links", + "friendAddViewed": "{you} Viewed {count} Friend Requests", + "friendRequestFailed": "{you} have {count} Failed Friend Requests", + "friendsListViewed": "{you} Viewed Friends List {count} times", + "giftCodeCopied": "{you} Copied {count} Gift Codes", + "giftCodeCreated": "{you} Created {count} Gift Codes", + "giftCodeRevoked": "{you} Revoked {count} Gift Codes", + "giftCodeSent": "{you} Sent {count} Gift Codes", + "guildBotAdded": "{you} Added {count} Bots", + "guildDiscoveryViewed": "{you} Viewed Guild Discovery {count} times", + "guildInsightsSettingsCtaClicked": "{you} Clicked Guild Insights Settings CTA {count} times", + "guildJoined": "{you} Joined {count} Guilds", + "guildMemberUpdated": "{you} Updated {count} Guild Members", + "guildRoleUpdated": "{you} Updated {count} Guild Roles", + "guildSettingsDiscoveryViewed": "{you} Viewed Guild Settings Discovery {count} times", + "guildSettingsUpdated": "{you} Updated {count} Guild Settings", + "guildViewed": "{you} Viewed {count} Guilds", + "inboxChannelClicked": "{you} Clicked {count} Inbox Channels", + "inviteAppOpened": "{you} Opened {count} Invite Apps", + "inviteOpened": "{you} Opened {count} Invites", + "inviteSent": "{you} Sent {count} Invites", + "inviteViewed": "{you} Viewed {count} Invites", + "joinCall": "{you} Joined {count} Calls", + "joinGuildViewed": "{you} Viewed {count} Join Guild Modal", + "joinVoiceChannel": "{you} Joined {count} Voice Channels", + "keyboardModeToggled": "{you} Toggled Keyboard Mode {count} times", + "keyboardShortcutUsed": "{you} Used {count} Keyboard Shortcuts", + "leaveGuild": "{you} Left {count} Guilds", + "leaveVoiceChannel": "{you} Left {count} Voice Channels", + "loginAttempted": "{you} have {count} Attempted Logins", + "loginSuccessful": "{you} have {count} Successful Logins", + "memberListViewed": "{you} Viewed Member List {count} times", + "messageAttachmentUpdated": "{you} Updated {count} Message Attachments ", + "messageEdited": "{you} Edited {count} Messages", + "messageEditUpArrow": "{you} Edited {count} Messages using Up Arrow", + "modalDismissed": "{you} Dismissed {count} Modals", + "newLoginLocation": "{you} have {count} Detected new Login Locations", + "notificationClicked": "{you} Clicked {count} Notifications", + "notificationSettingsUpdated": "{you} Updated Notification Settings {count} times", + "oauth2AuthorizeAccepted": "{you} Accepted {count} OAuth2 Authorizations", + "oauth2AuthorizeViewed": "{you} Viewed {count} OAuth2 Authorizations", + "openModal": "{you} Opened {count} Modals", + "openPopout": "{you} Opened {count} Popouts", + "permissionsRequested": "{you} Requested Permissions {count} times", + "pinMessage": "{you} pinned {count} messages", + "promotionViewed": "{you} Viewed {count} Promotions", + "removeReaction": "{you} Removed {count} Reactions", + "replyStarted": "{you} Started {count} Replies", + "ringCall": "{you} Rang {count} calls", + "screenshareFailed": "{you} have {count} failed Screensharings", + "searchClosed": "{you} Closed {count} Searches", + "searchOpened": "{you} Opened {count} Searches", + "searchResultExpanded": "{you} have {count} Expanded Search Results", + "searchResultSortChanged": "{you} Changed Search Results Sort {count} times", + "searchResultViewed": "{you} Viewed {count} Search Results", + "searchStarted": "{you} Started {count} Searches", + "sendMessage": "{you} Sent {count} Messages", + "slashCommandUsed": "{you} Used {count} Slash Commands", + "startCall": "{you} Started {count} Calls", + "subscriptionCanceled": "{you} Canceled {count} Subscriptions", + "transactionCompleted": "{you} Completed {count} Transactions", + "updateNote": "{you} updated {count} notes", + "updateUserSettings": "{you} Updated User Settings {count} times", + "userAccountUpdated": "{you} Updated User Accounts {count} times", + "userAvatarUpdated": "{you} Updated your Avatar {count} times", + "userPhoneUpdated": "{you} Updated User Phone Numbers {count} times", + "videoStreamEnded": "{you} have {count} Ended Streams", + "videoStreamStarted": "{you} have {count} Started Streams", + "viewAsRolesSelected": "{you} Selected View As Roles {count} times", + "voiceDisconnect": "{you} Disconnected From Voice {count} times", + "webhookCreated": "{you} Created {count} Webhooks", + "webhookDeleted": "{you} Deleted {count} Webhooks" } } diff --git a/pages/index.css b/pages/index.css index e576c5a..cbf162e 100644 --- a/pages/index.css +++ b/pages/index.css @@ -2,6 +2,33 @@ @tailwind components; @tailwind utilities; +@font-face { + font-family: "Material Symbols Rounded"; + font-style: normal; + font-weight: 100 700; + font-display: optional; + src: url(https://fonts.gstatic.com/s/materialsymbolsrounded/v34/sykg-zNym6YjUruM-QrEh7-nyTnjDwKNJ_190Fjzag.woff2) + format("woff2"); +} + +.material-symbols-rounded { + font-family: "Material Symbols Rounded"; + font-weight: normal; + font-style: normal; + font-size: 24px; + line-height: 1; + letter-spacing: normal; + text-transform: none; + display: inline-block; + white-space: nowrap; + word-wrap: normal; + direction: ltr; + -webkit-font-feature-settings: "liga"; + -webkit-font-smoothing: antialiased; + margin-right: 10px; + font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 48; +} + @font-face { font-family: Ginto; font-weight: 700;