Skip to content

Instantly share code, notes, and snippets.

{
"script": {
"main": "src/js/script.js",
"es5": "assets/js/script.js",
"es6": "assets/js/script-esm.js",
"deps": "src/js/dependencies/**/*.js",
"modules": "src/js/modules/**/*.js",
"dest": "assets/js/"
},
"style": {
@thisanimus
thisanimus / AnchorScroll.js
Created September 21, 2020 13:40
Anchor Scroll
class AnchorScroll{
constructor(link){
this.link = link;
this.linkHref = this.link.getAttribute('href');
this.target = document.querySelector(linkHref);
this.init();
}
init(){
link.addEventListener('click', (e) => {
e.preventDefault();
@thisanimus
thisanimus / main.tsx
Created August 3, 2023 14:09
Vite File-based Routing
import React from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider } from 'react-router-dom';
import router from './router';
function App() {
return (
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
@thisanimus
thisanimus / Airtable.js
Created September 19, 2023 22:09
Recursive Fetch via Airtable API
export default class Airtable {
constructor(token, base) {
this.token = token;
this.base = base;
this.baseUrl = 'https://api.airtable.com/v0';
this.tables = [];
this.tmp = [];
}
async get(table) {