Skip to content

Commit ce4bfef

Browse files
committed
Merge remote-tracking branch 'origin/proxy' into anonymous-user
* origin/proxy: feat(sun-icon): add sun icon that toggles with dark mode fix(bug-report): remove bug report button feat(dark-mode): implement dark mode and save settings via local prefs style(user-posts): Prevent user posts from being cutoff on mobile style(column-gap): Removed column gap so posts view can use full width style(boards-view): Set flex always on last-post section of boards listing refactor(wip-dark-theme-colors): implement general dark theme css style(polls): Removed min-height from polls css style(polls): Added polls to the top of the thread; added collapse functionality style(boards): restructured board listing layout and spacing; added border-bottom to differentiate between boards better feat(title-update): Update document title based on page style(grid-columns): Removing base grid columns for posts and profile pages to enable full width style(large-numbers): Added thousands separators to large numbers to make them more readable refactor(report-bug): Removed report bug link in header style(avatar-size): Set avatar size to be 120x80 to match Bitcointalk sizing
2 parents 74d2f88 + 8f7398b commit ce4bfef

File tree

11 files changed

+232
-82
lines changed

11 files changed

+232
-82
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ main {
106106
#public-content {
107107
@include base-layout-width;
108108
@include grid-base-layout;
109-
@include grid-columns-base;
110109
// margin-top: $header-bottom-margin;
111110
grid-template-areas:
112111
"header header"
113112
"main main"
114113
"sidebar sidebar";
115114
grid-gap: 2rem;
115+
column-gap: 0;
116116
row-gap: 0;
117117
margin-bottom: 2rem;
118118

src/assets/scss/_global-components.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ input[disabled].toggle-switch:checked + label:after { background-color: lighten(
979979
color: $sub-header-font-color;
980980
margin: 1.5rem 0;
981981
max-height: calc(100vh - 16rem);
982-
min-height: 200px;
983982
overflow-x: hidden;
984983
overflow-y: auto;
985984
button { margin: 0.5rem 0 0; width: 100%; }

src/assets/scss/_overrides.scss

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,99 @@ body { overflow: hidden auto; }
2424
box-sizing: inherit;
2525
}
2626
}
27+
28+
// $sub-header-color #1a1a1a;
29+
// $sub-header-secondary-font-color #f9f9f9;
30+
// $secondary-font-color #f0f0f0;
31+
// $base-background-color #0f0f0f;
32+
// $base-font-color #fff;
33+
// $header-bg-color rgb(17, 17, 17);
34+
// $breadcrumbs-border-color #2f2f2f;
35+
// $breadcrumbs-link-color rgb(153, 153, 153);
36+
// $recent-thread-background-color #262626;
37+
html.dark, html.dark body {
38+
background-color: #0f0f0f; // $base-background-color;
39+
color: #fff; // $base-font-color;
40+
.board-controls {
41+
background-color: #0f0f0f; //$base-background-color;
42+
h1 { color: #fff; } // $base-font-color;
43+
}
44+
.child-boards .description, .threads-list .description {
45+
color: #fff; // $base-font-color;
46+
}
47+
.category .board h2 a {
48+
color: #f0f0f0; // $secondary-font-color;
49+
}
50+
.category .board .info .description {
51+
color: #f0f0f0; // $secondary-font-color;
52+
}
53+
header #menu-wrap {
54+
background-color: rgb(17, 17, 17); // $header-bg-color;
55+
}
56+
header #breadcrumbs-wrap {
57+
background-color: #1a1a1a; // $sub-header-color;
58+
border-bottom: 1px solid #2f2f2f; // $breadcrumbs-border-color;
59+
#breadcrumbs ul li span {
60+
color: rgb(153, 153, 153); // $breadcrumbs-link-color;
61+
}
62+
}
63+
.dashboard-hero {
64+
background-color: #1a1a1a; // $sub-header-color;
65+
.threads-data {
66+
background-color: #262626; // $recent-thread-background-color
67+
}
68+
}
69+
.actions-bottom {
70+
border-top: 1px solid #2f2f2f; // $breadcrumbs-border-color;
71+
background-color: #0f0f0f; // $base-background-color;
72+
}
73+
.page-header-split h1 {
74+
color: #fff; // $base-font-color
75+
}
76+
.poll-title, .actionsBar {
77+
background-color: #0f0f0f; // $base-background-color;
78+
color: #f0f0f0; // $secondary-font-color;
79+
}
80+
.polls {
81+
.poll-header .poll-question {
82+
color: #fff; // $base-font-color
83+
}
84+
.poll-answer .poll-select {
85+
color: #f0f0f0; // $sub-header-secondary-font-color;
86+
}
87+
}
88+
.profile-header .profile-user-details .profile-user-name-role h1 {
89+
color: #fff; // $base-font-color
90+
}
91+
.table-actions button {
92+
color: #f0f0f0; // $secondary-font-color;
93+
&.active {
94+
color: rgb(255, 100, 0); // $color-primary
95+
}
96+
}
97+
.pagination-wrap .pagination {
98+
.control {
99+
fill: rgb(153, 153, 153); // $breadcrumbs-link-color;
100+
}
101+
.control-active {
102+
fill: #fff; // $base-font-color
103+
&:hover {
104+
fill: rgb(255, 100, 0); // $color-primary
105+
}
106+
}
107+
.page {
108+
color: #fff; // $base-font-color
109+
}
110+
}
111+
.pagination-simple button {
112+
background: #0f0f0f; // $base-background-color;
113+
}
114+
.profile-posts-table {
115+
.post {
116+
color: #fff; // $base-font-color
117+
&:hover {
118+
background-color: lighten(#0f0f0f, 5%); // $base-background-color;
119+
}
120+
}
121+
}
122+
}

