Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7d28c90
Traduzione testo per "nessuna traccia in riproduzione!
KSuondProject Aug 24, 2022
7b7be73
Update NowPlaying.vue
KSuondProject Aug 24, 2022
10a6e46
Update NowPlaying.vue
KSuondProject Aug 24, 2022
dc222e1
Update NowPlaying.vue
KSuondProject Aug 24, 2022
c4d498e
Update NowPlaying.vue
KSuondProject Aug 24, 2022
a5f23cd
Update NowPlaying.vue
KSuondProject Aug 24, 2022
b3ff6e1
Update NowPlaying.vue
KSuondProject Aug 24, 2022
9fd3d45
Update NowPlaying.vue
KSuondProject Aug 24, 2022
0fa4092
Update NowPlaying.vue
KSuondProject Aug 24, 2022
e4ad2d5
Update NowPlaying.vue
KSuondProject Aug 24, 2022
088d7b2
Update NowPlaying.vue
KSuondProject Aug 24, 2022
23da1b1
Update NowPlaying.vue
KSuondProject Aug 24, 2022
0c9fd0c
Update NowPlaying.vue
KSuondProject Aug 24, 2022
7d7beaf
Update NowPlaying.vue
KSuondProject Aug 25, 2022
2f12db1
Update NowPlaying.vue
KSuondProject Aug 25, 2022
3c36348
Update NowPlaying.vue
KSuondProject Aug 25, 2022
f91c9d4
Update NowPlaying.vue
KSuondProject Aug 25, 2022
88e9f4b
Update NowPlaying.vue
KSuondProject Aug 25, 2022
009225a
Update typography.scss
KSuondProject Aug 25, 2022
d20d9f2
Update Authorise.vue
KSuondProject Aug 25, 2022
30f9b71
Update Authorise.vue
KSuondProject Aug 25, 2022
daca5c0
Update NowPlaying.vue
KSuondProject Aug 25, 2022
60ce238
Update NowPlaying.vue
KSuondProject Aug 25, 2022
3b95bdd
Update typography.scss
KSuondProject Aug 25, 2022
f92f5cd
Update now-playing.scss
KSuondProject Aug 25, 2022
f513aae
Update NowPlaying.vue
KSuondProject Aug 25, 2022
e87d014
Update NowPlaying.vue
KSuondProject Aug 26, 2022
1994fb8
Update NowPlaying.vue
KSuondProject Aug 26, 2022
ce3d2ee
Update NowPlaying.vue
KSuondProject Aug 26, 2022
1347a90
Update NowPlaying.vue
KSuondProject Aug 26, 2022
bbf2740
Update NowPlaying.vue
KSuondProject Aug 26, 2022
a9d69bd
Update NowPlaying.vue
KSuondProject Aug 30, 2022
d73f87f
Update NowPlaying.vue
KSuondProject Aug 30, 2022
9922bcc
Update NowPlaying.vue
KSuondProject Aug 30, 2022
69a038e
Update NowPlaying.vue
KSuondProject Aug 30, 2022
852fe8e
Update NowPlaying.vue
KSuondProject Aug 30, 2022
713b6c4
Update NowPlaying.vue
KSuondProject Aug 30, 2022
f9dc539
Update NowPlaying.vue
KSuondProject Aug 30, 2022
2c97dad
Update NowPlaying.vue
KSuondProject Nov 29, 2023
fcdf837
Update NowPlaying.vue
KSuondProject Nov 29, 2023
c95c090
Update now-playing.scss
KSuondProject Nov 29, 2023
7cea31d
Update now-playing.scss
KSuondProject Nov 29, 2023
88ea326
Update NowPlaying.vue
KSuondProject Nov 29, 2023
0681f97
Update NowPlaying.vue
KSuondProject Nov 29, 2023
cf457eb
Update NowPlaying.vue
KSuondProject Nov 29, 2023
dcf3a95
Update NowPlaying.vue
KSuondProject Nov 29, 2023
b663dcb
Update NowPlaying.vue
KSuondProject Nov 29, 2023
656d49b
Update NowPlaying.vue
KSuondProject Nov 29, 2023
c3bda70
Update NowPlaying.vue
KSuondProject Nov 29, 2023
5ee476f
Update typography.scss
KSuondProject Nov 29, 2023
a24997d
Update NowPlaying.vue
KSuondProject Nov 29, 2023
87a9667
Update NowPlaying.vue
KSuondProject Nov 29, 2023
a2a5a73
Update NowPlaying.vue
KSuondProject Nov 29, 2023
4baf94b
Update NowPlaying.vue
KSuondProject Nov 29, 2023
437b02d
Update NowPlaying.vue
KSuondProject Nov 29, 2023
5211617
Update NowPlaying.vue
KSuondProject Nov 29, 2023
e4479c6
Update NowPlaying.vue
KSuondProject Nov 29, 2023
42cd6c9
Update NowPlaying.vue
KSuondProject Nov 29, 2023
21303d1
Update now-playing.scss
KSuondProject Nov 29, 2023
3ba5615
Update NowPlaying.vue
KSuondProject Nov 29, 2023
19b89e1
Update NowPlaying.vue
KSuondProject Nov 29, 2023
9896b86
Update NowPlaying.vue
KSuondProject Nov 29, 2023
e659bd8
Update NowPlaying.vue
KSuondProject Nov 29, 2023
84ea70f
Update NowPlaying.vue
KSuondProject Nov 29, 2023
e2d2356
Update NowPlaying.vue
KSuondProject Nov 29, 2023
2b3842a
Update NowPlaying.vue
KSuondProject Nov 29, 2023
89d09d1
Update NowPlaying.vue
KSuondProject Nov 29, 2023
2d5ba03
Update NowPlaying.vue
KSuondProject Nov 29, 2023
e7c834c
Update NowPlaying.vue
KSuondProject Nov 29, 2023
0c0e4cd
Update NowPlaying.vue
KSuondProject Nov 29, 2023
7890f82
Update NowPlaying.vue
KSuondProject Nov 29, 2023
f8babb2
Update NowPlaying.vue
KSuondProject Nov 29, 2023
b3aa8ac
Update typography.scss
KSuondProject Nov 29, 2023
69bedc6
Update NowPlaying.vue
KSuondProject Nov 29, 2023
f49bd4f
Update typography.scss
KSuondProject Nov 29, 2023
d32ece1
Update typography.scss
KSuondProject Nov 29, 2023
20d4490
Update Authorise.vue
KSuondProject Nov 13, 2024
dd6c842
Update Authorise.vue
KSuondProject Nov 14, 2024
a0ec989
Update Authorise.vue
KSuondProject Nov 14, 2024
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
12 changes: 6 additions & 6 deletions src/components/Authorise.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<template>
<div class="authorise">
<h1 class="authorise__heading">Nowify</h1>
<h1 class="authorise__heading">Krokify Pro</h1>

