This commit is contained in:
parent
45ad55b0c7
commit
30533d6899
9
package-lock.json
generated
9
package-lock.json
generated
@ -8,6 +8,7 @@
|
|||||||
"name": "svelte-app",
|
"name": "svelte-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"moment": "^2.29.4",
|
||||||
"sirv-cli": "^1.0.0"
|
"sirv-cli": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -1033,6 +1034,14 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/moment": {
|
||||||
|
"version": "2.29.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||||
|
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mri": {
|
"node_modules/mri": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz",
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
"typescript": "^4.0.0"
|
"typescript": "^4.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"moment": "^2.29.4",
|
||||||
"sirv-cli": "^1.0.0"
|
"sirv-cli": "^1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ const path = require("path");
|
|||||||
const { execSync } = require("child_process");
|
const { execSync } = require("child_process");
|
||||||
import commonjs from "@rollup/plugin-commonjs";
|
import commonjs from "@rollup/plugin-commonjs";
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
import resolve from "@rollup/plugin-node-resolve";
|
||||||
|
import moment from "moment/moment";
|
||||||
import css from "rollup-plugin-css-only";
|
import css from "rollup-plugin-css-only";
|
||||||
import livereload from "rollup-plugin-livereload";
|
import livereload from "rollup-plugin-livereload";
|
||||||
import svelte from "rollup-plugin-svelte";
|
import svelte from "rollup-plugin-svelte";
|
||||||
@ -22,8 +23,7 @@ fs.writeFileSync(
|
|||||||
"build-info.js",
|
"build-info.js",
|
||||||
"export default " +
|
"export default " +
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
buildDate:
|
buildDate: moment().format("MMMM Do YYYY, h:mm:ss a"),
|
||||||
new Date().toISOString().substr(0, 19).replace("T", " ") + " UTC",
|
|
||||||
buildVersion,
|
buildVersion,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
import { setContext } from 'svelte';
|
import { setContext } from 'svelte';
|
||||||
import { Route, Router, navigate } from "svelte-routing";
|
import { Route, Router, navigate } from "svelte-routing";
|
||||||
import buildInfo from '../build-info';
|
import buildInfo from '../build-info';
|
||||||
@ -15,12 +16,14 @@
|
|||||||
import TwitchPage from './pages/Twitch.svelte';
|
import TwitchPage from './pages/Twitch.svelte';
|
||||||
import createContainerStore from './stores/container';
|
import createContainerStore from './stores/container';
|
||||||
|
|
||||||
|
// When SSR was built (eg: 1 hour ago)
|
||||||
|
export const buildDateAgo = moment(buildInfo.buildDate, "MMMM Do YYYY, h:mm:ss a").fromNow();
|
||||||
|
|
||||||
export let url = "";
|
export let url = "";
|
||||||
|
|
||||||
let mainEl = null;
|
let mainEl = null;
|
||||||
|
|
||||||
const containerStore = createContainerStore();
|
const containerStore = createContainerStore();
|
||||||
|
|
||||||
setContext('pageContainer', containerStore);
|
setContext('pageContainer', containerStore);
|
||||||
|
|
||||||
$: if (mainEl) containerStore.observe(mainEl)
|
$: if (mainEl) containerStore.observe(mainEl)
|
||||||
@ -53,7 +56,7 @@
|
|||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>ScoreSaber Reloaded by <a href="https://git.fascinated.cc/Fascinated/scoresaber-reloaded">Fascinated & motzel</a></p>
|
<p>ScoreSaber Reloaded by <a href="https://git.fascinated.cc/Fascinated/scoresaber-reloaded">Fascinated & motzel</a></p>
|
||||||
<p class="build">Build: {buildInfo.buildVersion} ({buildInfo.buildDate})</p>
|
<p class="build" title="{buildDateAgo}">Build: {buildInfo.buildVersion} ({buildInfo.buildDate})</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="/privacy" on:click|preventDefault={() => navigate('/privacy')}>Privacy policy</a> |
|
<a href="/privacy" on:click|preventDefault={() => navigate('/privacy')}>Privacy policy</a> |
|
||||||
<a href="/credits" on:click|preventDefault={() => navigate('/credits')}>Credits</a>
|
<a href="/credits" on:click|preventDefault={() => navigate('/credits')}>Credits</a>
|
||||||
|
@ -611,6 +611,11 @@ minimist@^1.2.5:
|
|||||||
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
|
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz"
|
||||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||||
|
|
||||||
|
moment@^2.29.4:
|
||||||
|
version "2.29.4"
|
||||||
|
resolved "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz"
|
||||||
|
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
|
||||||
|
|
||||||
mri@^1.1.0:
|
mri@^1.1.0:
|
||||||
version "1.1.6"
|
version "1.1.6"
|
||||||
resolved "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz"
|
resolved "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz"
|
||||||
|
Reference in New Issue
Block a user