deps: Add script to make manually vendoring dependencies not so manual (#34)

This commit is contained in:
Tyler Wilding 2022-02-06 22:19:27 -05:00 committed by GitHub
parent 32e596a5a6
commit e33d3da118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 533 additions and 136 deletions

12
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every month
interval: "monthly"
- package-ecosystem: "npm"
directory: "/"
schedule:
# Reminder for manually vendored dependencies
interval: "weekly"

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.hugo_build.lock
resources/
public/
node_modules/

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021 PCSX2
Copyright (c) 2021 PCSX2 Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -4,3 +4,6 @@ tasks:
new-article:
cmds:
- python ./scripts/make-new-article.py
vendor-deps:
cmds:
- python ./scripts/vendor-deps.py

93
deps-info.json Normal file
View file

@ -0,0 +1,93 @@
{
"dot": {
"pinnedVersion": "1.1.3",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/dot",
"baseUrlToFetch": "https://unpkg.com/dot",
"filesToVendor": ["doT.min.js"],
"deferredLoad": true
}
},
"fuse.js": {
"pinnedVersion": "6.5.3",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/fuse.js",
"baseUrlToFetch": "https://unpkg.com/fuse.js",
"filesToVendor": ["dist/fuse.min.js"],
"deferredLoad": true
}
},
"jquery": {
"pinnedVersion": "3.6.0",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/jquery",
"baseUrlToFetch": "https://unpkg.com/jquery",
"filesToVendor": ["dist/jquery.min.js"],
"deferredLoad": true
}
},
"marked": {
"pinnedVersion": "4.0.12",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/marked",
"baseUrlToFetch": "https://unpkg.com/marked",
"filesToVendor": ["marked.min.js"],
"deferredLoad": true
}
},
"mdb-ui-kit": {
"pinnedVersion": "3.10.2",
"css": {
"directoryToSave": "./themes/pcsx2/static/css/vendor/mdb-ui-kit",
"baseUrlToFetch": "https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit",
"filesToVendor": ["mdb.min.css"]
},
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/mdb-ui-kit",
"baseUrlToFetch": "https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit",
"filesToVendor": ["mdb.min.js"],
"deferredLoad": true
}
},
"three": {
"pinnedVersion": "0.137.5",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/three",
"baseUrlToFetch": "https://unpkg.com/three",
"filesToVendor": ["build/three.min.js"],
"deferredLoad": true
}
},
"underscore": {
"pinnedVersion": "1.13.2",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/underscore",
"baseUrlToFetch": "https://unpkg.com/underscore",
"filesToVendor": ["underscore-min.js"],
"deferredLoad": true
}
},
"vanilla-lazyload": {
"pinnedVersion": "17.5.0",
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/vanilla-lazyload",
"baseUrlToFetch": "https://cdn.jsdelivr.net/npm/vanilla-lazyload",
"filesToVendor": ["dist/lazyload.min.js"]
}
},
"cookieconsent": {
"pinnedVersion": "3.1.1",
"css": {
"directoryToSave": "./themes/pcsx2/static/css/vendor/cookieconsent",
"baseUrlToFetch": "https://cdn.jsdelivr.net/npm/cookieconsent",
"filesToVendor": ["build/cookieconsent.min.css"]
},
"js": {
"directoryToSave": "./themes/pcsx2/static/js/vendor/cookieconsent",
"baseUrlToFetch": "https://cdn.jsdelivr.net/npm/cookieconsent",
"filesToVendor": ["build/cookieconsent.min.js"],
"deferredLoad": true,
"additionalAttributes": ["data-cfasync=\"false\""]
}
}
}

149
package-lock.json generated Normal file
View file

