Skip to content

Commit

Permalink
Showcase Themes Configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Jan 27, 2025
1 parent 0cec648 commit 627ff9f
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<img id="lorempicsumwallpaper" src="img/lorempicsum.svg" alt="Lorem Picsum Wallpaper">
</body>
<script src="js/script.js"></script>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"StretchMode": "SucroseStretchMode('{0}');"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"AppVersion": "25.1.27.0",
"Version": "1.0.0.0",
"Title": "Lorem Picsum Wallpaper",
"Thumbnail": "thumbnail.jpg",
"Preview": "preview.gif",
"Description": "This theme displays random high-quality images from Lorem Picsum as your wallpaper.",
"Author": "Taiizor",
"License": null,
"Contact": "https://github.com/Taiizor",
"Type": 2,
"Source": "Lorem.html",
"Tags": null,
"Arguments": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"PropertyListener": "SucrosePropertyListener('{0}', {1});",
"PropertyList": {
"refreshInterval": {
"max": 1440,
"min": 1,
"step": 1,
"text": "Change Wallpaper Minutes",
"help": "Set the wallpaper change interval in minutes",
"type": "slider",
"value": 1
},
"wallpaperResolution": {
"type": "dropdown",
"text": "Wallpaper Resolution",
"help": "Select the resolution of the wallpaper image that will be downloaded",
"value": 10,
"items": [
"1366x768",
"1600x900",
"1920x1080",
"1920x1200",
"2048x1080",
"2048x1152",
"2560x1440",
"2560x1600",
"3440x1440",
"3840x1600",
"3840x2160",
"4096x2160"
]
}
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
html,
body {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}

img {
width: 100%;
height: 100%;
object-fit: none;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
var lorempicsumwallpaper = document.getElementById("lorempicsumwallpaper");
let currentResolution = "3840x2160"; // Default resolution

async function GetLoremPicsumWallpaper() {
try {
const [width, height] = currentResolution.split('x');
const wallpaperUrl = `https://picsum.photos/${width}/${height}`;

// Add timestamp to prevent caching
lorempicsumwallpaper.src = `${wallpaperUrl}?t=${Date.now()}`;
lorempicsumwallpaper.alt = "Lorem Picsum Wallpaper";
} catch (error) {
console.error("An error occurred while loading Lorem Picsum Wallpaper: ", error);
}
}

function SucrosePropertyListener(name, val) {
switch (name) {
case "refreshInterval":
// Update interval
clearInterval(wallpaperInterval);
wallpaperInterval = setInterval(GetLoremPicsumWallpaper, val.value * 60000);
break;
case "wallpaperResolution":
// Update resolution
currentResolution = val.items[val.value];
GetLoremPicsumWallpaper();
break;
}
}

function SucroseStretchMode(Type) {
switch (Type) {
case "None":
lorempicsumwallpaper.style.objectFit = "none";
break;
case "Fill":
lorempicsumwallpaper.style.objectFit = "fill";
break;
case "Uniform":
lorempicsumwallpaper.style.objectFit = "contain";
break;
case "UniformToFill":
lorempicsumwallpaper.style.objectFit = "cover";
break;
default:
break;
}
}

window.addEventListener("load", GetLoremPicsumWallpaper);

// Initial interval (60 seconds)
let wallpaperInterval = setInterval(GetLoremPicsumWallpaper, 60000);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 627ff9f

Please sign in to comment.