From 554d64d6169e91e09082ed1cc7fe8cb9bc326d6e Mon Sep 17 00:00:00 2001 From: MTSyntho Date: Sat, 6 Jul 2024 21:58:32 +0200 Subject: [PATCH] attempting to check system host in javascript --- __pycache__/modelfetch.cpython-311.pyc | Bin 0 -> 449 bytes help.css | 41 ++++++++++++++++++++++++ help.html | 17 ++++++++++ help.js | 11 +++++++ index.css | 42 ++++++++++++++++++++++++- index.html | 8 +++-- index.js | 25 +++++++++++++++ main.py | 12 +++++++ modelfetch.py | 6 ++++ settings.html | 5 +-- settings.js | 21 ++++++++++--- 11 files changed, 179 insertions(+), 9 deletions(-) create mode 100644 __pycache__/modelfetch.cpython-311.pyc create mode 100644 help.css create mode 100644 help.html create mode 100644 help.js create mode 100644 main.py create mode 100644 modelfetch.py diff --git a/__pycache__/modelfetch.cpython-311.pyc b/__pycache__/modelfetch.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c9f1080b3874e04065c479c1b3123a533504db7c GIT binary patch literal 449 zcmZ3^%ge<81l1LtY573EEd!dq8g2t41F~EcdkSMPgC^5UkYYbg zj$6#-xtX_^!+kw(F(%&<3D3+kHi~!7&n+k|Ni7PlEG|jSy~S1xp;-%xGV@AqvHIqx zq~_e>$jC1)$;?a3U&-(pWY{kcXRDad;?$yIFd5^LpIn-onpaXBlUouKT$+@VnVYH* zl3Gy`6Ht_&m6{Bcs7lE$%FHd!&x^?g8JU(^lANJeQ2C3)2FNeXNwq8D0~!qSNwFW0 z_`uA_$asT+s{srjuy8jxx41WYws + + + zdkrimson + + + +
+ +

Documentation

+
+ +

Documentation will be worked on eventually

+ + \ No newline at end of file diff --git a/help.js b/help.js new file mode 100644 index 0000000..d31d41c --- /dev/null +++ b/help.js @@ -0,0 +1,11 @@ +function closeHelp() { + // Send message from iframe to parent window + window.parent.postMessage('hideDocs', '*'); +} + +document.addEventListener('DOMContentLoaded', function() { + if (window.self === window.top) { + // Not inside an iframe + document.body.style.backgroundColor = 'darkred'; + } +}); \ No newline at end of file diff --git a/index.css b/index.css index 61878c0..ecc6415 100644 --- a/index.css +++ b/index.css @@ -1,9 +1,31 @@ body { + background-color: #210202; background-image: url("assets/bg/blur/crim1.png"); background-size: cover; background-attachment: fixed; } +@keyframes fadeout { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +.windowfade { + position: fixed; + top: 0; + left: 0; + background-color: #210202; + width: 100%; + height: 100%; + z-index: 100; + animation: fadeout 1s ease-in-out forwards; + pointer-events: none +} + @font-face { font-family: 'Inter'; src: url('assets/fonts/inter/Inter-Regular.ttf'); @@ -190,6 +212,24 @@ button:active { pointer-events: none; } +.help { + position: fixed; + width: 450px; + height: 80%; + padding: 0px; + margin: auto; + inset: 0px; + display: flex; + flex-direction: column; + backdrop-filter: blur(20px) brightness(40%); + border-radius: 20px; + box-shadow: 0px 0px 20px #00000055; + z-index: 7; /* i like the number 7 */ + opacity: 0; + scale: 0.8; + pointer-events: none; +} + @keyframes popup { from { scale: 0.8; @@ -224,7 +264,7 @@ button:active { animation: popout 0.5s ease-in forwards; } -.settingsiframe { +.windowiframe { width: 100%; height: 100%; border: 0; diff --git a/index.html b/index.html index 7d2f688..c7aac05 100644 --- a/index.html +++ b/index.html @@ -6,12 +6,16 @@ +
- + +
+
+
-

Minecraft Information

diff --git a/settings.js b/settings.js index 5855a8d..6a037e6 100644 --- a/settings.js +++ b/settings.js @@ -1,12 +1,25 @@ +console.log("Platform: " + navigator.platform) + +// Adds information on load +document.addEventListener('DOMContentLoaded', function() { + var restext = document.getElementById('sysres'); + var platformtext = document.getElementById('sysplat'); + + restext.textContent = "Resolution: " + window.screen.width + "x" + window.screen.height; + platformtext.textContent = "Platform: " + navigator.platform; +}); + +window.addEventListener('message', function(event) { + var syshost = document.getElementById('syshost'); + + syshost.textContent = "Host: " + event.data; +}); + function closeSettings() { // Send message from iframe to parent window window.parent.postMessage('hideSettings', '*'); } -// Check if the webpage is not loaded inside an iframe - - - //This code snippet sets the background to dark red if ran outside an iframe, this makes writing the settings page easier without it being embedded? // Im writing the settings page in it's own tab, not in the iframe cuz i need to refresh the page then open up the settings menu every new change // Wait for DOM content to be fully loaded