@ -0,0 +1,149 @@
{
"name": "pcsx2-net-www",
"version": "0.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"cookieconsent": "3.1.1",
"dot": "1.1.3",
"fuse.js": "^6.5.3",
"jquery": "3.6.0",
"marked": "4.0.12",
"mdb-ui-kit": "3.10.2",
"three": "0.137.5",
"underscore": "1.13.2",
"vanilla-lazyload": "17.5.0"
},
"devDependencies": {
"dat.gui": "0.7.7"
}
},
"node_modules/cookieconsent": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/cookieconsent/-/cookieconsent-3.1.1.tgz",
"integrity": "sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag=="
},
"node_modules/dat.gui": {
"version": "0.7.7",
"resolved": "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.7.tgz",
"integrity": "sha512-sRl/28gF/XRC5ywC9I4zriATTsQcpSsRG7seXCPnTkK8/EQMIbCu5NPMpICLGxX9ZEUvcXR3ArLYCtgreFoMDw==",
"dev": true
},
"node_modules/dot": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/dot/-/dot-1.1.3.tgz",
"integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg==",
"engines": [
"node >=0.2.6"
],
"bin": {
"dottojs": "bin/dot-packer"
}
},
"node_modules/fuse.js": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.5.3.tgz",
"integrity": "sha512-sA5etGE7yD/pOqivZRBvUBd/NaL2sjAu6QuSaFoe1H2BrJSkH/T/UXAJ8CdXdw7DvY3Hs8CXKYkDWX7RiP5KOg==",
"engines": {
"node": ">=10"
}
},
"node_modules/jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
},
"node_modules/marked": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz",
"integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ==",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 12"
}
},
"node_modules/mdb-ui-kit": {
"version": "3.10.2",
"resolved": "https://registry.npmjs.org/mdb-ui-kit/-/mdb-ui-kit-3.10.2.tgz",
"integrity": "sha512-XiLNyf0Z04CoyvfbG3bQBMsib+yIGYnEoWCbKUC+QcdbUe/mM7yqeIfekKMgGhBZ1mj7nDt1nIKODmAP7gJFFA=="
},
"node_modules/three": {
"version": "0.137.5",
"resolved": "https://registry.npmjs.org/three/-/three-0.137.5.tgz",
"integrity": "sha512-rTyr+HDFxjnN8+N/guZjDgfVxgHptZQpf6xfL/Mo7a5JYIFwK6tAq3bzxYYB4Ae0RosDZlDuP+X5aXDXz+XnHQ=="
},
"node_modules/underscore": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz",
"integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g=="
},
"node_modules/vanilla-lazyload": {
"version": "17.5.0",
"resolved": "https://registry.npmjs.org/vanilla-lazyload/-/vanilla-lazyload-17.5.0.tgz",
"integrity": "sha512-1d2kjFT2BTrA2ynBBbJ58kIZqtB6TxocAvUFwmzjJ34RqLDlVPy4VmBDuAi6xgv+3LSmP6coKstU2eeRdI+ixw==",
"funding": {
"type": "individual",
"url": "https://ko-fi.com/verlok"
}
}
},
"dependencies": {
"cookieconsent": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/cookieconsent/-/cookieconsent-3.1.1.tgz",
"integrity": "sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag=="
},
"dat.gui": {
"version": "0.7.7",
"resolved": "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.7.tgz",
"integrity": "sha512-sRl/28gF/XRC5ywC9I4zriATTsQcpSsRG7seXCPnTkK8/EQMIbCu5NPMpICLGxX9ZEUvcXR3ArLYCtgreFoMDw==",
"dev": true
},
"dot": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/dot/-/dot-1.1.3.tgz",
"integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg=="
},
"fuse.js": {
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.5.3.tgz",
"integrity": "sha512-sA5etGE7yD/pOqivZRBvUBd/NaL2sjAu6QuSaFoe1H2BrJSkH/T/UXAJ8CdXdw7DvY3Hs8CXKYkDWX7RiP5KOg=="
},
"jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
},
"marked": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.12.tgz",
"integrity": "sha512-hgibXWrEDNBWgGiK18j/4lkS6ihTe9sxtV4Q1OQppb/0zzyPSzoFANBa5MfsG/zgsWklmNnhm0XACZOH/0HBiQ=="
},
"mdb-ui-kit": {
"version": "3.10.2",
"resolved": "https://registry.npmjs.org/mdb-ui-kit/-/mdb-ui-kit-3.10.2.tgz",
"integrity": "sha512-XiLNyf0Z04CoyvfbG3bQBMsib+yIGYnEoWCbKUC+QcdbUe/mM7yqeIfekKMgGhBZ1mj7nDt1nIKODmAP7gJFFA=="
},
"three": {
"version": "0.137.5",
"resolved": "https://registry.npmjs.org/three/-/three-0.137.5.tgz",
"integrity": "sha512-rTyr+HDFxjnN8+N/guZjDgfVxgHptZQpf6xfL/Mo7a5JYIFwK6tAq3bzxYYB4Ae0RosDZlDuP+X5aXDXz+XnHQ=="
},
"underscore": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz",
"integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g=="
},
"vanilla-lazyload": {
"version": "17.5.0",
"resolved": "https://registry.npmjs.org/vanilla-lazyload/-/vanilla-lazyload-17.5.0.tgz",
"integrity": "sha512-1d2kjFT2BTrA2ynBBbJ58kIZqtB6TxocAvUFwmzjJ34RqLDlVPy4VmBDuAi6xgv+3LSmP6coKstU2eeRdI+ixw=="
}
}
}

