Skip to content

Instantly share code, notes, and snippets.

freq = 1;
amp = 110;
loopTime = 3;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)
// importing data
import { onMount } from 'svelte';
onMount(async() => {
const res = await fetch(`/tutorial/api/album`);
photos = await res.json();
console.log(photos)
})
import Navbar from '../components/navbar.components'
import Head from 'next/head'
import topstory from "../styles/topstory.module.scss"
import Link from 'next/link'
import LocationOnIcon from '@mui/icons-material/LocationOn';
export default function Home({story}) {
console.log(story.data)
return (
@kklai
kklai / index.html
Last active March 10, 2021 10:16
sn code block
<style>
.g-body {
max-width: 1200px;
margin: 0 auto;
padding: 0;
width: 100%;
font-family: droid sans, helvetica neue, Helvetica, Arial, sans-serif;
color: #444;
}
.g-kicker {
// reference: https://www.adobe.com/content/dam/acom/en/devnet/illustrator/pdf/Illustrator_Scriptin_Reference_JavaScript_cc.pdf
var doc = app.activeDocument;
var docPath = doc.path;
### Keybase proof
I hereby claim:
* I am kklai on github.
* I am kklai (https://keybase.io/kklai) on keybase.
* I have a public key ASA0D0z-ndlVlS4Sgxfa-zJewQumlo2sLXR-hfvQq2VUdQo
To claim this, I am signing this object:
// helper functions
var getJSON = function (nameOfFile) {
var dataFile = File(docPath + '/' + nameOfFile + ".json");
dataFile.open();
data = dataFile.read();
data = eval(data);
dataFile.close();
return data;
};
@kklai
kklai / html
Created February 10, 2016 20:12
<html>
<head>
<title></title>
<style type="text/css">
body {
padding: 25%;
}
</style>
</head>
<body>
@kklai
kklai / html
Last active February 10, 2016 21:27
<html>
<head>
<title></title>
<style type="text/css">
body {
padding: 25%;
}
</style>
</head>
<body>
@kklai
kklai / gist:d68003b693fdc1ed0499
Created September 10, 2014 22:58
Update page url on click
<html>
<head>
<title></title>
</head>
<body>
<button class="intro" data-attr="intro">INTRO</button>
<button class="second-story" data-attr="second-story">SECOND STORY</button>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$("button").on("click", function(){