logo style configuration

This commit is contained in:
perennial
2024-10-24 23:45:37 +11:00
parent 4ebcfe2480
commit 2129a28dd3
6 changed files with 42 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

+8
View File
@@ -8,8 +8,16 @@
</div>
<div class="row justify-content-center g-4">
{{ if CookieList["pixivfe-LogoStyle"] == "" || CookieList["pixivfe-LogoStyle"] == "standard" }}
<h1 class="display-6 fw-semibold text-center">PixivFE</h1>
<span class="text-center text-body-secondary mt-0">An open-source alternative frontend for Pixiv that doesn't suck.</span>
{{- else if CookieList["pixivfe-LogoStyle"] == "alternative" }}
<div class="d-flex justify-content-center">
<img src="/img/logo-alt.gif" alt="PixivFE icon" width="273" height="90" />
</div>
<span class="text-center text-body-secondary mt-0">An open-source alternative frontend for Pixiv that doesn't suck.</span>
{{- end }}
<!-- If the user is not logged in, only show the following non-personalised content -->
<!-- NOTE: the lack of the mode switcher for !.LoggedIn is intentional -->
+7 -1
View File
@@ -84,12 +84,18 @@
</button>
<!-- Icon and title -->
{{ if CookieList["pixivfe-LogoStyle"] == "" || CookieList["pixivfe-LogoStyle"] == "standard" }}
<a href="/">
<img src="/img/favicon.svg" alt="PixivFE icon" width="30" height="30" class="d-inline-block me-2" />
<img src="/img/favicon.svg" alt="PixivFE icon" width="30" height="30" class="me-2" />
</a>
<span class="h2 m-0">
<a class="text-body text-decoration-none mb-0" href="/">PixivFE</a>
</span>
{{- else if CookieList["pixivfe-LogoStyle"] == "alternative" }}
<a href="/">
<img src="/img/logo-alt.gif" alt="PixivFE icon" height="30" />
</a>
{{- end }}
</div>
<!-- Search bar (visible on md and larger devices) -->
+21
View File
@@ -205,6 +205,27 @@
</form>
<div id="form-htmx-target"></div>
</fieldset>
<hr class="my-4">
<fieldset>
<legend class="fs-5 fw-bold">Logo style</legend>
{{- logoStyleValue := CookieList["pixivfe-LogoStyle"] }}
<p>Choose between the standard PixivFE logo or an alternative design created by <a href="https://codeberg.org/VnPower/PixivFE/issues/4#issuecomment-1017835" rel="noopener">@dragongoose</a> as a fun variation.</p>
<form id="locale-form" hx-post="/settings/set-cookie" hx-target="next #form-htmx-target" hx-swap="outerHTML" class="row g-2 me-2">
<input type="hidden" name="key" value="pixivfe-LogoStyle">
<div class="col-auto">
<select class="form-select" id="locale" name="value" required>
<option value="standard" {{- if logoStyleValue == "" }} selected{{- end }}>Standard</option>
<option value="alternative" {{- if logoStyleValue == "alternative" }} selected{{- end }}>Alternative</option>
</select>
</div>
<div class="col-auto">
<button type="submit" class="custom-btn-secondary">Save</button>
</div>
</form>
<div id="form-htmx-target"></div>
</fieldset>
</div>
<!-- Novels tab -->
+4 -2
View File
@@ -429,6 +429,7 @@
"assets/views/settings.jet.html:1cLfPHY51s8": "Artwork preview pop-ups",
"assets/views/settings.jet.html:1hJr_rBgFeQ": "Language",
"assets/views/settings.jet.html:2VDi5AduL6o": "PixivFE token",
"assets/views/settings.jet.html:3E6MT3aTIjs": "Choose the PixivFE logo style.",
"assets/views/settings.jet.html:3shy3hXqe0E": "Typeface samples",
"assets/views/settings.jet.html:3z-JKkAe8g0": "Custom image proxy server",
"assets/views/settings.jet.html:46nKBKI-o3E": ").",
@@ -494,8 +495,8 @@
"assets/views/settings.jet.html:ZejSb38l81A": "Image proxies that fail this check will not be shown unless \"Show all proxy servers\" is enabled.",
"assets/views/settings.jet.html:_p0pNeOT7oo": "Raw settings",
"assets/views/settings.jet.html:_qLO2Kt327w": "Supported features (for now):",
"assets/views/settings.jet.html:g0k22QxjULk": "Select your preferred display language from the dropdown menu below.",
"assets/views/settings.jet.html:hRoKWkl2_fA": "Enter the URL of a custom proxy server if you wish to use one not listed above.",
"assets/views/settings.jet.html:ixWmKG_6a3M": "You can set locale here.",
"assets/views/settings.jet.html:joLFImgCvYE": "Restore your settings if the current instance's cookies have expired",
"assets/views/settings.jet.html:kIl02obBowc": "This area displays all your current cookie values in a raw format. You can:",
"assets/views/settings.jet.html:kQYIzN_2HRw": "Log in",
@@ -506,6 +507,8 @@
"assets/views/settings.jet.html:nPBm25BmDWM": "Reset all preferences",
"assets/views/settings.jet.html:nZN3YxkHJc4": "Landing page",
"assets/views/settings.jet.html:nbyFrPxtlTc": "Open in new tab",
"assets/views/settings.jet.html:p6TYpPXZelQ": "Display language",
"assets/views/settings.jet.html:pSBnV9-B2M8": "Logo style",
"assets/views/settings.jet.html:qYEuq6fGw_o": "not",
"assets/views/settings.jet.html:qq2RUV_bd1c": "This section allows you to directly manage PixivFE's cookie-based preferences. Intended for advanced users who understand the implications of changing these values.",
"assets/views/settings.jet.html:rpFLE9FS29I": "Copy these settings to quickly configure another PixivFE instance",
@@ -519,7 +522,6 @@
"assets/views/settings.jet.html:y6pXNsQLNSg": "Forces the text to be displayed horizontally, left-to-right. This is common for most languages and easier to read on smaller screens or for those more accustomed to Western text layouts.",
"assets/views/settings.jet.html:yEUgkGx647Y": "Choose how images are loaded in PixivFE by selecting either the built-in proxy or one of the provided external proxy servers.",
"assets/views/settings.jet.html:yxY72MHqQiw": "Hide ero-guro content (R-18G)",
"assets/views/settings.jet.html:zYcAaqlhmbM": "Set locale",
"assets/views/settings.jet.html:zwpruJko68c": "Cookie values",
"assets/views/tag.jet.html:-fX2tt6gXnE": "None",
"assets/views/tag.jet.html:1w6l6-nnIE4": "Close",
+2
View File
@@ -21,6 +21,7 @@ const ( // the __Host thing force it to be secure and same-origin (no subdomain)
Cookie_HideArtR18G CookieName = "pixivfe-HideArtR18G"
Cookie_HideArtAI CookieName = "pixivfe-HideArtAI"
Cookie_Locale CookieName = "pixivfe-Locale"
Cookie_LogoStyle CookieName = "pixivfe-LogoStyle"
)
// Go can't make this a const...
@@ -36,6 +37,7 @@ var AllCookieNames []CookieName = []CookieName{
Cookie_HideArtR18G,
Cookie_HideArtAI,
Cookie_Locale,
Cookie_LogoStyle,
}
func GetCookie(r *http.Request, name CookieName) string {