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
<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
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
// 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
<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
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 { |
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 { 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() | |
NewerOlder