diff --git a/onlylegs/config.py b/onlylegs/config.py index 3300411..a24c24d 100644 --- a/onlylegs/config.py +++ b/onlylegs/config.py @@ -17,41 +17,32 @@ startup.check_conf() # Set dirs APPLICATION_ROOT = platformdirs.user_config_dir("onlylegs") - -# Load environment variables -# print("Loading environment variables...") -load_dotenv(os.path.join(APPLICATION_ROOT, ".env")) - -# Load config from user dir -# print("Loading config...") -with open( - os.path.join(APPLICATION_ROOT, "conf.yml"), encoding="utf-8", mode="r" -) as file: - conf = safe_load(file) - - -# Flask config -SECRET_KEY = os.environ.get("FLASK_SECRET") -DATABASE_NAME = "gallery.sqlite3" -SQLALCHEMY_DATABASE_URI = "sqlite:///" + DATABASE_NAME -MAX_CONTENT_LENGTH = 1024 * 1024 * conf["upload"]["max-size"] -ALLOWED_EXTENSIONS = conf["upload"]["allowed-extensions"] - -# Pass YAML config to app -ADMIN_CONF = conf["admin"] -UPLOAD_CONF = conf["upload"] -WEBSITE_CONF = conf["website"] - -# Directories UPLOAD_FOLDER = os.path.join(APPLICATION_ROOT, "media", "uploads") MEDIA_FOLDER = os.path.join(APPLICATION_ROOT, "media") CACHE_FOLDER = os.path.join(APPLICATION_ROOT, "media", "cache") PFP_FOLDER = os.path.join(APPLICATION_ROOT, "media", "pfp") BANNER_FOLDER = os.path.join(APPLICATION_ROOT, "media", "banner") +# Load env and config files +load_dotenv(os.path.join(APPLICATION_ROOT, ".env")) + +config_file = os.path.join(APPLICATION_ROOT, "conf.yml") +with open(config_file, encoding="utf-8", mode="r") as file: + conf = safe_load(file) + +# Flask config +SECRET_KEY = os.environ.get("FLASK_SECRET") +MAX_CONTENT_LENGTH = 1024 * 1024 * conf["upload"]["max-size"] +ALLOWED_EXTENSIONS = conf["upload"]["allowed-extensions"] +APP_VERSION = importlib.metadata.version("OnlyLegs") + # Database +DATABASE_NAME = "gallery.sqlite3" +SQLALCHEMY_DATABASE_URI = "sqlite:///" + DATABASE_NAME INSTANCE_DIR = os.path.join(APPLICATION_ROOT, "instance") MIGRATIONS_DIR = os.path.join(INSTANCE_DIR, "migrations") -# App -APP_VERSION = importlib.metadata.version("OnlyLegs") +# Pass YAML config to app +ADMIN_CONF = conf["admin"] +UPLOAD_CONF = conf["upload"] +WEBSITE_CONF = conf["website"] diff --git a/onlylegs/static/sass/components/buttons/pill.sass b/onlylegs/static/sass/components/buttons/pill.sass index f63b02e..25fc812 100644 --- a/onlylegs/static/sass/components/buttons/pill.sass +++ b/onlylegs/static/sass/components/buttons/pill.sass @@ -64,12 +64,11 @@ &:hover cursor: pointer - color: var(--primary) - &.disabled, &:disabled - color: var(--foreground-dim) - cursor: unset + &:disabled, &[disabled], &.disabled + color: var(--foreground-gray) + cursor: default .pill__critical color: var(--danger) diff --git a/onlylegs/static/sass/components/image-view.sass b/onlylegs/static/sass/components/image-view.sass index 473bdc6..249f04c 100644 --- a/onlylegs/static/sass/components/image-view.sass +++ b/onlylegs/static/sass/components/image-view.sass @@ -1,5 +1,5 @@ .info-container - padding: 0.5rem 0 0 0.5rem + padding: 0.5rem 0 0.5rem 0.5rem width: 27rem position: absolute top: 0 diff --git a/onlylegs/static/sass/style.sass b/onlylegs/static/sass/style.sass index 19a6ec1..159aa1e 100644 --- a/onlylegs/static/sass/style.sass +++ b/onlylegs/static/sass/style.sass @@ -75,9 +75,11 @@ main main margin: 0 0.5rem -header - position: sticky - top: 0 +// This is very broken, as it breaks when you open any context menu/popup +// I need to fix this at some point as it looks really nice +//header +// position: sticky +// top: 0 .error-page min-height: 100% diff --git a/onlylegs/static/sass/variables.sass b/onlylegs/static/sass/variables.sass index 8f5818f..a31a7bd 100644 --- a/onlylegs/static/sass/variables.sass +++ b/onlylegs/static/sass/variables.sass @@ -26,8 +26,8 @@ --red-transparent: rgba(182, 100, 103, 0.1) --orange: rgb(217, 140, 95) --orange-transparent: rgba(217, 140, 95, 0.1) - --yellow: rgb(217, 188, 140) - --yellow-transparent: rgba(217, 188, 140, 0.1) + --yellow: rgb(198, 185, 166) + --yellow-transparent: rgba(198, 185, 166, 0.1) --green: rgb(140, 151, 125) --green-transparent: rgba(140, 151, 125, 0.1) --blue: rgb(141, 163, 185) diff --git a/onlylegs/templates/base.html b/onlylegs/templates/base.html index 403288f..3fb4855 100644 --- a/onlylegs/templates/base.html +++ b/onlylegs/templates/base.html @@ -28,10 +28,20 @@ {% assets "scripts" %} {% endassets %} {% assets "styles" %} {% endassets %} - {% block head %}{% endblock %} diff --git a/onlylegs/templates/group.html b/onlylegs/templates/group.html index 077ea93..afaec5c 100644 --- a/onlylegs/templates/group.html +++ b/onlylegs/templates/group.html @@ -24,37 +24,6 @@ --background-hsl-hue: {{ images.0.colours.0 | hsl_hue }}; --background-hsl-saturation: {{ images.0.colours.0 | hsl_saturation }}%; } - - /* - body { - color: {{ text_colour }} !important; - } - - .navigation-item.selected { - color: {{ text_colour }} !important; - } - - .banner .banner-content .banner-header, - .banner .banner-content .banner-info, - .banner .banner-content .banner-subtitle { - color: {{ text_colour }} !important; - } - .banner-content .link { - color: rgb{{ images.0.colours.0 }} !important; - } - .banner-content .link:hover { - color: {{ text_colour }} !important; - } - - .banner-filter { - background: linear-gradient(90deg, rgb{{ images.0.colours.0 }}, rgba({{ images.0.colours.1.0 }}, {{ images.0.colours.1.1 }}, {{ images.0.colours.1.2 }}, 0.3)) !important; - } - @media (max-width: 800px) { - .banner-filter { - background: linear-gradient(180deg, rgba({{ images.0.colours.1.0 }}, {{ images.0.colours.1.1 }}, {{ images.0.colours.1.2 }}, 0.4), rgba({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}, 0.3)) !important; - } - } - */ {% endif %} {% endblock %} diff --git a/onlylegs/templates/image.html b/onlylegs/templates/image.html index 2070353..725a363 100644 --- a/onlylegs/templates/image.html +++ b/onlylegs/templates/image.html @@ -18,6 +18,10 @@