24
package.json Normal file
View file

@ -0,0 +1,24 @@
{
"name": "pcsx2-net-www",
"version": "0.0.0",
"description": "THIS FILE IS ONLY TO LET GITHUB EASILY TRACK AND MONITOR OUR DEPENDENCIES AS THEY ARE VENDORED MANUALLY",
"repository": {
"type": "git",
"url": "git+https://github.com/PCSX2/pcsx2-net-www.git"
},
"license": "MIT",
"devDependencies": {
"dat.gui": "0.7.7"
},
"dependencies": {
"cookieconsent": "3.1.1",
"dot": "1.1.3",
"fuse.js": "6.5.3",
"jquery": "3.6.0",
"marked": "4.0.12",
"mdb-ui-kit": "3.10.2",
"three": "0.137.5",
"underscore": "1.13.2",
"vanilla-lazyload": "17.5.0"
}
}

100
scripts/vendor-deps.py Normal file
View file

@ -0,0 +1,100 @@
# Simple script to make manually vendoring frontend javascript and css dependencies not manual
# it will compare the versions in `package.json` (monitored by github / dependabot)
# with that in `deps-info.json`
#
# deps-info.json contains metadata for how to download the dependencies, which files to grab, and where to save them
#
# then the script will do a pass through all theme .html files and update the paths accordingly
# NOTE: this step assumes the base folder paths remain the same!
# TODO - detect if there are unstaged git changes and abort
# Compare versions
print("Checking for Dependency Mismatches...")
import json
with open('./package.json', 'r') as f:
npm_info = json.load(f)['dependencies']
with open('./deps-info.json', 'r') as f:
vendored_info = json.load(f)
should_exit = False
for npm_dep, npm_ver in npm_info.items():
if npm_ver != vendored_info[npm_dep]['pinnedVersion']:
print("MISMATCH FOUND: {}@{} != {}@{}".format(npm_dep, npm_ver, npm_dep, vendored_info[npm_dep]['pinnedVersion']))
should_exit = True
if should_exit:
exit(1)
print("Looks Good!...")
# Download and replace the vendored files
# TODO - currently fails fast
print("Vendoring Deps...")
import requests
import os
import shutil
# Clean vendor directories
if os.path.exists("./themes/pcsx2/static/js/vendor/"):
# clean directory
shutil.rmtree("./themes/pcsx2/static/js/vendor/")
os.makedirs("./themes/pcsx2/static/js/vendor/")
if os.path.exists("./themes/pcsx2/static/css/vendor/"):
# clean directory
shutil.rmtree("./themes/pcsx2/static/css/vendor/")
os.makedirs("./themes/pcsx2/static/css/vendor/")
def construct_url(base_url, version, file_name):
# Handle intricates between CDNs
if 'unpkg' in base_url or 'jsdelivr' in base_url:
return "{}@{}/{}".format(base_url, version, file_name)
if 'cdnjs.cloudflare' in base_url:
return "{}/{}/{}".format(base_url, version, file_name)
for dep, meta in vendored_info.items():
# TODO - error if 404
# javascript
if 'js' in meta:
# download the files into the new directory
for f in meta['js']['filesToVendor']:
r = requests.get(construct_url(meta['js']['baseUrlToFetch'], meta['pinnedVersion'], f))
save_path = "{}@{}/{}".format(meta['js']['directoryToSave'], meta['pinnedVersion'], os.path.basename(f))
os.makedirs(os.path.dirname(save_path))
with open(save_path, 'wb') as f:
f.write(r.content)
# css
if 'css' in meta:
# download the files into the new directory
for f in meta['css']['filesToVendor']:
r = requests.get(construct_url(meta['css']['baseUrlToFetch'], meta['pinnedVersion'], f))
save_path = "{}@{}/{}".format(meta['css']['directoryToSave'], meta['pinnedVersion'], os.path.basename(f))
os.makedirs(os.path.dirname(save_path))
with open(save_path, 'wb') as f:
f.write(r.content)
print("Vendoring Deps Complete!")
# Update all references in code
print("Updating Referenced Versions in HTML files...")
from pathlib import Path
import re
for path in Path('./themes/pcsx2').rglob('*.html'):
modified_lines = []
# read current lines
with open(path) as file:
lines = file.readlines()
# update lines
for line in lines:
line_to_append = line
for dep, meta in vendored_info.items():
if ('script' in line or '<link' in line) and 'vendor/{}'.format(dep) in line:
line_to_append = re.sub('@(\d+\.?)+', "@{}".format(meta['pinnedVersion']), line)
break
modified_lines.append(line_to_append)
# write the file
with open(path, 'r+') as f:
f.seek(0)
f.writelines(modified_lines)
f.truncate()
print("Updating Referenced Versions in HTML files completed!")

