This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const data = require('./track.json') | |
let duration = data.track.duration | |
let segments = data.segments.map(segment => { | |
return { | |
start: segment.start / duration, | |
duration: segment.duration / duration, | |
loudness: 1 - (Math.min(Math.max(segment.loudness_max, -35), 0) / -35) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "", | |
"artist_id": "", | |
"datetime": "", | |
"description": "", | |
"venue": { | |
"id": "", | |
"name": "", | |
"latitude": "", | |
"longitude": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
beforeEnter(el) { | |
el.style.cssText = "clip-path: inset(0 0 100% 0)" | |
}, | |
enter(el, done) { | |
let scan = { percent: 100 } | |
anime({ | |
targets: scan, | |
percent: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<p><span class="start">{{ start }}</span><span class="end">{{ end }}</span></p> | |
</template> | |
<script> | |
export default{ | |
props: { | |
phrase: { | |
type: String, | |
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<time>{{ remaining }}</time> | |
</template> | |
<script> | |
import { DateTime, Duration } from 'luxon' | |
export default{ | |
data() { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let msToTime = (milliseconds) => { | |
let ms = milliseconds % 1000 | |
let s = (milliseconds - ms) / 1000 | |
let secs = s % 60 | |
if (secs < 10) { | |
secs = `0${secs}` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
exports.handler = async (event, context) => { | |
try{ | |
const latitude = event.queryStringParameters.latitude; | |
const longitude = event.queryStringParameters.longitude; | |
const response = await fetch(`https://api.darksky.net/forecast/${process.env.DARK_SKY_KEY}/${latitude},${longitude}`); | |
const data = await response.json(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk') | |
const s3 = new AWS.S3({ | |
accessKeyId: process.env.AWS_KEY, | |
secretAccessKey: process.env.AWS_SECRET, | |
useAccelerateEndpoint: true | |
}) | |
const getSignedUrlPromise = (operation, params) => { | |
return new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<canvas ref="canvas"></canvas> | |
</template> | |
<script> | |
export default{ | |
methods: { | |
generateNoise() { | |
this.noise = document.createElement('canvas') | |
this.noise.height = window.innerHeight * 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios') | |
let CLIENT_ID="YOUR_CLIENT_ID" | |
let CLIENT_SECRET="YOUR_CLIENT_SECRET" | |
let auth = Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64') | |
axios({ | |
method: 'post', | |
url: 'https://accounts.spotify.com/api/token', |