This file contains hidden or 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> | |
<div id="spectrum"> | |
<canvas ref="canvas"></canvas> | |
</div> | |
</template> | |
<script> | |
import paper from 'paper' | |
export default { |
This file contains hidden or 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 { IamTokenManager } = require('ibm-watson/auth') | |
const sttAuthenticator = new IamTokenManager({ | |
apikey: process.env.SPEECH_TO_TEXT_IAM_APIKEY | |
}) | |
const handler = async (event) => { | |
try { | |
let { result } = await sttAuthenticator.requestToken() | |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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(); |