<p class="authorise__copy">
Nowify is a simple Spotify 'Now Playing' screen designed for the Raspberry
Pi. Login with Spotify below and start playing some music!
Loggati, al resto ci penso io :)
</p>

<button
Expand All @@ -15,7 +14,7 @@
</button>

<p class="authorise__credit">
<a href="https://github.com/jonashcroft/Nowify">View on GitHub</a>
<a href="https://github.com/jonashcroft/Nowify">Onore al creatore</a>
</p>
</div>
</template>
Expand All @@ -39,7 +38,6 @@ export default {
data() {
return {}
},

computed: {},

mounted() {
Expand All @@ -62,6 +60,8 @@ export default {
* Spotify to grant app consent, user will
* be redirected back to the app.
*/


initAuthorise() {
this.setAuthUrl()
window.location.href = `${this.endpoints.auth}?${searchParams.toString()}`
Expand Down Expand Up @@ -204,7 +204,7 @@ export default {
return `${this.endpoints.auth}?${searchParams.toString()}`
}
},

watch: {
/**
* Watch authorisation code.
Expand Down
32 changes: 28 additions & 4 deletions src/components/NowPlaying.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
<div class="now-playing__details">
<h1 class="now-playing__track" v-text="player.trackTitle"></h1>
<h2 class="now-playing__artists" v-text="getTrackArtists"></h2>
<h3 class="now-playing__album" v-text="player.trackAlbumName"></h3>
<h3 class="now-playing__year" v-text="player.trackYear"></h3>
</div>
</div>
<div v-else class="now-playing" :class="getNowPlayingClass()">
<h1 class="now-playing__idle-heading">No music is playing 😔</h1>
<font size="55"> <h4 class="now-playing__idle-heading"> {{ currentTime }} </h4></font>
<h1 class="now-playing__idle-heading"> {{ currentDate }}</h1>
</div>
</div>
</template>

<script>

import * as Vibrant from 'node-vibrant'

import props from '@/utils/props.js'
Expand All @@ -43,7 +47,9 @@ export default {
playerResponse: {},
playerData: this.getEmptyPlayer(),
colourPalette: '',
swatches: []
swatches: [],
currentDate: '',
currentTime: ''
}
},

Expand All @@ -58,7 +64,9 @@ export default {
},

mounted() {
this.setDataInterval()
this.setDataInterval();
this.updateDatetime();
setInterval(this.updateDatetime, 1000);
},

beforeDestroy() {
Expand All @@ -70,6 +78,18 @@ export default {
* Make the network request to Spotify to
* get the current played track.
*/

updateDatetime() {
// Get the current date and time
const now = new Date();
// Format the date and time
const formattedDate = now.toLocaleString('it-IT', {timeZone: 'CET', weekday: 'long', month: 'long', day: 'numeric'});
const formattedTime = now.toLocaleTimeString('it-IT', { hour: "2-digit", minute: "2-digit" });
// Update the currentDatetime property
this.currentDate = formattedDate;
this.currentTime = formattedTime
},

async getNowPlaying() {
let data = {}

Expand Down Expand Up @@ -161,7 +181,9 @@ export default {
trackAlbum: {},
trackArtists: [],
trackId: '',
trackTitle: ''
trackTitle: '',
trackYear: '',
trackAlbumName: ''
}
},

Expand Down Expand Up @@ -230,6 +252,8 @@ export default {
),
trackTitle: this.playerResponse.item.name,
trackId: this.playerResponse.item.id,
trackYear: this.playerResponse.item.album.release_date.substring(0,4),
trackAlbumName: this.playerResponse.item.album.name,
trackAlbum: {
title: this.playerResponse.item.album.name,
image: this.playerResponse.item.album.images[0].url
Expand Down
5 changes: 2 additions & 3 deletions src/styles/components/now-playing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

&__artists {
opacity: 0.8;
opacity: 0.85;
}

&--active {
Expand All @@ -50,7 +50,6 @@

&--idle {
display: flex;
align-items: center;
justify-content: center;
}

Expand All @@ -68,4 +67,4 @@
text-align: left;
}
}
}
}
21 changes: 18 additions & 3 deletions src/styles/global/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,37 @@
* -----------------------------------------------------------------------------
*/
h1 {
font-size: 2em;
font-size: 2.5em;
font-weight: var(--font-weight-heading);
letter-spacing: -1.25px;
margin: 0 0 var(--spacing-m) 0;
word-break: break-word;
}

h2 {
font-size: 2em;
font-weight: var(--font-weight-body);
letter-spacing: -0.5px;
margin: 0;
word-break: break-word;
}

h3 {
font-size: 1.5em;
font-weight: var(--font-weight-body);
letter-spacing: -0.5px;
margin: 0;
word-break: break-word;
}

h4 {
font-size: 3em;
font-weight: var(--font-weight-heading);
letter-spacing: -1.5px;
margin: 0 0 var(--spacing-m) 0;
}

p {
font-size: 1.2em;
font-size: 2em;
line-height: 1.4;
}
}