##~ WIDGET CODE | BY: ANXETY ~## import os import json import time from ipywidgets import widgets from IPython.display import display, HTML, Javascript, clear_output # Setup Env env = os.getenv('ENV_NAME') root_path = os.getenv('ROOT_PATH') webui_path = os.getenv('WEBUI_PATH') free_plan = os.getenv('FREE_PLAN') # ==================== CSS JS ==================== ##~ custom background images V1.5 ~## import argparse parser = argparse.ArgumentParser(description='This script processes an background image.') parser.add_argument('-i', '--image', type=str, help='URL of the image to process', metavar='') parser.add_argument('-o', '--opacity', type=float, help='Opacity level for the image, between 0 and 1', metavar='', default=0.3) parser.add_argument('-b', '--blur', type=str, help='Blur level for the image', metavar='', default=0) parser.add_argument('-y', type=int, help='Y coordinate for the image in px', metavar='', default=0) parser.add_argument('-x', type=int, help='X coordinate for the image in px', metavar='', default=0) parser.add_argument('-s', '--scale', type=int, help='Scale image in %%', metavar='', default=100) parser.add_argument('-m', '--mode', action='store_true', help='Removes repetitive image tiles') parser.add_argument('-t', '--transparent', action='store_true', help='Makes input/selection fields 35%% more transparent') parser.add_argument('-bf', '--blur-fields', type=str, help='Background blur level for input/selection fields', metavar='', default=2) args = parser.parse_args() url_img = args.image opacity_img = args.opacity blur_img = args.blur y_img = args.y x_img = args.x scale_img = args.scale blur_fields = args.blur_fields ## --- """ WTF KAGGLE - WHAT THE FUCK IS THE DIFFERENCE OF 35 PIXELS!?!?!? """ fix_heigh_img = "-810px" if env == "Kaggle" else "-775px" """ transperent fields """ t_bg_alpha = "1" if not args.transparent else "0.65" """ mode img - repeats """ mode_img = "repeat" if not args.mode else "no-repeat" container_background = f''' ")) # Main JS JS = ''' ''' display(HTML(JS)) # ==================== WIDGETS V2 ==================== HR = widgets.HTML('