made everything work
This commit is contained in:
parent
45496ace17
commit
305a81508e
3 changed files with 12 additions and 11 deletions
|
@ -25,7 +25,7 @@ function onUpdate(data) {
|
||||||
let listening = false;
|
let listening = false;
|
||||||
let content = "";
|
let content = "";
|
||||||
data.activities.forEach(presence => {
|
data.activities.forEach(presence => {
|
||||||
if(presence.application_id === "463151177836658699" && presence.assets.small_text != "Paused") { // premid
|
if(presence.application_id === "463151177836658699" && presence.assets.small_text !== "Paused") { // premid
|
||||||
listening = true;
|
listening = true;
|
||||||
artist = presence.state.substring(0, presence.state.indexOf(" -"));
|
artist = presence.state.substring(0, presence.state.indexOf(" -"));
|
||||||
if (artist === "") {
|
if (artist === "") {
|
||||||
|
@ -53,7 +53,7 @@ function onUpdate(data) {
|
||||||
});
|
});
|
||||||
document.getElementById("presence").style.display = content === "" ? "none": "flex";
|
document.getElementById("presence").style.display = content === "" ? "none": "flex";
|
||||||
document.getElementById("presence-content").innerText = content;
|
document.getElementById("presence-content").innerText = content;
|
||||||
document.getElementById("presence-icon").src = listening ? "music.ico" : "game.ico";
|
document.getElementById("presence-icon").src = listening ? "img/music.ico" : "img/game.ico";
|
||||||
}
|
}
|
||||||
LanyardWrapper.connectWebSocket("886685857560539176", onUpdate)
|
LanyardWrapper.connectWebSocket("886685857560539176", onUpdate)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
|
|
@ -2,6 +2,7 @@ var express = require("express");
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
app.set("view engine", "ejs");
|
app.set("view engine", "ejs");
|
||||||
|
app.use(express.static("public"))
|
||||||
|
|
||||||
app.get("/", function(req, res) {
|
app.get("/", function(req, res) {
|
||||||
res.render("index");
|
res.render("index");
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
<title>nin0dev</title>
|
<title>nin0dev</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/7.css">
|
<link rel="stylesheet" href="https://unpkg.com/7.css">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="css/style.css">
|
||||||
<link rel="icon" type="image/x-icon" href="logo-but-round.png">
|
<link rel="icon" type="image/x-icon" href="logo-but-round.png">
|
||||||
<meta name="theme-color" content="#00D0D0">
|
<meta name="theme-color" content="#00D0D0">
|
||||||
<meta property="og:url" content="https://nin0.dev" />
|
<meta property="og:url" content="https://nin0.dev" />
|
||||||
<meta property="og:title" content="nin0dev" />
|
<meta property="og:title" content="nin0dev" />
|
||||||
<meta property="og:description" content="Hey, I'm nin0dev, a Canadian software developer." />
|
<meta property="og:description" content="Hey, I'm nin0dev, a Canadian software developer." />
|
||||||
<meta property="og:image" content="https://nin0.dev/logo.png" />
|
<meta property="og:image" content="https://nin0.dev/logo.png" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="window" id="main-window">
|
<div class="window" id="main-window">
|
||||||
|
@ -26,12 +26,12 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="window-body">
|
<div class="window-body">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<img src="logo.png" alt="the nin0dev logo" id="pfp">
|
<img src="img/logo.png" alt="the nin0dev logo" id="pfp">
|
||||||
<h3>nin0dev <span style="font-size: 0.4em;">(he/him)</span></h3>
|
<h3>nin0dev <span style="font-size: 0.4em;">(he/him)</span></h3>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div id="presence" style="display: none; margin-bottom: 12px;">
|
<div id="presence" style="display: none; margin-bottom: 12px;">
|
||||||
<img src="game.ico" id="presence-icon">
|
<img src="img/game.ico" id="presence-icon">
|
||||||
<p id="presence-content"></p>
|
<p id="presence-content"></p>
|
||||||
</div>
|
</div>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@ -97,8 +97,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="oneko.js"></script>
|
<script src="js/oneko.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/lanyard-wrapper/dist/index.browser.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/lanyard-wrapper/dist/index.browser.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="js/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue