@@ -3,6 +3,8 @@ import { ref, onMounted, onUnmounted } from "vue";
33
44const ws = ref (null );
55const status = ref (" text-gruvbox-gray" );
6+
7+ const vscode = ref (null );
68const spotify = ref (null );
79
810const connectWebSocket = () => {
@@ -22,6 +24,9 @@ const connectWebSocket = () => {
2224 if (data .t === " INIT_STATE" || data .t === " PRESENCE_UPDATE" ) {
2325 const presence = data .d ;
2426 spotify .value = presence .spotify ;
27+ vscode .value = presence .activities .find (
28+ (activity ) => activity .name === " Visual Studio Code" ,
29+ );
2530
2631 switch (presence .discord_status ) {
2732 case " online" :
@@ -66,39 +71,32 @@ onUnmounted(() => {
6671 </div >
6772 <div >
6873 emirhan (aka larei), 18 years-old. self-taught developer,
69- <a
70- href =" https://www.youtube.com/watch?v=9sJUDx7iEJw"
71- target =" _blank"
72- class =" underline"
73- >open-source</a
74- >
74+ <a href =" https://www.youtube.com/watch?v=9sJUDx7iEJw" target =" _blank" class =" underline" >open-source</a >
7575 enthusiast. programming, music, math.
7676 </div >
77- <div class =" flex gap-2 text-sm text-gruvbox-gray" >
78- <font-awesome-icon :icon =" ['fab', 'spotify']" class =" mt-[3px] " />
77+ <div class =" flex items-center gap-2 text-sm text-gruvbox-gray" >
78+ <font-awesome-icon :icon =" ['fab', 'spotify']" class =" w-4 h-4 mr-0.5 " />
7979 <div v-if =" spotify" >
8080 i'm currently listening to
81- <a
82- :href =" `https://open.spotify.com/track/${spotify.track_id}`"
83- target =" _blank"
84- class =" font-black underline"
85- >{{ spotify.song }} - {{ spotify.artist }}</a
86- >.
81+ <a :href =" `https://open.spotify.com/track/${spotify.track_id}`" target =" _blank" class =" font-black underline" >{{
82+ spotify.song }} - {{ spotify.artist }}</a >.
8783 </div >
8884 <div v-else >i'm not listening to anything right now.</div >
8985 </div >
86+ <div class =" flex items-center gap-2 text-sm text-gruvbox-gray" >
87+ <font-awesome-icon :icon =" ['fas', 'code']" class =" w-4 h-4 mr-0.5" />
88+ <div v-if =" vscode" >
89+ i'm currently working on
90+ <span class =" font-black" >{{ vscode.details }}</span >
91+ <span v-if =" vscode.state" > in <span class =" font-black" >{{ vscode.state }}</span ></span >
92+ </div >
93+ <div v-else >i'm not working on anything right now.</div >
94+ </div >
9095 <div class =" flex gap-10 mt-5 text-xl" >
91- <a href =" https://github.com/lareii/" target =" _blank"
92- ><font-awesome-icon :icon =" ['fab', 'github']"
93- /></a >
94- <a href =" https://www.linkedin.com/in/larei/" target =" _blank"
95- ><font-awesome-icon :icon =" ['fab', 'linkedin']"
96- /></a >
97- <a href =" https://discord.gg/taMRRAHb6y" target =" _blank"
98- ><font-awesome-icon :icon =" ['fab', 'discord']"
99- /></a >
100- <a href =" https://mastodon.com.tr/@larei" target =" _blank" rel =" me"
101- ><font-awesome-icon :icon =" ['fab', 'mastodon']"
102- /></a >
96+ <a href =" https://github.com/lareii/" target =" _blank" ><font-awesome-icon :icon =" ['fab', 'github']" /></a >
97+ <a href =" https://www.linkedin.com/in/larei/" target =" _blank" ><font-awesome-icon :icon =" ['fab', 'linkedin']" /></a >
98+ <a href =" https://discord.gg/taMRRAHb6y" target =" _blank" ><font-awesome-icon :icon =" ['fab', 'discord']" /></a >
99+ <a href =" https://mastodon.com.tr/@larei" target =" _blank" rel =" me" ><font-awesome-icon
100+ :icon =" ['fab', 'mastodon']" /></a >
103101 </div >
104102</template >
0 commit comments