Skip to content

Commit

Permalink
feat: v4.40.4
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Aug 28, 2024
1 parent a90e2a4 commit 7754dfd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "surmon.me",
"version": "4.40.3",
"version": "4.40.4",
"description": "Surmon.me blog",
"author": "Surmon",
"license": "MIT",
Expand Down
8 changes: 6 additions & 2 deletions src/components/flow/mobile/item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
article: Article
}>()
const { cdnDomain } = useEnhancer()
const { router, cdnDomain, gState } = useEnhancer()
const identityStore = useIdentityStore()
const isLiked = computed(() => identityStore.isLikedPage(props.article.id))
const isHybrid = computed(() => isHybridType(props.article.origin))
const isReprint = computed(() => isReprintType(props.article.origin))
const isOriginal = computed(() => isOriginalType(props.article.origin))
const handleClick = () => {
openNewWindow(getArticleDetailRoute(props.article.id))
if (gState.userAgent.isWechat) {
router.push(getArticleDetailRoute(props.article.id))
} else {
openNewWindow(getArticleDetailRoute(props.article.id))
}
}
const getThumbnailURL = (url: string, format?: ImgProxyFormat) => {
Expand Down
38 changes: 20 additions & 18 deletions src/csr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,26 @@ router.isReady().finally(() => {
i18n.set(globalState.userAgent.isZhUser ? Language.Chinese : Language.English)
// init user identity state
store.stores.identity.initOnClient()
// title surprise
document.addEventListener(
'visibilitychange',
(event) => {
// @ts-ignore
const isHidden = event.target?.hidden || event.target?.webkitHidden
const surprises = [
// tltle: zero width character
// { favicon: '🌝', title: '​' },
// { favicon: '⛔️', title: 'FORBIDDEN' },
// { favicon: '⭕️', title: 'FBI WARNING' },
{ favicon: '🌱', title: META.en_sub_title }
]
const index = Math.floor(Math.random() * surprises.length)
isHidden ? runTitler(surprises[index]) : resetTitler()
},
false
)
// title surprise (desktop only)
if (!globalState.userAgent.isMobile) {
document.addEventListener(
'visibilitychange',
(event) => {
// @ts-ignore
const isHidden = event.target?.hidden || event.target?.webkitHidden
const surprises = [
// tltle: zero width character
// { favicon: '🌝', title: '​' },
// { favicon: '⛔️', title: 'FORBIDDEN' },
// { favicon: '⭕️', title: 'FBI WARNING' },
{ favicon: '🌱', title: META.en_sub_title }
]
const index = Math.floor(Math.random() * surprises.length)
isHidden ? runTitler(surprises[index]) : resetTitler()
},
false
)
}
// production only
if (isProd) {
consoleSlogan(i18n.t(LanguageKey.APP_SLOGAN)!, store.stores.appOption.data?.site_email)
Expand Down

0 comments on commit 7754dfd

Please sign in to comment.