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> | |
<div class="h-full rounded-full w-full" :style="conicGradient"></div> | |
</template> | |
<script setup> | |
// Props | |
const props = defineProps({ | |
color: { | |
type: String, | |
default: '#000000' |
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> | |
<Transition :css="false" @before-enter="onBeforeEnter" @enter="onEnter" @before-leave="onBeforeLeave" @leave="onLeave" mode="out-in"> | |
<slot></slot> | |
</Transition> | |
</template> | |
<script> | |
import gsap from 'gsap' | |
export default { |
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
<template> | |
<div id="marquee"> | |
<div class="inner"> | |
<div class="message">{{ message }}</div> | |
<div class="message">{{ message }}</div> | |
</div> | |
</div> | |
</template> | |
<script setup> |
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> | |
<Transition :css="false" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" mode="out-in"> | |
<slot></slot> | |
</Transition> | |
</template> | |
<script> | |
import gsap from 'gsap' | |
export default { |
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
"use strict"; | |
const fs = require("fs"); | |
const jwt = require("jsonwebtoken"); | |
const privateKey = fs.readFileSync("AuthKey.p8").toString(); | |
const teamId = "ABCDE12345"; | |
const keyId = "ABCDE12345"; | |
const jwtToken = jwt.sign({}, privateKey, { |
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
// Require file system module | |
const fs = require("fs") | |
// Read private key from file | |
const privateKey = fs.readFileSync("AuthKey_0000000000.p8").toString() | |
// Encode private key into Base64 string | |
const buff = Buffer.from(privateKey).toString('base64') |
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") | |
const jwt = require("jsonwebtoken") | |
const handler = async (event) => { | |
try { | |
// Decode private key | |
const privateKey = Buffer.from(process.env.WEATHERKIT_KEY, 'base64').toString() | |
// Get team, key, and app id | |
const teamId = process.env.WEATHERKIT_TEAM_ID |
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 desaturate = (canvas) => { | |
// Get canvas image data | |
let imageData = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height) | |
// Get all pixels | |
let pixels = imageData.data | |
// Loop through pixels | |
for (let i = 0; i < pixels.length; i += 4) { | |
// Adjust lightness |
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> | |
<div id="spectrum"> | |
<canvas ref="canvas"></canvas> | |
</div> | |
</template> | |
<script> | |
import paper from 'paper' | |
export default { |
NewerOlder