revert Embed Image test?
This commit is contained in:
bingus_violet 2024-06-30 14:57:24 -05:00
parent 87f4baf491
commit b2329fcc14
8 changed files with 6 additions and 2787 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

View file

@ -1,35 +0,0 @@
const nodeHtmlToImage = require('node-html-to-image'),
api = require("./api.js"),
pageUpdater = require("./pageUpdater.js")
fs = require("fs"),
path = require("path"),
app = require("./expressHandler.js").app
const constants = JSON.parse(fs.readFileSync(path.join(__dirname, "constants.json")))
app.get("/embedImage.png", async (req, res) => {
var discColors = constants.discStatuses[api.lanyard.discord_status]
var pregen = pageUpdater.pregen
var html = "<h2>Not initialized!...</h2>"
for (var i in pregen) {
var item = pregen[i]
if (item.absolutePath.includes("/card/index.html")) {
html = item.html
}
}
var img = await nodeHtmlToImage({
html: html,
transparent: true
})
res.send(img)
})
app.get("/embedImage", (req, res) => {
res.send("<img src='/embedImage.png'> <style>body { background-color:black; } </style>")
})

View file

@ -2,7 +2,7 @@ const fs = require("fs")
require("./fileHandler.js") require("./fileHandler.js")
require('./expressHandler.js') require('./expressHandler.js')
require("./imageEmbedder.js") // require("./imageEmbedder.js")
process.on('uncaughtException', (err, origin) => { process.on('uncaughtException', (err, origin) => {
fs.writeSync( fs.writeSync(

2579
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,6 @@
"glob": "^10.4.2", "glob": "^10.4.2",
"himalaya": "^1.1.0", "himalaya": "^1.1.0",
"minify-html": "^0.0.2", "minify-html": "^0.0.2",
"node-html-to-image": "^4.0.0",
"ws": "^8.16.0", "ws": "^8.16.0",
"youtubei.js": "^9.0.2" "youtubei.js": "^9.0.2"
} }

View file

@ -388,12 +388,11 @@ module.exports = {
res.send(data) res.send(data)
} else { } else {
// res.status(404).send(` res.status(404).send(`
// <link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="/style.css">
// <h1>404</h1> <h1>404</h1>
// <p>Uh oh... I think your lost? There's nothing here :P</p> <p>Uh oh... I think your lost? There's nothing here :P</p>
// `) `)
next()
} }
} }
} }
@ -431,8 +430,6 @@ function pregenerate() {
for (var i = 0; i < pregenFiles.length; i++) { for (var i = 0; i < pregenFiles.length; i++) {
pregenFiles[i].html = pregenFiles[i].html.replaceAll("{PREGEN_TOTAL}", Date.now() - lastPregen) pregenFiles[i].html = pregenFiles[i].html.replaceAll("{PREGEN_TOTAL}", Date.now() - lastPregen)
} }
module.exports.pregen = pregenFiles
} }
pregenerate() pregenerate()

View file

@ -1,163 +0,0 @@
<style>
:root {
color-scheme: dark;
}
@font-face {
font-display: swap;
font-family: 'Rubik';
font-style: normal;
font-weight: 400;
src: url('/fonts/rubik-v28-latin-regular.woff2') format('woff2');
}
* {
font-family: 'Rubik', Verdana, Geneva, Tahoma, sans-serif;
padding: 0;
margin: 0;
font-weight: 400;
text-align: center;
color: white;
}
#topbar>* {
display: inline-block;
font-size: 1.5rem;
}
main:nth-of-type(1), .mainDiv {
width: 95%;
max-width: 1000px;
margin: auto;
}
a {
display: inline-block;
transition: 1.5s all cubic-bezier(0.075, 0.82, 0.165, 1);
}
a[href] {
color: rgb(175, 225, 255);
}
.chip {
position: relative;
z-index: 3;
font-size: 1.3rem;
border: 2px gray solid;
border-radius: 6px;
background-color: black;
padding: 8px;
margin: 3px;
display: inline-block;
transform: scale(0.95);
transition: transform 1.25s cubic-bezier(0.075, 0.82, 0.165, 1), background-color 2s cubic-bezier(0.075, 0.82, 0.165, 1);
}
a.chip {
text-decoration: none;
/* background-image: linear-gradient(rgb(175, 225, 255), rgb(175, 225, 255));
background-size: calc(100% - 15px) 2px;
background-position: 50% 87.5%;
background-repeat: no-repeat; */
}
.chip:hover {
background-color: rgb(10, 0, 25);
transform: scale(1);
/* font-size: 1.35rem; */
border-color: white;
transition: transform 0.75s cubic-bezier(0.075, 0.82, 0.165, 1), background-color 3s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.chip:hover>.smallimg {
background-color: rgb(10, 0, 25);
}
hr {
color: white;
border: white solid;
opacity: 0.25;
border-width: 2px;
margin: 15px 10%;
/* background-color: none; */
}
body {
width: 800;
height: 500;
}
p {
font-size: 1.25rem;
margin: 5px;
line-height: 2rem;
text-wrap: pretty;
}
img {
width: 100%;
}
h2 {
font-size: 1.8rem;
}
#card {
background-color: rgba(20, 5, 90);
padding: 15px;
border: 2px white solid;
margin: 20px auto;
width: 90%;
max-width: 800px;
z-index: 3;
position: relative;
border-radius: 12px;
box-shadow: 0px 5px 50px 0px rgba(0, 0, 0, .25);
}
.pfp {
border-radius: 15px;
border: darkgray 4px solid;
float: right;
width: 60%;
aspect-ratio: 1/1;
transform: scale(0.9);
border-radius: 50%;
rotate: 0deg;
user-select: none;
max-width: 168px;
animation-duration: 3s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
</style>
<div style="height: 100%; width: 100%; display: flex; justify-content: center; align-items: center;">
<div id="card">
<h2>{Violet}</h2>
<div style="display: flex; justify-content: center; align-items: center;">
<div style="width: 50%;">
<img draggable="false" src="https://api.violets-purgatory.dev/v1/pfp" class="pfp">
</div>
<div style="width: 50%;">
<div style="float: left;">
<p>They/Them</p>
<p>Developer</p>
<!-- <p>{DISCORD_STATUS}</p> -->
</div>
</div>
</div>
<hr>
<div>
<p style="padding: 10px;">Hi! I'm Violet, a 15 year old web and game developer. I make server-sided dynamic websites, with majority of rendering being done on the server, no Javascript needed! I'm currently making games in the Godot Engine, and my dynamic sites in NodeJS.</p>
<div class="customStatus">
{CUSTOM_STATUS}
</div>
</div>
</div>
</div>