View file

@ -32,7 +32,9 @@
#splash-screen
grid-area: 1/1/1/1
background-image: url('#{$base-url}img/poor-perf-splash.webp')
background-repeat: no-repeat
background-size: cover
background-position: center
background: black;
&.slow-performance
background-image: url('#{$base-url}img/poor-perf-splash.webp')
background-repeat: no-repeat
background-size: cover
background-position: center

View file

@ -22,8 +22,12 @@
{{- partial "footer.html" . -}}
{{ end }}
</div>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.5.0/dist/lazyload.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<!-- javascript libraries that are used on every page -->
<script defer src="/js/vendor/mdb-ui-kit@3.10.2/mdb.min.js"></script>
<script defer src="/js/vendor/jquery@3.6.0/jquery.min.js"></script>
<script defer src="/js/theme.js"></script>
<script src="/js/vendor/vanilla-lazyload@17.5.0/lazyload.min.js"></script>
<script src="/js/vendor/cookieconsent@3.1.1/cookieconsent.min.js"></script>
<script>
const lazyLoadInstance = new LazyLoad({});
window.cookieconsent.initialise({
@ -37,6 +41,7 @@
}
});
</script>
{{ block "additionalScripts" . }}
{{ end }}
</body>
</html>

View file

@ -143,7 +143,9 @@
</div>
</div>
</div>
<script src="https://unpkg.com/three@0.131.3/build/three.min.js"></script>
{{/* <script src="https://unpkg.com/dat.gui@0.7.7/build/dat.gui.min.js"></script> */}}
<script src="/js/tower-gfx.js"></script>
{{ end }}
{{ define "additionalScripts" }}
<script defer src="/js/vendor/three@0.137.5/three.min.js"></script>
{{/* <script src="https://unpkg.com/dat.gui@0.7.7/build/dat.gui.min.js"></script> */}}
<script defer src="/js/tower-gfx.js"></script>
{{ end }}

View file

