From 3b8f55147748b5b631a8e9bee67da82f8c59b4b5 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 29 Mar 2018 23:16:53 -0700 Subject: [PATCH] implement better timeline navigations with fades --- routes/_actions/timeline.js | 13 ----- routes/_components/TimelineHomePage.html | 54 +++++++++++++++++++ routes/_components/TimelinePage.html | 47 ++++++++++++++++ routes/_components/compose/ComposeBox.html | 26 +++++++-- .../pseudoVirtualList/PseudoVirtualList.html | 7 ++- routes/_components/timeline/Timeline.html | 40 +++++++------- .../_components/virtualList/VirtualList.html | 5 +- .../virtualList/VirtualListContainer.html | 12 +++++ routes/_pages/accounts/[accountId].html | 27 +++++----- routes/_pages/favorites.html | 25 ++++----- routes/_pages/federated.html | 25 ++++----- routes/_pages/index.html | 13 ++--- routes/_pages/lists/[listId].html | 25 ++++----- routes/_pages/local.html | 25 ++++----- routes/_pages/notifications.html | 8 +-- routes/_pages/statuses/[statusId]/index.html | 23 ++++---- routes/_pages/tags/[tagName].html | 21 ++++---- .../computations/timelineComputations.js | 1 - routes/_utils/doubleRAF.js | 3 ++ 19 files changed, 259 insertions(+), 141 deletions(-) create mode 100644 routes/_components/TimelineHomePage.html create mode 100644 routes/_components/TimelinePage.html create mode 100644 routes/_utils/doubleRAF.js diff --git a/routes/_actions/timeline.js b/routes/_actions/timeline.js index 2bdce461..176ef3ab 100644 --- a/routes/_actions/timeline.js +++ b/routes/_actions/timeline.js @@ -66,19 +66,6 @@ async function fetchTimelineItemsAndPossiblyFallBack () { stop('fetchTimelineItemsAndPossiblyFallBack') } -export function initializeTimeline () { - mark('initializeTimeline') - let instanceName = store.get('currentInstance') - let timeline = store.get('currentTimeline') - requestAnimationFrame(() => { - requestAnimationFrame(() => { - console.log('initialized') - store.setForTimeline(instanceName, timeline, {initialized: true}) - }) - }) - stop('initializeTimeline') -} - export async function setupTimeline () { mark('setupTimeline') // If we don't have any item ids, or if the current item ids are stale diff --git a/routes/_components/TimelineHomePage.html b/routes/_components/TimelineHomePage.html new file mode 100644 index 00000000..26085770 --- /dev/null +++ b/routes/_components/TimelineHomePage.html @@ -0,0 +1,54 @@ + +
+ {{#if hidePage}} + + {{/if}} + {{#if $currentVerifyCredentials }} +
+ + \ No newline at end of file diff --git a/routes/_components/TimelinePage.html b/routes/_components/TimelinePage.html new file mode 100644 index 00000000..de9a7f65 --- /dev/null +++ b/routes/_components/TimelinePage.html @@ -0,0 +1,47 @@ +
+ {{#if hidePage}} + + {{/if}} +
+ +
+
+ {{#if !hidePage && hideTimeline}} + + {{/if}} +
+ +
+
+
+ + \ No newline at end of file diff --git a/routes/_components/compose/ComposeBox.html b/routes/_components/compose/ComposeBox.html index 0615d604..5778228c 100644 --- a/routes/_components/compose/ComposeBox.html +++ b/routes/_components/compose/ComposeBox.html @@ -1,4 +1,4 @@ -
+
{{#if contentWarningShown}}
-
-
+
+
-
+
\ No newline at end of file diff --git a/routes/_components/virtualList/VirtualList.html b/routes/_components/virtualList/VirtualList.html index 3257a6a3..1e4f6d09 100644 --- a/routes/_components/virtualList/VirtualList.html +++ b/routes/_components/virtualList/VirtualList.html @@ -1,5 +1,5 @@ - -
+
@@ -21,7 +21,6 @@ \ No newline at end of file diff --git a/routes/_pages/lists/[listId].html b/routes/_pages/lists/[listId].html index 7006ead9..c6078a0a 100644 --- a/routes/_pages/lists/[listId].html +++ b/routes/_pages/lists/[listId].html @@ -1,19 +1,20 @@ {{#if $isUserLoggedIn}} -{{#if $pinnedPage !== `/lists/${params.listId}`}} - -{{/if}} - + + {{#if $pinnedPage !== `/lists/${params.listId}`}} + + {{/if}} + {{else}} - - -

List

+ + +

List

-

A list will appear here when logged in.

-
-
+

A list will appear here when logged in.

+
+
{{/if}} \ No newline at end of file diff --git a/routes/_pages/statuses/[statusId]/index.html b/routes/_pages/statuses/[statusId]/index.html index c9435aea..725cbf3e 100644 --- a/routes/_pages/statuses/[statusId]/index.html +++ b/routes/_pages/statuses/[statusId]/index.html @@ -1,29 +1,30 @@ {{#if $isUserLoggedIn}} - - + + + {{else}} - - -

Status

+ + +

Status

-

A status thread will appear here when logged in.

-
-
+

A status thread will appear here when logged in.

+
+
{{/if}} \ No newline at end of file diff --git a/routes/_pages/tags/[tagName].html b/routes/_pages/tags/[tagName].html index 378101d6..f6aacddb 100644 --- a/routes/_pages/tags/[tagName].html +++ b/routes/_pages/tags/[tagName].html @@ -1,17 +1,18 @@ {{#if $isUserLoggedIn}} - - + + + {{else}} - - -

#{{params.tagName}}

+ + +

#{{params.tagName}}

-

A hashtag timeline will appear here when logged in.

-
-
+

A hashtag timeline will appear here when logged in.

+
+
{{/if}}