src/components/layout/HeaderComponent.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@
8484
<!-- Login Section -->
8585
<ul class="signed-out" v-if="!loggedIn">
8686
<li>
87-
<a href="https://forms.clickup.com/57751/f/1rcq-791/HNWSBPWCDSRMDMS9TF" target="_blank">REPORT A BUG</a>
87+
<a href="" @click.prevent="toggleDarkMode()">
88+
<i v-if="!darkMode" class="fa-solid fa-moon"></i>
89+
<i v-if="darkMode" class="fa-solid fa-sun"></i>
90+
</a>
8891
</li>
8992
</ul>
9093

@@ -265,7 +268,7 @@ import AdminNavigation from '@/components/layout/AdminNavigation.vue'
265268
import AdminSubNavigation from '@/components/layout/AdminSubNavigation.vue'
266269
import decode from '@/composables/filters/decode'
267270
import { AuthStore } from '@/composables/stores/auth'
268-
import { PreferencesStore } from '@/composables/stores/prefs'
271+
import { PreferencesStore, localStoragePrefs} from '@/composables/stores/prefs'
269272
import { reactive, toRefs, watch, onMounted, onUnmounted, onBeforeMount, inject } from 'vue'
270273
import { debounce } from 'lodash'
271274
import { useRouter, useRoute } from 'vue-router'
@@ -282,6 +285,10 @@ export default {
282285
let fetchMotd = () => motdApi.get().then(d => v.motdData = d).catch(() => {})
283286
fetchMotd()
284287
addAnnouncementListener(fetchMotd)
288+
289+
// set dark mode if in user prefs
290+
if (localStoragePrefs().data.dark_mode)
291+
document.documentElement.classList.add('dark')
285292
})
286293
/* Internal Methods */
287294
const scrollHeader = () => {
@@ -320,6 +327,12 @@ export default {
320327
if (v.searchExpanded) { v.search.focus() }
321328
}
322329
330+
const toggleDarkMode = () => {
331+
v.darkMode = !v.darkMode
332+
document.documentElement.classList.toggle('dark')
333+
$prefs.update()
334+
}
335+
323336
const unseenMentionsText = () => {
324337
let unseenInList = 0;
325338
v.mentionsList.forEach(mention => { if (!mention.viewed) { unseenInList++ } })
@@ -337,6 +350,7 @@ export default {
337350
338351
/* Template Data */
339352
const v = reactive({
353+
darkMode: $prefs.data.dark_mode,
340354
showMobileMenu: false,
341355
focusSearch: false,
342356
searchExpanded: false,
@@ -389,7 +403,7 @@ export default {
389403
window.removeEventListener('scroll', debounce(scrollHeader, 10))
390404
})
391405
392-
return { ...toRefs(v), BanStore, logout, isPatroller, searchForum, dismissNotifications, deleteMention, unseenMentionsText, toggleFocusSearch, decode, humanDate }
406+
return { ...toRefs(v), BanStore, logout, isPatroller, searchForum, dismissNotifications, deleteMention, unseenMentionsText, toggleFocusSearch, toggleDarkMode, decode, humanDate }
393407
}
394408
}
395409
</script>

src/components/polls/PollViewer.vue

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
<template>
22
<div class="polls" id="poll-view" v-if="poll">
33
<!-- Poll Header -->
4-
<div class="poll-title">
4+
<div class="poll-title collapse-section" @click="togglePollsCollapsed()">
55
<span class="poll-title-text">
6+
<a :class="{ 'is-open': !options.polls_collapsed, 'is-closed': options.polls_collapsed }">
7+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 39.84 22.63" class="icon__caretDown">
8+
<title></title>
9+
<g id="Layer_2" data-name="Layer 2">
10+
<polyline class="icon" points="37.92 1.92 19.92 19.92 1.92 1.92" />
11+
</g>
12+
</svg>
13+
</a>
614
Poll
715
<span class="is_locked" v-if="pollCopy.locked">(Locked)</span>
816
</span>
9-
<div class="poll-controls">
17+
<div v-if="!options.polls_collapsed" class="poll-controls">
1018
<!-- Poll Controls -->
1119
<div class="poll-control" v-if="canLock()">
1220
<input id="lockPoll" class="icon" type="checkbox" v-model="pollCopy.locked">
@@ -32,7 +40,7 @@
3240
</div>
3341

3442
<!-- Poll Edit -->
35-
<div class="poll-edit" v-if="canEdit()" :class="{'showing': editPoll, 'hidden': !editPoll}">
43+
<div class="poll-edit" v-if="canEdit() && !options.polls_collapsed" :class="{'showing': editPoll, 'hidden': !editPoll}">
3644
<div class="slide-wrapper">
3745
<div class="poll-edit-container">
3846
<h5 class="panelTitle">Edit Poll Options:</h5>
@@ -71,7 +79,7 @@
7179
</div>
7280
</div>
7381

74-
<div class="poll-body">
82+
<div v-if="!options.polls_collapsed" class="poll-body">
7583
<div class="poll-header">
7684
<!-- Poll Details -->
7785
<div class="poll-header-main">
@@ -117,7 +125,7 @@
117125
</div>
118126
</div>
119127
</div>
120-
<div class="actionsBar">
128+
<div v-if="!options.polls_collapsed" class="actionsBar">
121129
<button @click="vote()" :disabled="pollAnswers.length === 0" v-if="canVote()">Vote</button>
122130
<button v-if="canRemoveVote()" @click="removeVote()" class="secondary">Remove Vote</button>
123131
</div>
@@ -288,6 +296,11 @@ export default {
288296
console.log('scrollPollView')
289297
// $('#poll-view').animate({ scrollTop: 0 }, 250)
290298
}
299+
300+
const togglePollsCollapsed = () => {
301+
v.options.polls_collapsed = !v.options.polls_collapsed
302+
}
303+
291304
/* Internal Data */
292305
const $auth = inject(AuthStore)
293306
const $alertStore = inject('$alertStore')
@@ -303,7 +316,8 @@ export default {
303316
display_mode: props.poll.display_mode,
304317
// used in view to track date and time from input field
305318
expiration_date: props.poll.expiration ? dayjs(props.poll.expiration).format('YYYY-MM-DD') : undefined,
306-
expiration_time: props.poll.expiration ? dayjs(props.poll.expiration).format('HH:mm') : undefined
319+
expiration_time: props.poll.expiration ? dayjs(props.poll.expiration).format('HH:mm') : undefined,
320+
polls_collapsed: false
307321
},
308322
editPoll: false,
309323
pollAnswers: [],
@@ -334,7 +348,8 @@ export default {
334348
updateLockPoll,
335349
calcExpiration,
336350
scrollPollView,
337-
humanDate
351+
humanDate,
352+
togglePollsCollapsed
338353
}
339354
}
340355
}
@@ -351,4 +366,34 @@ export default {
351366
max-height: 0rem;
352367
}
353368
}
369+
370+
.collapse-section {
371+
@include no-select;
372+
cursor: pointer;
373+
a { margin-left: -0.5rem; }
374+
.title { display: inline-block; margin-left: .5rem; }
375+
.is-open {
376+
.icon__caretDown {
377+
transform: rotateZ(0deg);
378+
transition: all ease-in-out 150ms;
379+
}
380+
}
381+
.is-closed {
382+
.icon__caretDown {
383+
transform: rotateZ(-90deg);
384+
transition: all ease-in-out 150ms;
385+
}
386+
}
387+
.icon__caretDown {
388+
margin-bottom: 3px;
389+
width: 8px;
390+
polyline {
391+
fill: none;
392+
stroke: $secondary-font-color;
393+
stroke-linecap: round;
394+
stroke-miterlimit: 10;
395+
stroke-width: 7px;
396+
}
397+
}
398+
}
354399
</style>

src/components/users/UserPosts.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ export default {
253253
}
254254
&.closed {
255255
width: 100%;
256+
@include break-mobile-sm {
257+
max-height: 3rem;
258+
}
256259
max-height: 2.5rem;
257260
white-space: pre-wrap;
258261
overflow: hidden;

src/composables/stores/prefs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const emtpyPrefs = {
1717
},
1818
patroller_view: false,
1919
collapsed_categories: [],
20-
ignored_boards: []
20+
ignored_boards: [],
21+
dark_mode: false
2122
}
2223

2324
export const PreferencesStore = Symbol(PREFS_KEY)
@@ -68,6 +69,7 @@ export default {
6869
patroller_view: prefs.patroller_view,
6970
collapsed_categories: [...prefs.collapsed_categories],
7071
ignored_boards: [...prefs.ignored_boards],
72+
dark_mode: prefs.dark_mode,
7173
...specificPrefs
7274
}
7375
if (user && user.token) { // user is logged in update cache and server

0 commit comments

Comments
 (0)