Skip to content

Commit 7cd8191

Browse files
committed
chore(playground): added github url
1 parent 1214e70 commit 7cd8191

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

.github/workflows/next.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
touch playground/dist/.nojekyll
102102
env:
103103
BASE_URL: /vue-semantic-structure/playground/
104+
VITE_GITHUB_URL: https://github.com/basics/vue-semantic-structure
104105
- name: Archive Production Artifact
105106
uses: actions/upload-artifact@v4
106107
with:

playground/src/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
</DebugContainerComposable>
150150

151151
<!-- composable example end -->
152+
153+
<GithubCorner :url="GITHUB_URL" />
152154
</div>
153155
</template>
154156

@@ -157,6 +159,9 @@ import DebugContainer from '@/components/DebugContainer.vue';
157159
import DebugHeadline from '@/components/DebugHeadline.vue';
158160
import DebugContainerComposable from '@/components/composable/DebugContainer.vue';
159161
import DebugHeadlineComposable from '@/components/composable/DebugHeadline.vue';
162+
import GithubCorner from './components/GithubCorner.vue';
163+
164+
const GITHUB_URL = import.meta.env.VITE_GITHUB_URL;
160165
</script>
161166

162167
<style scoped>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<template>
2+
<a class="atom-github-corner" :href="url" :aria-label="title" :title="title" :target="target" rel="noopener">
3+
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true">
4+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
5+
<path
6+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
7+
fill="currentColor"
8+
style="transform-origin: 130px 106px"
9+
class="octo-arm" />
10+
<path
11+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
12+
fill="currentColor"
13+
class="octo-body" />
14+
</svg>
15+
</a>
16+
</template>
17+
18+
<script setup>
19+
defineProps({
20+
title: {
21+
type: String,
22+
default: 'View source on GitHub'
23+
},
24+
target: {
25+
type: String,
26+
default: '_blank'
27+
},
28+
url: {
29+
type: String,
30+
default: 'https://your-url'
31+
}
32+
});
33+
</script>
34+
35+
<style lang="postcss" scoped>
36+
.atom-github-corner {
37+
position: fixed;
38+
top: 0;
39+
right: 0;
40+
z-index: 10000;
41+
42+
& svg {
43+
position: absolute;
44+
top: 0;
45+
right: 0;
46+
color: #fff;
47+
border: 0;
48+
fill: #151513;
49+
}
50+
51+
&:focus,
52+
&:hover {
53+
& .octo-arm {
54+
animation: octocat-wave 560ms ease-in-out;
55+
}
56+
}
57+
58+
@media (width <= 500px) {
59+
& .octo-arm {
60+
animation: octocat-wave 560ms ease-in-out;
61+
}
62+
63+
&:hover {
64+
& .octo-arm {
65+
animation: none;
66+
}
67+
}
68+
}
69+
}
70+
71+
@keyframes octocat-wave {
72+
0%,
73+
100% {
74+
transform: rotate(0);
75+
}
76+
77+
20%,
78+
60% {
79+
transform: rotate(-25deg);
80+
}
81+
82+
40%,
83+
80% {
84+
transform: rotate(10deg);
85+
}
86+
}
87+
</style>

0 commit comments

Comments
 (0)