chore: build
This commit is contained in:
@@ -82,6 +82,8 @@ func DefaultSettings() models.AppSettings {
|
||||
ClientColorSuccess: "#4ade80",
|
||||
ClientColorDanger: "#ef4444",
|
||||
ClientColorWarning: "#f59e0b",
|
||||
ClientTitleGradientFrom: "#a78bfa",
|
||||
ClientTitleGradientTo: "#22d3ee",
|
||||
DeliverySchedule: DefaultDeliverySchedule(),
|
||||
PostalZones: []models.PostalZone{
|
||||
{Name: "Zone 30€", MinAmount: 30, Codes: []string{"44000", "44100", "44200", "44300"}},
|
||||
@@ -193,6 +195,10 @@ func (d *Database) GetSettings() (models.AppSettings, error) {
|
||||
settings.ClientColorDanger = row.Value
|
||||
case "client_color_warning":
|
||||
settings.ClientColorWarning = row.Value
|
||||
case "client_title_gradient_from":
|
||||
settings.ClientTitleGradientFrom = row.Value
|
||||
case "client_title_gradient_to":
|
||||
settings.ClientTitleGradientTo = row.Value
|
||||
}
|
||||
}
|
||||
return settings, nil
|
||||
@@ -293,6 +299,8 @@ func (d *Database) UpdateSettings(s models.AppSettings) error {
|
||||
{"client_color_success", s.ClientColorSuccess},
|
||||
{"client_color_danger", s.ClientColorDanger},
|
||||
{"client_color_warning", s.ClientColorWarning},
|
||||
{"client_title_gradient_from", s.ClientTitleGradientFrom},
|
||||
{"client_title_gradient_to", s.ClientTitleGradientTo},
|
||||
}
|
||||
|
||||
upsert := `INSERT INTO app_settings (key, value) VALUES (?, ?)
|
||||
|
||||
@@ -52,7 +52,9 @@ func GetPublicSettings(c *gin.Context) {
|
||||
"client_color_secondary": settings.ClientColorSecondary,
|
||||
"client_color_success": settings.ClientColorSuccess,
|
||||
"client_color_danger": settings.ClientColorDanger,
|
||||
"client_color_warning": settings.ClientColorWarning,
|
||||
"client_color_warning": settings.ClientColorWarning,
|
||||
"client_title_gradient_from": settings.ClientTitleGradientFrom,
|
||||
"client_title_gradient_to": settings.ClientTitleGradientTo,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -118,4 +118,7 @@ type AppSettings struct {
|
||||
ClientColorSuccess string `json:"client_color_success"`
|
||||
ClientColorDanger string `json:"client_color_danger"`
|
||||
ClientColorWarning string `json:"client_color_warning"`
|
||||
// Dégradé du titre boutique sur le site web client
|
||||
ClientTitleGradientFrom string `json:"client_title_gradient_from"`
|
||||
ClientTitleGradientTo string `json:"client_title_gradient_to"`
|
||||
}
|
||||
|
||||
@@ -1865,6 +1865,8 @@ export interface PublicSettings {
|
||||
client_color_success: string;
|
||||
client_color_danger: string;
|
||||
client_color_warning: string;
|
||||
client_title_gradient_from: string;
|
||||
client_title_gradient_to: string;
|
||||
}
|
||||
|
||||
export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
@@ -1887,6 +1889,8 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
client_color_success: "#22c55e",
|
||||
client_color_danger: "#ef4444",
|
||||
client_color_warning: "#f59e0b",
|
||||
client_title_gradient_from: "#a78bfa",
|
||||
client_title_gradient_to: "#22d3ee",
|
||||
};
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/app-settings`);
|
||||
@@ -1916,6 +1920,8 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
client_color_success: data.client_color_success || "#22c55e",
|
||||
client_color_danger: data.client_color_danger || "#ef4444",
|
||||
client_color_warning: data.client_color_warning || "#f59e0b",
|
||||
client_title_gradient_from: data.client_title_gradient_from || "#a78bfa",
|
||||
client_title_gradient_to: data.client_title_gradient_to || "#22d3ee",
|
||||
};
|
||||
} catch {
|
||||
return defaults;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
--text-muted: #71717a;
|
||||
--radius: 10px;
|
||||
--transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
--title-gradient-from: #a78bfa;
|
||||
--title-gradient-to: #22d3ee;
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
@@ -96,7 +98,7 @@ body {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
background: linear-gradient(135deg, var(--cyan), color-mix(in srgb, var(--cyan) 60%, var(--primary)));
|
||||
background: linear-gradient(135deg, var(--title-gradient-from), var(--title-gradient-to));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
|
||||
@@ -30,6 +30,8 @@ type ColorSettings = {
|
||||
client_color_success: string;
|
||||
client_color_danger: string;
|
||||
client_color_warning: string;
|
||||
client_title_gradient_from: string;
|
||||
client_title_gradient_to: string;
|
||||
};
|
||||
|
||||
function applyClientColors(s: ColorSettings) {
|
||||
@@ -40,7 +42,6 @@ function applyClientColors(s: ColorSettings) {
|
||||
root.style.setProperty("--primary", p);
|
||||
root.style.setProperty("--primary-soft", hexToRgba(p, 0.12));
|
||||
root.style.setProperty("--primary-glow", hexToRgba(p, 0.25));
|
||||
// --bg / --surface / --surface-2 intentionnellement non modifiés : le body garde sa couleur CSS
|
||||
}
|
||||
if (s.client_color_secondary) {
|
||||
root.style.setProperty("--cyan", s.client_color_secondary);
|
||||
@@ -49,6 +50,12 @@ function applyClientColors(s: ColorSettings) {
|
||||
if (s.client_color_danger) {
|
||||
root.style.setProperty("--red", s.client_color_danger);
|
||||
}
|
||||
if (s.client_title_gradient_from) {
|
||||
root.style.setProperty("--title-gradient-from", s.client_title_gradient_from);
|
||||
}
|
||||
if (s.client_title_gradient_to) {
|
||||
root.style.setProperty("--title-gradient-to", s.client_title_gradient_to);
|
||||
}
|
||||
}
|
||||
|
||||
function saveColorsToStorage(s: ColorSettings) {
|
||||
|
||||
Reference in New Issue
Block a user