Change default thumbnail size

Change text color in the upload panel
This commit is contained in:
Michał Gdula 2023-04-03 17:28:28 +00:00
parent ad547c4ccf
commit 33f475e828
5 changed files with 7 additions and 16 deletions

View file

@ -21,7 +21,6 @@ from yaml import safe_load
USER_DIR = platformdirs.user_config_dir('onlylegs')
Bundle.cache = False
def create_app(test_config=None):
@ -38,9 +37,9 @@ def create_app(test_config=None):
print("Loaded environment variables")
# Get config file
with open(os.path.join(USER_DIR, 'conf.yml'), encoding='utf-8') as file:
with open(os.path.join(USER_DIR, 'conf.yml'), encoding='utf-8', mode='r') as file:
conf = safe_load(file)
print("Loaded gallery config")
print("Loaded config")
# App configuration
app.config.from_mapping(
@ -58,6 +57,7 @@ def create_app(test_config=None):
app.config.from_mapping(test_config)
# Load JS assets
# TODO: disable caching for sass files as it makes it hard to work on when it is enabled
assets.register('js_pre', Bundle('js/pre/*.js', output='gen/pre_packed.js'))
assets.register('js_post', Bundle('js/post/*.js', output='gen/post_packed.js'))
assets.register('styles', Bundle('sass/*.sass', filters='libsass', output='gen/styles.css'))

View file

@ -9,6 +9,7 @@
height: 100vh
background-color: transparent
color: RGB($fg-white)
overflow: hidden
z-index: 68
@ -20,9 +21,6 @@
font-size: 1.5rem
font-weight: 700
color: RGB($primary)
p
margin: 0
padding: 0
@ -30,8 +28,6 @@
font-size: 1rem
font-weight: 500
color: RGB($fg-white)
form
margin: 0
padding: 0

View file

@ -91,12 +91,7 @@
</div>
<div class="image-fullscreen" onclick="imageFullscreenOff()">
<img
src=""
alt="{{ image.post_alt }}"
onload="imgFade(this);"
style="opacity:0;"
/>
<img src="" alt="{{ image.post_alt }}"/>
</div>
<div class="image-grid">

View file

@ -136,7 +136,7 @@
<input class="input-block" type="text" placeholder="alt" id="alt"/>
<input class="input-block" type="text" placeholder="description" id="description"/>
<input class="input-block" type="text" placeholder="tags" id="tags"/>
<button class="btn-block primary" type="submit">Upload</button>
<button class="btn-block" type="submit">Upload</button>
</form>
<div class="upload-jobs"></div>
</div>

View file

@ -37,7 +37,7 @@ def generate_thumbnail(file_name, resolution, ext=None):
if resolution in ['prev', 'preview']:
res_x, res_y = (1920, 1080)
elif resolution in ['thumb', 'thumbnail']:
res_x, res_y = (400, 400)
res_x, res_y = (350, 350)
elif resolution in ['icon', 'favicon']:
res_x, res_y = (10, 10)
elif len(resolution.split('x')) == 2: