mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-21 07:31:58 +01:00
Stylize download buttons
This commit is contained in:
parent
1f91c4bafe
commit
51c2b94447
@ -18,12 +18,12 @@ const {
|
|||||||
|
|
||||||
const downloadInformation = computed(() => ({
|
const downloadInformation = computed(() => ({
|
||||||
preview: {
|
preview: {
|
||||||
tagName: previewRelease.value?.tag_name,
|
tagName: previewRelease.value?.tag_name || "0.00.0",
|
||||||
asset: (previewRelease.value?.assets ?? [])
|
asset: (previewRelease.value?.assets ?? [])
|
||||||
.find(a => /^tachiyomi-r\d{4,}.apk/.test(a.name)),
|
.find(a => /^tachiyomi-r\d{4,}.apk/.test(a.name)),
|
||||||
},
|
},
|
||||||
stable: {
|
stable: {
|
||||||
tagName: stableRelease.value?.tag_name?.slice(1),
|
tagName: stableRelease.value?.tag_name?.slice(1) || "r0000",
|
||||||
asset: (stableRelease.value?.assets ?? [])
|
asset: (stableRelease.value?.assets ?? [])
|
||||||
.find(a => /^tachiyomi-v\d+\.\d+\.\d+.apk/.test(a.name)),
|
.find(a => /^tachiyomi-v\d+\.\d+\.\d+.apk/.test(a.name)),
|
||||||
}
|
}
|
||||||
@ -40,38 +40,106 @@ const downloadInformation = computed(() => ({
|
|||||||
<div v-else-if="isErrorPreview">
|
<div v-else-if="isErrorPreview">
|
||||||
This is the error message: {{ errorPreview }}
|
This is the error message: {{ errorPreview }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else class="download-buttons">
|
||||||
<div class="buttons-wrapper">
|
<a class="download-button primary" :download="downloadInformation.stable.asset?.name" :href="downloadInformation.stable.asset?.browser_download_url">
|
||||||
<a
|
<IconDownload />
|
||||||
:download="downloadInformation.stable.asset?.name"
|
<span class="text">Stable</span>
|
||||||
:href="downloadInformation.stable.asset?.browser_download_url"
|
<span class="version">{{ downloadInformation.stable.tagName }}</span>
|
||||||
>
|
</a>
|
||||||
<span>Stable</span>
|
<a class="download-button secondary" :download="downloadInformation.preview.asset?.name" :href="downloadInformation.preview.asset?.browser_download_url">
|
||||||
<span>{{ downloadInformation.stable.tagName }}</span>
|
<IconDownload />
|
||||||
</a>
|
<span class="text">Preview</span>
|
||||||
<a
|
<span class="version">{{ downloadInformation.preview.tagName }}</span>
|
||||||
:download="downloadInformation.preview.asset?.name"
|
</a>
|
||||||
:href="downloadInformation.preview.asset?.browser_download_url"
|
|
||||||
>
|
|
||||||
<span>Preview</span>
|
|
||||||
<span>{{ downloadInformation.preview.tagName }}</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
Requires <strong>Android 6.0</strong> or higher.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<span class="version-disclaimer">
|
||||||
|
Requires <strong>Android 6.0</strong> or higher.
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="stylus">
|
<style lang="stylus">
|
||||||
.buttons-wrapper {
|
.download-buttons {
|
||||||
display: flex
|
display: flex
|
||||||
gap: 2rem
|
gap: 0.75em
|
||||||
|
justify-content: center
|
||||||
|
align-items: center
|
||||||
|
margin: 0.75em auto
|
||||||
|
}
|
||||||
|
|
||||||
& > a {
|
.download-button {
|
||||||
display: flex
|
display: inline-block
|
||||||
flex-direction: column
|
border: 1px solid transparent
|
||||||
align-items: center
|
text-align: center
|
||||||
|
font-weight: 600
|
||||||
|
white-space: nowrap
|
||||||
|
transition: color 0.25s, border-color 0.25s, background-color 0.25s
|
||||||
|
cursor: pointer
|
||||||
|
transition: all 0.3s ease
|
||||||
|
border-radius: 20px
|
||||||
|
padding: 0 20px
|
||||||
|
line-height: 38px
|
||||||
|
font-size: 14px
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none !important
|
||||||
|
}
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
border-color: var(--vp-button-brand-border)
|
||||||
|
color: var(--vp-button-brand-text)
|
||||||
|
background-color: var(--vp-button-brand-bg)
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: var(--vp-button-brand-hover-border)
|
||||||
|
color: var(--vp-button-brand-hover-text)
|
||||||
|
background-color: var(--vp-button-brand-hover-bg)
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
border-color: var(--vp-button-brand-active-border)
|
||||||
|
color: var(--vp-button-brand-active-text)
|
||||||
|
background-color: var(--vp-button-brand-active-bg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.secondary {
|
||||||
|
border-color: var(--vp-button-alt-border)
|
||||||
|
color: var(--vp-button-alt-text)
|
||||||
|
background-color: var(--vp-button-alt-bg)
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: var(--vp-button-alt-hover-border)
|
||||||
|
color: var(--vp-button-alt-hover-text)
|
||||||
|
background-color: var(--vp-button-alt-hover-bg)
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
border-color: var(--vp-button-alt-active-border)
|
||||||
|
color: var(--vp-button-alt-active-text)
|
||||||
|
background-color: var(--vp-button-alt-active-bg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
display: inline-block
|
||||||
|
vertical-align: middle
|
||||||
|
margin-right: 0.5em
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
margin-right: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
font-size: 12px
|
||||||
|
margin-left: 10px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.version-disclaimer {
|
||||||
|
display: block
|
||||||
|
text-align: center
|
||||||
|
margin: 0.75em auto
|
||||||
|
font-size: 0.75rem
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -10,7 +10,7 @@ import ReleaseDate from "../.vitepress/theme/components/ReleaseDate.vue";
|
|||||||
import WhatsNew from "../.vitepress/theme/components/WhatsNew.vue"
|
import WhatsNew from "../.vitepress/theme/components/WhatsNew.vue"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
# Download <IconDownload/>
|
# Download
|
||||||
|
|
||||||
Download the latest stable version of **Tachiyomi** that released **<ReleaseDate type="stable" />** or the preview version that released **<ReleaseDate type="preview" />**.
|
Download the latest stable version of **Tachiyomi** that released **<ReleaseDate type="stable" />** or the preview version that released **<ReleaseDate type="preview" />**.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user