@ -1,8 +1,4 @@
{{ define "main" }}
<script defer src="https://unpkg.com/underscore@1.13.2/underscore-min.js"></script>
<script defer src="https://unpkg.com/dot@1.1.3/doT.min.js"></script>
<script defer src="https://unpkg.com/fuse.js@6.5.3/dist/fuse.min.js"></script>
<script defer src="/js/compat-table.js"></script>
<div class="container">
<div class="row mt-5">
<h2>Compatiblity List</h2>
@ -107,3 +103,9 @@
</div>
</div>
{{ end }}
{{ define "additionalScripts" }}
<script defer src="/js/vendor/underscore@1.13.2/underscore-min.js"></script>
<script defer src="/js/vendor/dot@1.1.3/doT.min.js"></script>
<script defer src="/js/vendor/fuse.js@6.5.3/fuse.min.js"></script>
<script defer src="/js/compat-table.js"></script>
{{ end }}

View file

@ -1,7 +1,4 @@
{{ define "main" }}
<script defer src="https://unpkg.com/dot@1.1.3/doT.min.js"></script>
<script defer src="https://unpkg.com/marked@4.0.8/marked.min.js"></script>
<script defer src="/js/release-page.js"></script>
<div class="container">
<div class="row mt-5">
<div class="row mb-3" id="outage-alert" style="display: none;">
@ -211,3 +208,8 @@
</div>
</div>
{{ end }}
{{ define "additionalScripts" }}
<script defer src="/js/vendor/dot@1.1.3/doT.min.js"></script>
<script defer src="/js/vendor/marked@4.0.12/marked.min.js"></script>
<script defer src="/js/release-page.js"></script>
{{ end }}

View file

@ -2,5 +2,4 @@
<div class="container mt-5">
{{ .Content }}
</div>
{{ end }}

View file

