forked from auroral-ui/hexo-theme-aurora
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
974 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<a | ||
class="py-2 px-3 text-white flex items-center justify-center z-10 transition cursor-pointer rounded-xl font-semibold select-none" | ||
:style="gradientBackground" | ||
> | ||
{{ text }} | ||
</a> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { computed, defineComponent } from 'vue' | ||
import { useAppStore } from '@/stores/app' | ||
export default defineComponent({ | ||
name: 'ARPrimaryButton', | ||
components: {}, | ||
props: { | ||
text: String | ||
}, | ||
setup() { | ||
const appStore = useAppStore() | ||
return { | ||
gradientBackground: computed(() => { | ||
return { background: appStore.themeConfig.theme.header_gradient_css } | ||
}) | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style> | ||
.btn { | ||
padding: 8px 12px; | ||
background: var(--heo-fontcolor); | ||
border-radius: 12px; | ||
color: var(--heo-card-bg); | ||
display: flex; | ||
align-items: center; | ||
z-index: 1; | ||
transition: 0.3s; | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<a | ||
class="py-2 px-3 text-ob-bright flex items-center justify-center z-10 transition cursor-pointer rounded-xl bg-ob-deep-900 border-solid border-ob-bright border-t-2 border-b-2 border-r-2 border-l-2 opacity-80 select-none" | ||
> | ||
{{ text }} | ||
</a> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
export default defineComponent({ | ||
name: 'ARSecondaryButton', | ||
components: {}, | ||
props: { | ||
text: String | ||
}, | ||
setup() {} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<template> | ||
<div :class="notificationClasses"> | ||
<div | ||
class="flex flex-col relative bg-ob-deep-900 rounded-xl pt-4 overflow-hidden" | ||
> | ||
<div class="flex items-center space-x-4 px-6"> | ||
<SvgIcon | ||
icon-class="bell" | ||
stroke="var(--text-normal)" | ||
fill="none" | ||
width="1.4rem" | ||
height="1.4rem" | ||
/> | ||
<span>{{ message }}</span> | ||
</div> | ||
<span class="progress-bar mt-4" :style="progressStyle"></span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { computed, defineComponent, ref, watch } from 'vue' | ||
import SvgIcon from '@/components/SvgIcon/index.vue' | ||
import { useCommonStore } from '@/stores/common' | ||
export default defineComponent({ | ||
name: 'ARNotification', | ||
components: { SvgIcon }, | ||
setup() { | ||
const commonState = useCommonStore() | ||
const openState = ref(commonState.notificationState) | ||
const progress = ref(100) | ||
watch( | ||
() => commonState.notificationState, | ||
state => { | ||
let timer = 0 | ||
openState.value = state | ||
if (state) { | ||
progress.value = 100 | ||
window.setTimeout(() => { | ||
timer = window.setInterval(() => { | ||
progress.value = progress.value - 20 | ||
}, 800) | ||
}) | ||
window.setTimeout(() => { | ||
commonState.closeNotification() | ||
clearInterval(timer) | ||
progress.value = 100 | ||
}, 5000) | ||
} | ||
} | ||
) | ||
return { | ||
message: computed(() => commonState.notificationMessage), | ||
notificationClasses: computed(() => { | ||
return { | ||
'notification absolute z-50 shadow-2xl': true, | ||
open: openState.value | ||
} | ||
}), | ||
progressStyle: computed(() => { | ||
return { | ||
width: `${progress.value}%` | ||
} | ||
}) | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss"> | ||
.notification { | ||
top: -100%; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
transition: top 300ms ease-in-out; | ||
&.open { | ||
top: 1.5rem; | ||
} | ||
} | ||
.progress-bar { | ||
width: 100%; | ||
height: 2px; | ||
background-color: var(--text-accent); | ||
transition: width 1s linear; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<a | ||
class="links-group-avatar h-[120px] w-[120px] flex items-center justify-center text-white text-6xl font-bold" | ||
:href="link" | ||
target="_blank" | ||
:title="title" | ||
> | ||
<img | ||
v-if="source" | ||
class="h-full w-full shadow-xl m-0 rounded-full" | ||
:src="source" | ||
alt="link-avatar" | ||
:title="title" | ||
/> | ||
<ob-skeleton v-else width="7rem" height="7rem" circle /> | ||
</a> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
export default defineComponent({ | ||
name: 'ARLinkAvatar', | ||
components: {}, | ||
props: { | ||
title: String, | ||
link: String, | ||
source: { | ||
type: String | ||
} | ||
}, | ||
setup() {} | ||
}) | ||
</script> |
Oops, something went wrong.