Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "View on GitHub" button #267

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions StreamAwesome/src/components/utils/ViewOnGithub.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<a
href="https://github.com/sebinside/StreamAwesome"
target="_blank"
class="btn btn-primary float-right text-sm"
>
<button
class="github-button me-2 w-full rounded-lg bg-gradient-to-r from-cyan-500 to-blue-500 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-gradient-to-bl focus:outline-none focus:ring-2 focus:ring-cyan-300 dark:focus:ring-cyan-800"
>
<i class="fa-brands fa-github"></i><span class="github-text"></span>
</button>
</a>
</template>

<style scoped>
.github-text::after {
content: 'View on GitHub';
}

.github-button:hover .github-text::after {
content: 'Vue on GitHub';
}

.github-button {
width: 12em;
height: 2.5em;
margin: 0;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
}

.fa-github {
font-size: 1.5em;
MelanX marked this conversation as resolved.
Show resolved Hide resolved
margin-right: 0.3em;
}
</style>
4 changes: 3 additions & 1 deletion StreamAwesome/src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script setup lang="ts">
import MainSettings from '@/components/MainSettings.vue'
import { streamAwesomeVersionInfo } from '@/model/versions'
import ViewOnGithub from '@/components/utils/ViewOnGithub.vue'
</script>

<template>
<main>
<main class="relative">
<h1 class="text-center text-3xl font-bold md:text-start">
Stream Awesome
<span class="text-sm text-gray-400">{{ streamAwesomeVersionInfo }}</span>
</h1>
<ViewOnGithub class="absolute right-0 top-0" />
<MainSettings />
</main>
</template>