mirror of
https://github.com/turbomaster95/coderrrrr.git
synced 2025-08-01 18:22:25 +00:00
Compare commits
3 Commits
faaef129e8
...
a7506d98c2
Author | SHA1 | Date | |
---|---|---|---|
a7506d98c2 | |||
dbda7b4d3f | |||
b5aa94309b |
@ -1,6 +1,6 @@
|
|||||||
import { Handler } from '@netlify/functions';
|
import { Handler } from '@netlify/functions';
|
||||||
import { firestore } from '../../../lib/firebase';
|
import { firestore } from '../../../lib/firebase';
|
||||||
import { fetchActorInformation } from '../../../lib/activitypub/utils/fetchActorInformation';
|
import { fetchActorInformation } from '../../../lib/activitypub/utils/fetchActorInformation.ts';
|
||||||
|
|
||||||
const handler: Handler = async (event, context) => {
|
const handler: Handler = async (event, context) => {
|
||||||
const [, , username] = event.path.split('/'); // /users/:username/followers
|
const [, , username] = event.path.split('/'); // /users/:username/followers
|
@ -17,7 +17,6 @@
|
|||||||
<link href="https://coder.is-a.dev/@blog" rel="alternate" type="application/activity+json">
|
<link href="https://coder.is-a.dev/@blog" rel="alternate" type="application/activity+json">
|
||||||
<link rel="webfinger" href="https://coder.is-a.dev/.well-known/webfinger">
|
<link rel="webfinger" href="https://coder.is-a.dev/.well-known/webfinger">
|
||||||
<link href="indeedlayout.css" rel="stylesheet" type="text/css" media="all">
|
<link href="indeedlayout.css" rel="stylesheet" type="text/css" media="all">
|
||||||
<script href="/swatch.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +45,6 @@
|
|||||||
<!--put a short bit about yourself or your site in this div; if it's outside a div it'll look a little weird.-->
|
<!--put a short bit about yourself or your site in this div; if it's outside a div it'll look a little weird.-->
|
||||||
<div>
|
<div>
|
||||||
<p>Deva, 19, he/him. India-based programmer & indie web enthusiast; likes building random things!</p>
|
<p>Deva, 19, he/him. India-based programmer & indie web enthusiast; likes building random things!</p>
|
||||||
<span id="swatchClock">@unkown</span>
|
|
||||||
</div>
|
</div>
|
||||||
<!--end of text div-->
|
<!--end of text div-->
|
||||||
|
|
||||||
|
11
lib/firebase.ts
Normal file
11
lib/firebase.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// lib/firebase.ts
|
||||||
|
import { initializeApp, cert } from "firebase-admin/app";
|
||||||
|
import { getFirestore } from "firebase-admin/firestore";
|
||||||
|
|
||||||
|
const serviceAccount = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT_KEY!);
|
||||||
|
|
||||||
|
const app = initializeApp({
|
||||||
|
credential: cert(serviceAccount),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const firestore = getFirestore(app);
|
37
swatch.js
37
swatch.js
@ -1,37 +0,0 @@
|
|||||||
// https://melonking.net - Swatch Clock! v2
|
|
||||||
// The script displays a live Swatch Internet Time clock on your website!
|
|
||||||
// For more info on swatch time visit https://wiki.melonland.net/swatch_time
|
|
||||||
//
|
|
||||||
// How to this script; just paste this onto your site where ever you want the clock to show:
|
|
||||||
// <span id="swatchClock">@000</span>
|
|
||||||
// OR if you dont want the info link
|
|
||||||
// <span id="swatchClock-nolink">@000</span>
|
|
||||||
// <script defer src="https://melonking.net/scripts/swatchTime.js"></script>
|
|
||||||
|
|
||||||
var swatchClock = document.getElementById("swatchClock");
|
|
||||||
var swatchClockNoLink = document.getElementById("swatchClock-nolink");
|
|
||||||
function updateSwatchClock() {
|
|
||||||
if (swatchClock != null) swatchClock.innerHTML = '<a style="color:red" href="https://wiki.melonland.net/swatch_time" target="_blank">@' + GetSwatchTime() + "</a>";
|
|
||||||
if (swatchClockNoLink != null) swatchClockNoLink.innerHTML = "@" + GetSwatchTime();
|
|
||||||
}
|
|
||||||
setInterval(updateSwatchClock, 864);
|
|
||||||
function GetSwatchTime(showDecimals = true) {
|
|
||||||
// get date in UTC/GMT
|
|
||||||
var date = new Date();
|
|
||||||
var hours = date.getUTCHours();
|
|
||||||
var minutes = date.getUTCMinutes();
|
|
||||||
var seconds = date.getUTCSeconds();
|
|
||||||
var milliseconds = date.getUTCMilliseconds();
|
|
||||||
// add hour to get time in Switzerland
|
|
||||||
hours = hours == 23 ? 0 : hours + 1;
|
|
||||||
// time in seconds
|
|
||||||
var timeInMilliseconds = ((hours * 60 + minutes) * 60 + seconds) * 1000 + milliseconds;
|
|
||||||
// there are 86.4 seconds in a beat
|
|
||||||
var millisecondsInABeat = 86400;
|
|
||||||
// calculate beats to two decimal places
|
|
||||||
if (showDecimals) {
|
|
||||||
return Math.abs(timeInMilliseconds / millisecondsInABeat).toFixed(2);
|
|
||||||
} else {
|
|
||||||
return Math.floor(Math.abs(timeInMilliseconds / millisecondsInABeat));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user