@ -4,8 +4,8 @@
<!-- OpenGraph Tags -->
{{ template "_internal/opengraph.html" . }}
<link rel="shortcut icon" href="/img/favicon.webp" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.10.1/mdb.min.css" rel="stylesheet" />
<link href="/css/thirdparty/skeleton-loading.css" rel="stylesheet" />
<!-- Grid and Component Design -->
<link href="/css/vendor/mdb-ui-kit@3.10.2/mdb.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" rel="stylesheet" />
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@ -20,17 +20,14 @@
href="https://fonts.googleapis.com/css2?family=DM+Sans&family=Fira+Code:wght@300;400;700&display=swap" media="print"
onload="this.media='all'" />
<!-- Theme CSS -->
<link href="/css/thirdparty/skeleton-loading/skeleton-loading.min.css" rel="stylesheet" />
{{ $sass := resources.Get "sass/main.sass" }}
{{ $style := $sass | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<!-- deferred javascript, used on every page -->
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.10.1/mdb.min.js"></script>
<script defer src="https://unpkg.com/jquery@3.6.0/dist/jquery.min.js"></script>
<script defer src="/js/theme.js"></script>
{{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}
{{ $title = print .Site.Title " | A PS2 Emulator" }}
{{ end }}
<title>{{ $title }}</title>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
<link href="/css/vendor/cookieconsent@3.1.1/cookieconsent.min.css" rel="stylesheet" />
</head>

View file

@ -1,109 +0,0 @@
/*
Copyright (c) 2021 by Tirso Lecointere (https://codepen.io/tirsolecointere/pen/jRJKWa)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
.skeleton-img, .skeleton-avatar, .skeleton-footer, .skeleton-text, .skeleton-header {
-webkit-animation: skeleton 1s ease-in-out forwards infinite;
animation: skeleton 1s ease-in-out forwards infinite;
-webkit-animation-direction: alternate;
animation-direction: alternate;
}
@-webkit-keyframes skeleton {
0% {
opacity: 0.2;
transform: translateY(6px) scale(0.98);
}
85%, 100% {
opacity: 1;
transform: translateY(0px) scale(1);
}
}
@keyframes skeleton {
0% {
opacity: 0.2;
transform: translateY(6px) scale(0.98);
}
85%, 100% {
opacity: 1;
transform: translateY(0px) scale(1);
}
}
.skeleton-container {
background-color: #15202B;
padding: 0.8rem 0.75rem;
margin: 0 auto;
width: 100%;
max-width: 500px;
border: 1px solid #38444d;
border-radius: 0.5rem;
overflow: hidden;
}
.skeleton-content {
/* margin-left: calc(48px + 10px); */
}
.skeleton-header {
transform-origin: bottom;
}
.skeleton-text {
-webkit-animation-delay: 200ms;
animation-delay: 200ms;
}
.skeleton-footer {
display: flex;
margin-top: 1rem;
transform-origin: bottom;
-webkit-animation-delay: 400ms;
animation-delay: 400ms;
}
.skeleton {
background-color: #15202B;
}
.skeleton-avatar {
width: 48px;
height: 48px;
background-color: #213243;
border-radius: 100%;
float: left;
}
.skeleton-line {
height: 0.7rem;
background-color: #213243;
border-radius: 3px;
margin-bottom: 0.3rem;
}
.skeleton-line.heading {
height: 1rem;
margin-bottom: 0.5rem;
}
.skeleton-img {
height: 250px;
background-color: #213243;
border-radius: 0.75rem;
margin-top: 1.5rem;
-webkit-animation-delay: 300ms;
animation-delay: 300ms;
}
.skeleton-button {
display: block;
width: 26px;
height: 26px;
background-color: #213243;
flex-shrink: 0;
}
.skeleton-button:not(:last-child) {
margin-right: 2rem;
}
.skeleton-button.rounded {
border-radius: 100%;
}

View file

@ -0,0 +1,7 @@
/*
Copyright (c) 2021 by Tirso Lecointere (https://codepen.io/tirsolecointere/pen/jRJKWa)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
.skeleton-avatar,.skeleton-footer,.skeleton-header,.skeleton-img,.skeleton-text{-webkit-animation:skeleton 1s ease-in-out forwards infinite;animation:skeleton 1s ease-in-out forwards infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes skeleton{0%{opacity:.2;transform:translateY(6px) scale(.98)}100%,85%{opacity:1;transform:translateY(0) scale(1)}}@keyframes skeleton{0%{opacity:.2;transform:translateY(6px) scale(.98)}100%,85%{opacity:1;transform:translateY(0) scale(1)}}.skeleton-container{background-color:#15202b;padding:.8rem .75rem;margin:0 auto;width:100%;max-width:500px;border:1px solid #38444d;border-radius:.5rem;overflow:hidden}.skeleton-header{transform-origin:bottom}.skeleton-text{-webkit-animation-delay:.2s;animation-delay:.2s}.skeleton-footer{display:flex;margin-top:1rem;transform-origin:bottom;-webkit-animation-delay:.4s;animation-delay:.4s}.skeleton{background-color:#15202b}.skeleton-avatar{width:48px;height:48px;background-color:#213243;border-radius:100%;float:left}.skeleton-line{height:.7rem;background-color:#213243;border-radius:3px;margin-bottom:.3rem}.skeleton-line.heading{height:1rem;margin-bottom:.5rem}.skeleton-img{height:250px;background-color:#213243;border-radius:.75rem;margin-top:1.5rem;-webkit-animation-delay:.3s;animation-delay:.3s}.skeleton-button{display:block;width:26px;height:26px;background-color:#213243;flex-shrink:0}.skeleton-button:not(:last-child){margin-right:2rem}.skeleton-button.rounded{border-radius:100%}

View file

@ -0,0 +1,6 @@
.cc-window{opacity:1;-webkit-transition:opacity 1s ease;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{-webkit-transition:transform 1s ease;-webkit-transition:-webkit-transform 1s ease;transition:-webkit-transform 1s ease;transition:transform 1s ease;transition:transform 1s ease,-webkit-transform 1s ease}.cc-animate.cc-revoke.cc-top{-webkit-transform:translateY(-2em);transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{-webkit-transform:translateY(2em);transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-top{-webkit-transform:translateY(0);transform:translateY(0)}.cc-animate.cc-revoke.cc-active.cc-bottom{-webkit-transform:translateY(0);transform:translateY(0)}.cc-revoke:hover{-webkit-transform:translateY(0);transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;-webkit-transition:max-height 1s;transition:max-height 1s}
.cc-revoke,.cc-window{position:fixed;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-revoke:hover{text-decoration:underline}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em;text-decoration:underline}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}
.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.cc-window.cc-banner{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{display:block;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;max-width:100%;margin-right:1em}.cc-compliance{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-floating .cc-compliance>.cc-btn{-webkit-box-flex:1;-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em}
@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-floating,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-webkit-box-align:unset;-ms-flex-align:unset;align-items:unset}.cc-window.cc-banner .cc-message{margin-right:0}}
.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-webkit-box-flex:0;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block}
.cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em;margin-bottom:1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0}

File diff suppressed because one or more lines are too long

View file

@ -38,6 +38,7 @@ function isMobile() {
function init() {
// Skip animation completely on mobile
if (isMobile()) {
$("#splash-screen").addClass("slow-performance");
return;
}
@ -162,7 +163,7 @@ function onWindowResize() {
}
var poorPerfFrames = 0;
var maxPoorPerfFrames = 50;
var maxPoorPerfFrames = 10;
function animate() {
var id = requestAnimationFrame(animate);
const t0 = performance.now();
@ -172,6 +173,7 @@ function animate() {
// then stop rendering, we'll just pause and it will use whatever was the last frame
if (t1 - t0 > 33) {
poorPerfFrames += 1;
console.log("Slow Frame");
if (poorPerfFrames > maxPoorPerfFrames) {
cancelAnimationFrame(id);
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
!function(){"use strict";var u,d={name:"doT",version:"1.1.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:void 0,compile:void 0,log:!0};d.encodeHTMLSource=function(e){var n={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},t=e?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(e){return e?e.toString().replace(t,function(e){return n[e]||e}):""}},u=function(){return this||(0,eval)("this")}(),"undefined"!=typeof module&&module.exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):u.doT=d;var s={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},p=/$^/;function l(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}d.template=function(e,n,t){var r,o,a=(n=n||d.templateSettings).append?s.append:s.split,c=0,i=n.use||n.define?function r(o,e,a){return("string"==typeof e?e:e.toString()).replace(o.define||p,function(e,r,n,t){return 0===r.indexOf("def.")&&(r=r.substring(4)),r in a||(":"===n?(o.defineParams&&t.replace(o.defineParams,function(e,n,t){a[r]={arg:n,text:t}}),r in a||(a[r]=t)):new Function("def","def['"+r+"']="+t)(a)),""}).replace(o.use||p,function(e,n){o.useParams&&(n=n.replace(o.useParams,function(e,n,t,r){if(a[t]&&a[t].arg&&r){var o=(t+":"+r).replace(/'|\\/g,"_");return a.__exp=a.__exp||{},a.__exp[o]=a[t].text.replace(new RegExp("(^|[^\\w$])"+a[t].arg+"([^\\w$])","g"),"$1"+r+"$2"),n+"def.__exp['"+o+"']"}}));var t=new Function("def","return "+n)(a);return t?r(o,t,a):t})}(n,e,t||{}):e;i=("var out='"+(n.strip?i.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):i).replace(/'|\\/g,"\\$&").replace(n.interpolate||p,function(e,n){return a.start+l(n)+a.end}).replace(n.encode||p,function(e,n){return r=!0,a.startencode+l(n)+a.end}).replace(n.conditional||p,function(e,n,t){return n?t?"';}else if("+l(t)+"){out+='":"';}else{out+='":t?"';if("+l(t)+"){out+='":"';}out+='"}).replace(n.iterate||p,function(e,n,t,r){return n?(c+=1,o=r||"i"+c,n=l(n),"';var arr"+c+"="+n+";if(arr"+c+"){var "+t+","+o+"=-1,l"+c+"=arr"+c+".length-1;while("+o+"<l"+c+"){"+t+"=arr"+c+"["+o+"+=1];out+='"):"';} } out+='"}).replace(n.evaluate||p,function(e,n){return"';"+l(n)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,""),r&&(n.selfcontained||!u||u._encodeHTML||(u._encodeHTML=d.encodeHTMLSource(n.doNotSkipEncoded)),i="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+d.encodeHTMLSource.toString()+"("+(n.doNotSkipEncoded||"")+"));"+i);try{return new Function(n.varname,i)}catch(e){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+i),e}},d.compile=function(e,n){return d.template(e,null,n)}}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long