icons!!!!!!
@@ -57,7 +57,7 @@
|
||||
"-t",
|
||||
"Pictures",
|
||||
"--theme",
|
||||
"themes/steam.css",
|
||||
"themes/catpuccin.css",
|
||||
"--use-fancy-folders",
|
||||
"--web-manifest",
|
||||
"-n",
|
||||
@@ -73,7 +73,8 @@
|
||||
},
|
||||
{
|
||||
"args": [
|
||||
"${workspaceFolder}/themes"
|
||||
"${workspaceFolder}/themes",
|
||||
"https://pictures.sorogon.eu/Analog/Example/"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"name": "Generate Themes previews",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
margin-top: 32px;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 56px;
|
||||
font-family: Arial;
|
||||
height: 100%;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<div class="folders">
|
||||
{%- for subdirectory in subdirectories %}
|
||||
<figure>
|
||||
<a href="{{ subdirectory.url }}"><img /></a>
|
||||
<a href="{{ subdirectory.url }}"><img class="foldericon"/></a>
|
||||
<figcaption><a href="{{ subdirectory.url }}">{{ subdirectory.name }}</a></figcaption>
|
||||
</figure>
|
||||
{%- endfor %}
|
||||
|
||||
@@ -20,84 +20,83 @@ These variables are essential for automatic icon generation.
|
||||
Include the following CSS rule to specify the folder icon used in your theme:
|
||||
|
||||
```css
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%233674e7' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%236495ed' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1); /* Adjust fill color as per your theme */
|
||||
}
|
||||
```
|
||||
|
||||
Replace the SVG data URI (`url("data:image/svg+xml,...")`) with your desired SVG icon content. Adjust the `fill` color to match `--color1` or another suitable color from your theme's palette.
|
||||
Replace the SVG data URI (`url("data:image/svg+xml,...")`) with your desired SVG icon content.
|
||||
|
||||
## Previews of included themes
|
||||
|
||||
### alpenglow
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### aritim-dark
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### aritim
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### autumn
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### carnation
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### catpuccin
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### cornflower
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### default-dark
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### default
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### ivy
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### kjoe
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### monokai-vibrant
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### rainbow
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### spring
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### steam
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### summer
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### sunflower
|
||||
|
||||
 |
|
||||

|
||||
|
||||
### winter
|
||||
|
||||
 |
|
||||

|
||||
|
||||
@@ -52,7 +52,7 @@ body {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FF6F91' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFADAD' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FF6F61' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%236B5B95' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%236B5B95' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FF6F61' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFA07A' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FF7F50' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%238B0000' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23B22222' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -47,9 +47,8 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%2396CDFB' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23F28FAD' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6H10L8 4H4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H20C21.1046 20 22 19.1046 22 18V8C22 6.89543 21.1046 6 20 6Z' fill='%23F28FAD'/%3E%3Cpath d='M4 4H8L10 6H20C21.1046 6 22 6.89543 22 8H2C2 6.89543 2.89543 6 4 6V4Z' fill='%2396CDFB'/%3E%3Cpath d='M10 6H14L12 4H8L10 6Z' fill='%23ABE9B3'/%3E%3Cpath d='M14 6H18L16 4H12L14 6Z' fill='%23FAE3B0'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.folders a {
|
||||
@@ -65,7 +64,7 @@
|
||||
|
||||
.row a {
|
||||
font-weight: 500;
|
||||
color: var(--color2);
|
||||
color: var(--color1);
|
||||
text-decoration: none;
|
||||
font-family: "Nunito", sans-serif;
|
||||
}
|
||||
@@ -76,7 +75,7 @@
|
||||
|
||||
.tooltiptext {
|
||||
font-weight: 400;
|
||||
background-color: var(--bcolor2);
|
||||
background-color: var(--color3);
|
||||
font-family: "Nunito", sans-serif;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%233674e7' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%236495ed' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url(https://www.svgrepo.com/show/474853/gallery.svg);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url(https://www.svgrepo.com/show/474852/folder.svg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,85 +1,147 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import base64
|
||||
import logging
|
||||
from typing import List
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
|
||||
# Set up logging
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
||||
|
||||
|
||||
def take_screenshot(html_path: str, css_file: str, output_file: str, driver: webdriver.Chrome) -> None:
|
||||
"""
|
||||
Takes a screenshot of the given HTML file with the specified CSS applied.
|
||||
|
||||
Args:
|
||||
html_path (str): Path to the HTML file or URL.
|
||||
css_file (str): Path to the CSS file to be applied.
|
||||
output_file (str): Path where the screenshot will be saved.
|
||||
driver (webdriver.Chrome): The Chrome WebDriver instance.
|
||||
"""
|
||||
try:
|
||||
# Open the HTML file or URL
|
||||
if html_path.startswith(("http://", "https://")):
|
||||
driver.get(html_path)
|
||||
else:
|
||||
driver.get(f"file://{os.path.abspath(html_path)}")
|
||||
|
||||
# Remove current theme.css
|
||||
remove_css_script = """
|
||||
var links = document.querySelectorAll("link[rel='stylesheet']");
|
||||
links.forEach(link => {
|
||||
if (link.href.includes('theme.css')) {
|
||||
link.parentNode.removeChild(link);
|
||||
}
|
||||
});
|
||||
"""
|
||||
driver.execute_script(remove_css_script)
|
||||
|
||||
with open(css_file, "rb") as f:
|
||||
css_content = f.read()
|
||||
|
||||
# Encode CSS content as Base64
|
||||
encoded_css = base64.b64encode(css_content).decode("utf-8")
|
||||
|
||||
# Inject CSS into HTML using JavaScript
|
||||
apply_css_script = f"""
|
||||
var style = document.createElement('style');
|
||||
style.innerHTML = atob('{encoded_css}');
|
||||
document.head.appendChild(style);
|
||||
"""
|
||||
driver.execute_script(apply_css_script)
|
||||
|
||||
# Wait for a while to ensure CSS is applied
|
||||
time.sleep(2)
|
||||
|
||||
# Capture screenshot
|
||||
driver.save_screenshot(output_file)
|
||||
logging.info(f"Screenshot saved to {output_file}")
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"Failed to take screenshot for {css_file}: {e}")
|
||||
|
||||
|
||||
def write_readme(folder_path: str, themes: List[str]) -> None:
|
||||
"""
|
||||
Writes the README file with previews of included themes.
|
||||
|
||||
Args:
|
||||
folder_path (str): Path to the folder containing the themes and README.md.
|
||||
themes (List[str]): List of theme names.
|
||||
"""
|
||||
readme_path = os.path.join(folder_path, "README.md")
|
||||
try:
|
||||
with open(readme_path, "r", encoding="utf-8") as f:
|
||||
readme = f.read()
|
||||
|
||||
readme_head = readme.split("## Previews of included themes")[0]
|
||||
readme_head += "## Previews of included themes\n"
|
||||
readme_head += "".join([f"\n### {theme}\n\n\n" for theme in themes])
|
||||
|
||||
with open(readme_path, "w", encoding="utf-8") as f:
|
||||
f.write(readme_head)
|
||||
|
||||
logging.info(f"README.md updated with previews of included themes.")
|
||||
|
||||
except FileNotFoundError:
|
||||
logging.error(f"README.md not found in {folder_path}")
|
||||
except Exception as e:
|
||||
logging.error(f"Failed to write README.md: {e}")
|
||||
|
||||
|
||||
def main(folder_path: str, html_path: str) -> None:
|
||||
"""
|
||||
Main function to take screenshots for each CSS file in the folder and update the README.md.
|
||||
|
||||
Args:
|
||||
folder_path (str): Path to the folder containing CSS files.
|
||||
html_path (str): Path to the HTML file or URL for rendering.
|
||||
"""
|
||||
if not os.path.exists(folder_path):
|
||||
logging.error(f'Error: Folder path "{folder_path}" does not exist.')
|
||||
return
|
||||
|
||||
def take_screenshot(html_file, css_file, output_file):
|
||||
# Setup Chrome options
|
||||
chrome_options = Options()
|
||||
chrome_options.add_argument("--headless") # Run in headless mode, no GUI
|
||||
chrome_options.add_argument("--window-size=1920,1080") # Set window size to at least 1920x1080
|
||||
|
||||
# Set window size to at least 1920x1080
|
||||
chrome_options.add_argument("--window-size=1920,1080")
|
||||
|
||||
# Initialize Chrome WebDriver with the specified service and options
|
||||
# Initialize Chrome WebDriver
|
||||
chromedriver_path = "/usr/bin/chromedriver" # Replace with your actual path
|
||||
service = Service(chromedriver_path)
|
||||
driver = webdriver.Chrome(service=service, options=chrome_options)
|
||||
|
||||
try:
|
||||
# Open the HTML file
|
||||
driver.get(f"file://{os.path.abspath(html_file)}")
|
||||
themes = []
|
||||
# Iterate over all files in the folder
|
||||
for filename in sorted(os.listdir(folder_path)):
|
||||
if filename.endswith(".css"):
|
||||
theme_name = os.path.splitext(filename)[0]
|
||||
themes.append(theme_name)
|
||||
css_file = os.path.join(folder_path, filename)
|
||||
output_file = os.path.join(folder_path, "screenshots", f"{theme_name}.png")
|
||||
|
||||
# Apply the CSS file to the HTML
|
||||
apply_css_script = f"""
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = '{os.path.abspath(css_file)}';
|
||||
document.head.appendChild(link);
|
||||
"""
|
||||
driver.execute_script(apply_css_script)
|
||||
# Create screenshots folder if it doesn't exist
|
||||
os.makedirs(os.path.dirname(output_file), exist_ok=True)
|
||||
|
||||
# Wait for a while to ensure CSS is applied (adjust as needed)
|
||||
time.sleep(2)
|
||||
# Take screenshot for this CSS file
|
||||
take_screenshot(html_path, css_file, output_file, driver)
|
||||
|
||||
# Capture screenshot
|
||||
driver.save_screenshot(output_file)
|
||||
print(f"Screenshot saved to {output_file}")
|
||||
# Write the README file with the new previews
|
||||
write_readme(folder_path, themes)
|
||||
|
||||
finally:
|
||||
driver.quit()
|
||||
|
||||
|
||||
def write_readme(_folder_path: str, themes: list[str]):
|
||||
with open(os.path.join(_folder_path, "README.md"), "r", encoding="utf-8") as f:
|
||||
readme = f.read()
|
||||
readmehead = readme.split("## Previews of included themes")[0]
|
||||
readmehead += f"""## Previews of included themes
|
||||
{ "".join([f'\n### {theme}\n\n |\n' for theme in themes]) }"""
|
||||
with open(os.path.join(_folder_path, "README.md"), "w", encoding="utf-8") as f:
|
||||
f.write(readmehead)
|
||||
|
||||
|
||||
def main(_folder_path):
|
||||
html_file = "/mnt/nfs/pictures/Analog/Example/index.html"
|
||||
|
||||
# Check if the folder path exists
|
||||
if not os.path.exists(_folder_path):
|
||||
print(f'Error: Folder path "{_folder_path}" does not exist.')
|
||||
return
|
||||
|
||||
themes = []
|
||||
# Iterate over all files in the folder
|
||||
for filename in sorted(os.listdir(_folder_path)):
|
||||
if filename.endswith(".css"):
|
||||
themes.append(os.path.splitext(filename)[0])
|
||||
css_file = os.path.join(_folder_path, filename)
|
||||
output_file = os.path.join(_folder_path, "screenshots", f"{os.path.splitext(filename)[0]}.png")
|
||||
|
||||
# Take screenshot for this CSS file
|
||||
take_screenshot(html_file, css_file, output_file)
|
||||
|
||||
# Write the README file with the new previews
|
||||
write_readme(_folder_path, themes)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python script_name.py folder_path")
|
||||
if len(sys.argv) != 3:
|
||||
logging.error("Usage: python script_name.py folder_path html_path")
|
||||
else:
|
||||
folder_path = sys.argv[1]
|
||||
main(folder_path)
|
||||
html_path = sys.argv[2]
|
||||
main(folder_path, html_path)
|
||||
|
||||
6
themes/icons/catpuccin.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<svg width='64' height='64' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||||
<path d='M20 6H10L8 4H4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H20C21.1046 20 22 19.1046 22 18V8C22 6.89543 21.1046 6 20 6Z' fill='#F28FAD' />
|
||||
<path d='M4 4H8L10 6H20C21.1046 6 22 6.89543 22 8H2C2 6.89543 2.89543 6 4 6V4Z' fill='#96CDFB' />
|
||||
<path d='M10 6H14L12 4H8L10 6Z' fill='#ABE9B3' />
|
||||
<path d='M14 6H18L16 4H12L14 6Z' fill='#FAE3B0' />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 473 B |
5
themes/icons/subfolder.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="10" y="30" width="80" height="50" fill="#F9A825" rx="5" ry="5" />
|
||||
<rect x="10" y="20" width="40" height="20" fill="#F9A825" rx="5" ry="5" />
|
||||
<rect x="20" y="40" width="60" height="40" fill="#FFD54F" rx="3" ry="3" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 331 B |
@@ -44,7 +44,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23006400' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23008000' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%238e0000' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FF2727' /%3E%3C/g%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url(https://www.svgrepo.com/show/400249/folder.svg);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23770088' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23004CFF' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color5);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
@@ -47,7 +47,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%2387CEFA' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFB6C1' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8' standalone='no'%3F%3E%3Csvg height='512' width='512' version='1.1' id='Layer_1' viewBox='0 0 327.68 327.68' xml:space='preserve' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cdefs id='defs1' /%3E%3Cg id='icon' transform='translate(-128.08785,-19.123746)'%3E%3Cpath id='fg' style='fill:%23dcdedf;fill-opacity:1;stroke:none;stroke-width:6.4;stroke-linecap:round' d='m 428.2793,160.97461 c -78.34525,0.002 -156.69075,-0.007 -235.03585,0.0159 -6.54719,0.16827 -12.82625,4.35683 -15.37415,10.41233 -1.13922,2.74038 -1.79474,5.64883 -2.74311,8.45618 -10.27476,33.32809 -20.56379,66.65251 -30.78952,99.99526 -1.21885,4.66702 0.98496,9.97729 5.17832,12.3776 2.40372,1.49255 5.31559,1.67974 8.07056,1.58986 78.16762,-0.0305 156.33557,0.008 234.503,-0.0259 6.43644,-0.17102 12.61041,-4.22124 15.23762,-10.1162 1.2077,-2.75858 1.84495,-5.72012 2.81312,-8.56426 10.08283,-32.66775 20.13843,-65.34481 30.20361,-98.01744 0.84274,-2.37238 1.35887,-4.96865 0.67937,-7.45078 -0.98831,-4.2533 -4.6015,-7.82876 -8.96172,-8.48315 -1.24947,-0.20685 -2.51789,-0.23068 -3.78125,-0.18945 z' /%3E%3Cpath id='bg' style='fill:%23dcdedf;fill-opacity:1;stroke:none;stroke-width:6.4;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal' d='m 214.44922,72.089844 c -20.32611,0.01324 -40.65359,-0.03032 -60.97883,0.03325 -5.06767,0.228794 -9.72081,4.176673 -10.64873,9.186171 -0.54368,2.865585 -0.16202,5.794266 -0.28069,8.688777 -4.6e-4,27.527908 -0.008,55.056498 0.0176,82.583978 0.17186,3.22428 3.44977,5.89016 6.64757,5.28488 2.4037,-0.30447 4.32209,-2.31086 4.87898,-4.61617 3.53052,-10.60549 6.98896,-21.23707 10.60492,-31.81263 1.14174,-2.71356 4.14972,-4.41014 7.06111,-4.12697 16.80704,-0.0631 33.61433,-0.01 50.42149,-0.0279 55.72175,-0.002 111.44406,0.006 167.16547,-0.0191 5.71319,-0.19462 10.82844,-5.25566 10.91838,-11.00339 0.12602,-2.9908 -0.0352,-5.98579 0.0574,-8.97822 0.0534,-2.61272 -0.3941,-5.33067 -1.94259,-7.50013 -2.21535,-3.37352 -6.26106,-5.45808 -10.30253,-5.1988 -44.42303,-0.0315 -88.8461,0.006 -133.26914,-0.0339 -1.35699,0.0355 -2.86726,0.10531 -3.94821,-0.87625 -1.14131,-0.86056 -1.57137,-2.31551 -1.50179,-3.694889 -0.0148,-5.79966 0.0803,-11.603104 -0.0604,-17.400318 -0.41681,-5.210159 -4.80455,-9.807583 -10.02134,-10.361315 -2.37314,-0.240789 -4.76368,-0.0457 -7.14443,-0.12428 -5.89141,-0.0074 -11.78281,-0.0066 -17.67422,-0.0028 z' /%3E%3C/g%3E%3C/svg%3E%0A");
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFA500' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFD700' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFB000' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%23FFD700' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.folders img {
|
||||
.foldericon {
|
||||
content: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 1024 1024' class='icon' version='1.1' xmlns='http://www.w3.org/2000/svg' fill='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0' /%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M853.333333 256H469.333333l-85.333333-85.333333H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v170.666667h853.333334v-85.333334c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%235F9EA0' /%3E%3Cpath d='M853.333333 256H170.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v426.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h682.666666c46.933333 0 85.333333-38.4 85.333334-85.333333V341.333333c0-46.933333-38.4-85.333333-85.333334-85.333333z' fill='%2300CED1' /%3E%3C/g%3E%3C/svg%3E");
|
||||
fill: var(--color1);
|
||||
}
|
||||
|
||||