This commit is contained in:
bingus_violet 2024-04-25 20:01:02 -05:00
parent 80ad607d92
commit 3352ceb796
2 changed files with 7 additions and 25 deletions

View file

@ -25,6 +25,8 @@ function firstToUpper(str) {
} }
var thumborURL = "https://thumbor.violets-purgatory.dev/unsafe/" var thumborURL = "https://thumbor.violets-purgatory.dev/unsafe/"
var imgExtension = "png"
var thumborArgs = `filters:format(${imgExtension})/`
function timeFormatter(seconds) { function timeFormatter(seconds) {
seconds = Math.ceil(seconds) seconds = Math.ceil(seconds)
@ -272,11 +274,12 @@ function socketeer() {
if (get_img_url(activity)) { if (get_img_url(activity)) {
var url = get_img_url(activity) var url = get_img_url(activity)
var fn = Math.ceil(Math.random() * 100_000_000_000).toString() var fn = Math.ceil(Math.random() * 100_000_000_000).toString() + "." + imgExtension
var fp = path.join(__dirname, 'cached', fn) var fp = path.join(__dirname, 'cached', fn)
if (!cachedImages[url]) { if (!cachedImages[url]) {
const response = await (await fetch(thumborURL + "200x200/" + url)).arrayBuffer() const response = await (await fetch(thumborURL + "200x200/" + thumborArgs + url)).arrayBuffer()
console.log(url)
fs.writeFileSync(fp, Buffer.from(response)) fs.writeFileSync(fp, Buffer.from(response))
cachedImages[url] = fn cachedImages[url] = fn
@ -285,11 +288,11 @@ function socketeer() {
if (get_img_url(activity, "small_image")) { if (get_img_url(activity, "small_image")) {
var url = get_img_url(activity, "small_image") var url = get_img_url(activity, "small_image")
var fn = Math.ceil(Math.random() * 100_000_000_000).toString() var fn = Math.ceil(Math.random() * 100_000_000_000).toString() + "." + imgExtension
var fp = path.join(__dirname, 'cached', fn) var fp = path.join(__dirname, 'cached', fn)
if (!cachedImages[url]) { if (!cachedImages[url]) {
const response = await (await fetch(thumborURL + "64x64/" + url)).arrayBuffer() const response = await (await fetch(thumborURL + "64x64/" + thumborArgs + url)).arrayBuffer()
fs.writeFileSync(fp, Buffer.from(response)) fs.writeFileSync(fp, Buffer.from(response))

View file

@ -87,27 +87,6 @@ img:not(.project-inner > div > img):not(.activity>img) {
} }
} }
.lengthBar {
background-color: rgb(50, 40, 60);
display: inline-block;
width: 80%;
height: 10px;
padding: 0;
overflow: hidden;
border-radius: 5px;
margin-right: 1.9%;
}
.lengthBar>span {
margin: 0;
padding: 0;
width: 100%;
background-color: rgb(200, 200, 230);
height: 20px;
display: block;
position: relative;
}
@keyframes spinny { @keyframes spinny {
0% { 0% {
rotate: 0deg; rotate: 0deg;