|
@@ -15,6 +15,10 @@ let tweetAccountBindGroupInfo = {
|
|
isInit: false
|
|
isInit: false
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+let systemInfo = {
|
|
|
|
+ theme: 'light'
|
|
|
|
+}
|
|
|
|
+
|
|
function twitterPinLogin() {
|
|
function twitterPinLogin() {
|
|
if (window.location.href == 'https://api.twitter.com/oauth/authorize') {
|
|
if (window.location.href == 'https://api.twitter.com/oauth/authorize') {
|
|
let code = document.querySelector('code')
|
|
let code = document.querySelector('code')
|
|
@@ -839,6 +843,7 @@ export function init() {
|
|
checkTwitterTaskState();
|
|
checkTwitterTaskState();
|
|
initBuyNFT();
|
|
initBuyNFT();
|
|
addJoinedGroupList();
|
|
addJoinedGroupList();
|
|
|
|
+ getSysTheme();
|
|
|
|
|
|
// getTweetAccountGroupInfo( () => {
|
|
// getTweetAccountGroupInfo( () => {
|
|
addGroupTab()
|
|
addGroupTab()
|
|
@@ -1771,8 +1776,9 @@ export const selectGroupTab = () => {
|
|
const addGroupTabEventListener = (params) => {
|
|
const addGroupTabEventListener = (params) => {
|
|
let { groupTab } = params;
|
|
let { groupTab } = params;
|
|
groupTab.addEventListener('click', function () {
|
|
groupTab.addEventListener('click', function () {
|
|
|
|
+ let groupColor = systemInfo.theme == 'light' ? 'rgb(15, 20, 25)' : '#fff';
|
|
setGroupTabSelfStyle({
|
|
setGroupTabSelfStyle({
|
|
- groupColor: 'rgb(15, 20, 25)',
|
|
|
|
|
|
+ groupColor: groupColor,
|
|
groupFontWeight: '700',
|
|
groupFontWeight: '700',
|
|
lineDisplay: 'block'
|
|
lineDisplay: 'block'
|
|
});
|
|
});
|
|
@@ -2049,4 +2055,21 @@ const getTweetAccountGroupInfo = (cb) => {
|
|
cb && cb()
|
|
cb && cb()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const getSysTheme = () => {
|
|
|
|
+ const themeMedia = window.matchMedia("(prefers-color-scheme: light)");
|
|
|
|
+ if (themeMedia.matches) {
|
|
|
|
+ systemInfo.theme = 'light'
|
|
|
|
+ } else {
|
|
|
|
+ systemInfo.theme = 'dark'
|
|
|
|
+ }
|
|
|
|
+ themeMedia.addListener(e => {
|
|
|
|
+ addGroupTab()
|
|
|
|
+ if (e.matches) {
|
|
|
|
+ systemInfo.theme = 'light'
|
|
|
|
+ } else {
|
|
|
|
+ systemInfo.theme = 'dark'
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|