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 getTweenTimes = ( | |
totalStart: number, | |
totalEnd: number, | |
partialStart: number, | |
partialEnd: number | |
) => { | |
const start = (totalEnd - totalStart) * (partialStart / 100) + totalStart | |
const end = Math.min( | |
(totalEnd - totalStart) * (partialEnd / 100) + totalStart, | |
100 |
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
import React, { useEffect } from 'react' | |
export const AdsScript = () => { | |
if (window?.adsbygoogle?.loaded) return '' | |
return ( | |
<> | |
<script | |
data-ad-client="ca-pub-5511922838842099" | |
async |
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
import { useState, createContext, useEffect } from 'react' | |
import firebase from 'firebase/app' | |
import 'firebase/auth' | |
import 'firebase/firestore' | |
import 'firebase/storage' | |
import 'firebase/analytics' | |
// Put your credentials | |
import clientCredentials from '../credentials/client' |
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
// A "casual" uid generator. | |
// The magic here is done in .toString(36), that converts an integer into a 12 digit string. | |
function getRandomString(length = 7) { | |
return Math.random().toString(36).substr(2, length) // Remove first two characters because one includes a dot | |
} | |
function casualUid(length = 7, result = getRandomString(length)): string { | |
if (length > 200) throw 'Max length is 200' | |
if (result.length < length) { |