feat: animated homepage + split personal/business navigation (#25)
- New animated homepage at / with 3D card tilt, particle canvas, floating ring decorations, and gradient title shimmer - Personal finance pages move to /dashboard (base.html shows only personal nav + a subtle Business link) - Business/org inner pages use base_org.html with a purple theme, org breadcrumb, Year/Team dropdowns, and a ← Hub back link - org home/teams/members/invite/events/requests/ledger/analysis/report all switched to renderOrg() + base_org.html - Route strings updated to org-home, org-teams, org-events, etc. so active nav highlighting works correctly in the business shell Co-authored-by: Gonçalo Rodrigues <guga@Goncalos-MacBook-Pro.local> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1fce3b36aa
commit
541a1c3556
@ -151,6 +151,7 @@ func parseTmpl(files ...string) *template.Template {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
homepageTmpl = parseTmpl("templates/homepage.html")
|
||||||
baseTmpl = parseTmpl("templates/base.html")
|
baseTmpl = parseTmpl("templates/base.html")
|
||||||
dashboardTmpl = parseTmpl("templates/base.html", "templates/dashboard.html")
|
dashboardTmpl = parseTmpl("templates/base.html", "templates/dashboard.html")
|
||||||
txnsTmpl = parseTmpl("templates/base.html", "templates/transactions.html")
|
txnsTmpl = parseTmpl("templates/base.html", "templates/transactions.html")
|
||||||
@ -170,22 +171,23 @@ var (
|
|||||||
peopleTmpl = parseTmpl("templates/base.html", "templates/people.html")
|
peopleTmpl = parseTmpl("templates/base.html", "templates/people.html")
|
||||||
settingsTmpl = parseTmpl("templates/base.html", "templates/settings.html")
|
settingsTmpl = parseTmpl("templates/base.html", "templates/settings.html")
|
||||||
|
|
||||||
// Org
|
// Org — list/create/join stay on personal base; inner org pages use business base
|
||||||
orgListTmpl = parseTmpl("templates/base.html", "templates/org_list.html")
|
orgListTmpl = parseTmpl("templates/base.html", "templates/org_list.html")
|
||||||
orgCreateTmpl = parseTmpl("templates/base.html", "templates/org_create.html")
|
orgCreateTmpl = parseTmpl("templates/base.html", "templates/org_create.html")
|
||||||
orgHomeTmpl = parseTmpl("templates/base.html", "templates/org_home.html")
|
|
||||||
orgTeamsTmpl = parseTmpl("templates/base.html", "templates/org_teams.html")
|
|
||||||
orgMembersTmpl = parseTmpl("templates/base.html", "templates/org_members.html")
|
|
||||||
orgInviteTmpl = parseTmpl("templates/base.html", "templates/org_invite.html")
|
|
||||||
orgJoinTmpl = parseTmpl("templates/base.html", "templates/org_join.html")
|
orgJoinTmpl = parseTmpl("templates/base.html", "templates/org_join.html")
|
||||||
orgEventsTmpl = parseTmpl("templates/base.html", "templates/org_events.html")
|
|
||||||
orgEventDetailTmpl = parseTmpl("templates/base.html", "templates/org_event_detail.html")
|
orgHomeTmpl = parseTmpl("templates/base_org.html", "templates/org_home.html")
|
||||||
orgRequestsTmpl = parseTmpl("templates/base.html", "templates/org_requests.html")
|
orgTeamsTmpl = parseTmpl("templates/base_org.html", "templates/org_teams.html")
|
||||||
orgRequestDetailTmpl = parseTmpl("templates/base.html", "templates/org_request_detail.html")
|
orgMembersTmpl = parseTmpl("templates/base_org.html", "templates/org_members.html")
|
||||||
orgLedgerTmpl = parseTmpl("templates/base.html", "templates/org_ledger.html")
|
orgInviteTmpl = parseTmpl("templates/base_org.html", "templates/org_invite.html")
|
||||||
orgBankImportTmpl = parseTmpl("templates/base.html", "templates/org_bank_import.html")
|
orgEventsTmpl = parseTmpl("templates/base_org.html", "templates/org_events.html")
|
||||||
orgAnalysisTmpl = parseTmpl("templates/base.html", "templates/org_analysis.html")
|
orgEventDetailTmpl = parseTmpl("templates/base_org.html", "templates/org_event_detail.html")
|
||||||
orgReportTmpl = parseTmpl("templates/base.html", "templates/org_report.html")
|
orgRequestsTmpl = parseTmpl("templates/base_org.html", "templates/org_requests.html")
|
||||||
|
orgRequestDetailTmpl = parseTmpl("templates/base_org.html", "templates/org_request_detail.html")
|
||||||
|
orgLedgerTmpl = parseTmpl("templates/base_org.html", "templates/org_ledger.html")
|
||||||
|
orgBankImportTmpl = parseTmpl("templates/base_org.html", "templates/org_bank_import.html")
|
||||||
|
orgAnalysisTmpl = parseTmpl("templates/base_org.html", "templates/org_analysis.html")
|
||||||
|
orgReportTmpl = parseTmpl("templates/base_org.html", "templates/org_report.html")
|
||||||
)
|
)
|
||||||
|
|
||||||
type authInfo struct {
|
type authInfo struct {
|
||||||
@ -218,6 +220,20 @@ func render(w http.ResponseWriter, tmpl *template.Template, data interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func renderOrg(w http.ResponseWriter, tmpl *template.Template, data interface{}) {
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
if err := tmpl.ExecuteTemplate(w, "base_org.html", data); err != nil {
|
||||||
|
slog.Error("template error", "err", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func renderRaw(w http.ResponseWriter, tmpl *template.Template, data interface{}) {
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
if err := tmpl.Execute(w, data); err != nil {
|
||||||
|
slog.Error("template error", "err", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type storeIface interface {
|
type storeIface interface {
|
||||||
getAccounts(ctx context.Context, userID string) ([]Account, error)
|
getAccounts(ctx context.Context, userID string) ([]Account, error)
|
||||||
getAccount(ctx context.Context, id string) (*Account, error)
|
getAccount(ctx context.Context, id string) (*Account, error)
|
||||||
@ -354,6 +370,13 @@ func (h *Handler) ownerOrViewerMW(next http.HandlerFunc) http.HandlerFunc {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *Handler) Homepage(w http.ResponseWriter, r *http.Request) {
|
||||||
|
a := getAuth(r)
|
||||||
|
renderRaw(w, homepageTmpl, map[string]interface{}{
|
||||||
|
"Email": a.Email,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (h *Handler) Dashboard(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) Dashboard(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
a := getAuth(r)
|
a := getAuth(r)
|
||||||
@ -2551,7 +2574,8 @@ func (h *Handler) Settings(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
|
func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
|
||||||
mux.HandleFunc("GET /{$}", h.Dashboard)
|
mux.HandleFunc("GET /{$}", h.Homepage)
|
||||||
|
mux.HandleFunc("GET /dashboard", h.authMW(h.Dashboard))
|
||||||
mux.HandleFunc("GET /transactions", h.Transactions)
|
mux.HandleFunc("GET /transactions", h.Transactions)
|
||||||
mux.HandleFunc("GET /import", h.ImportPage)
|
mux.HandleFunc("GET /import", h.ImportPage)
|
||||||
mux.HandleFunc("POST /import/preview", h.ImportPreview)
|
mux.HandleFunc("POST /import/preview", h.ImportPreview)
|
||||||
|
|||||||
@ -180,11 +180,11 @@ func (h *Handler) OrgHome(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgHomeTmpl, &OrgHomeData{
|
d := &OrgHomeData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name,
|
Title: org.Name,
|
||||||
Route: "orgs",
|
Route: "org-home",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
MyTeamIDs: me.TeamIDs,
|
MyTeamIDs: me.TeamIDs,
|
||||||
@ -192,7 +192,11 @@ func (h *Handler) OrgHome(w http.ResponseWriter, r *http.Request) {
|
|||||||
ActiveYear: active,
|
ActiveYear: active,
|
||||||
Teams: teams,
|
Teams: teams,
|
||||||
Members: members,
|
Members: members,
|
||||||
})
|
}
|
||||||
|
if active != nil {
|
||||||
|
d.FiscalYear = *active
|
||||||
|
}
|
||||||
|
renderOrg(w, orgHomeTmpl, d)
|
||||||
})(w, r)
|
})(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,11 +208,11 @@ func (h *Handler) OrgTeams(w http.ResponseWriter, r *http.Request) {
|
|||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
members, _ := h.store.getMembers(ctx, org.ID)
|
members, _ := h.store.getMembers(ctx, org.ID)
|
||||||
|
|
||||||
render(w, orgTeamsTmpl, &OrgTeamsData{
|
renderOrg(w, orgTeamsTmpl, &OrgTeamsData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Teams",
|
Title: org.Name + " — Teams",
|
||||||
Route: "orgs",
|
Route: "org-teams",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Teams: teams,
|
Teams: teams,
|
||||||
@ -269,11 +273,11 @@ func (h *Handler) OrgMembers(w http.ResponseWriter, r *http.Request) {
|
|||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
invites, _ := h.store.getInvites(ctx, org.ID)
|
invites, _ := h.store.getInvites(ctx, org.ID)
|
||||||
|
|
||||||
render(w, orgMembersTmpl, &OrgMembersData{
|
renderOrg(w, orgMembersTmpl, &OrgMembersData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Members",
|
Title: org.Name + " — Members",
|
||||||
Route: "orgs",
|
Route: "org-members",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Members: members,
|
Members: members,
|
||||||
@ -325,11 +329,11 @@ func (h *Handler) OrgInviteNew(w http.ResponseWriter, r *http.Request) {
|
|||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
|
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
render(w, orgInviteTmpl, &OrgInviteData{
|
renderOrg(w, orgInviteTmpl, &OrgInviteData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: "Invite to " + org.Name,
|
Title: "Invite to " + org.Name,
|
||||||
Route: "orgs",
|
Route: "org-invite",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Teams: teams,
|
Teams: teams,
|
||||||
@ -350,11 +354,11 @@ func (h *Handler) OrgInviteNew(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if errMsg != "" {
|
if errMsg != "" {
|
||||||
render(w, orgInviteTmpl, &OrgInviteData{
|
renderOrg(w, orgInviteTmpl, &OrgInviteData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: "Invite to " + org.Name,
|
Title: "Invite to " + org.Name,
|
||||||
Route: "orgs",
|
Route: "org-invite",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Teams: teams,
|
Teams: teams,
|
||||||
@ -387,11 +391,11 @@ func (h *Handler) OrgInviteNew(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
link := fmt.Sprintf("%s://%s/join/%s", scheme, r.Host, token)
|
link := fmt.Sprintf("%s://%s/join/%s", scheme, r.Host, token)
|
||||||
|
|
||||||
render(w, orgInviteTmpl, &OrgInviteData{
|
renderOrg(w, orgInviteTmpl, &OrgInviteData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: "Invite to " + org.Name,
|
Title: "Invite to " + org.Name,
|
||||||
Route: "orgs",
|
Route: "org-invite",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Teams: teams,
|
Teams: teams,
|
||||||
@ -581,11 +585,11 @@ func (h *Handler) OrgEventList(w http.ResponseWriter, r *http.Request) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgEventsTmpl, &OrgEventsData{
|
renderOrg(w, orgEventsTmpl, &OrgEventsData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Events",
|
Title: org.Name + " — Events",
|
||||||
Route: "orgs",
|
Route: "org-events",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: *year,
|
FiscalYear: *year,
|
||||||
@ -608,11 +612,11 @@ func (h *Handler) OrgEventNew(w http.ResponseWriter, r *http.Request) {
|
|||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
|
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
render(w, orgEventDetailTmpl, &OrgEventDetailData{
|
renderOrg(w, orgEventDetailTmpl, &OrgEventDetailData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: "New Event",
|
Title: "New Event",
|
||||||
Route: "orgs",
|
Route: "org-event-detail",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: *year,
|
FiscalYear: *year,
|
||||||
@ -699,11 +703,11 @@ func (h *Handler) OrgEventDetail(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgEventDetailTmpl, &OrgEventDetailData{
|
renderOrg(w, orgEventDetailTmpl, &OrgEventDetailData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: ev.Name,
|
Title: ev.Name,
|
||||||
Route: "orgs",
|
Route: "org-event-detail",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: *year,
|
FiscalYear: *year,
|
||||||
@ -1066,11 +1070,11 @@ func (h *Handler) OrgRequestList(w http.ResponseWriter, r *http.Request) {
|
|||||||
events, _ := h.store.getEvents(ctx, org.ID, "")
|
events, _ := h.store.getEvents(ctx, org.ID, "")
|
||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
|
|
||||||
render(w, orgRequestsTmpl, &OrgRequestsData{
|
renderOrg(w, orgRequestsTmpl, &OrgRequestsData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Requests",
|
Title: org.Name + " — Requests",
|
||||||
Route: "orgs",
|
Route: "org-requests",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Requests: requests,
|
Requests: requests,
|
||||||
@ -1096,11 +1100,11 @@ func (h *Handler) OrgRequestNew(w http.ResponseWriter, r *http.Request) {
|
|||||||
teams, _ := h.store.getTeams(ctx, org.ID)
|
teams, _ := h.store.getTeams(ctx, org.ID)
|
||||||
|
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
render(w, orgRequestDetailTmpl, &OrgRequestDetailData{
|
renderOrg(w, orgRequestDetailTmpl, &OrgRequestDetailData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: "New Request",
|
Title: "New Request",
|
||||||
Route: "orgs",
|
Route: "org-requests",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: activeYear,
|
FiscalYear: activeYear,
|
||||||
@ -1203,11 +1207,11 @@ func (h *Handler) OrgRequestDetail(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
attachments, _ := h.store.getAttachments(ctx, reqID, org.ID)
|
attachments, _ := h.store.getAttachments(ctx, reqID, org.ID)
|
||||||
|
|
||||||
render(w, orgRequestDetailTmpl, &OrgRequestDetailData{
|
renderOrg(w, orgRequestDetailTmpl, &OrgRequestDetailData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: string(req.Type) + " Request",
|
Title: string(req.Type) + " Request",
|
||||||
Route: "orgs",
|
Route: "org-requests",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
Request: *req,
|
Request: *req,
|
||||||
@ -1578,11 +1582,11 @@ func (h *Handler) OrgLedger(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgLedgerTmpl, &OrgLedgerData{
|
renderOrg(w, orgLedgerTmpl, &OrgLedgerData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Ledger",
|
Title: org.Name + " — Ledger",
|
||||||
Route: "orgs",
|
Route: "org-ledger",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: fy,
|
FiscalYear: fy,
|
||||||
@ -1603,11 +1607,11 @@ func (h *Handler) OrgBankImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
activeYear, _ := h.store.getActiveFiscalYear(ctx, org.ID)
|
activeYear, _ := h.store.getActiveFiscalYear(ctx, org.ID)
|
||||||
|
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
render(w, orgBankImportTmpl, &OrgBankImportData{
|
renderOrg(w, orgBankImportTmpl, &OrgBankImportData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"),
|
UserID: r.Header.Get("X-Auth-User-Id"),
|
||||||
Email: r.Header.Get("X-Auth-Email"),
|
Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Bank Import",
|
Title: org.Name + " — Bank Import",
|
||||||
Route: "orgs",
|
Route: "org-ledger",
|
||||||
Org: *org,
|
Org: *org,
|
||||||
MyRole: me.Role,
|
MyRole: me.Role,
|
||||||
FiscalYear: activeYear,
|
FiscalYear: activeYear,
|
||||||
@ -1628,9 +1632,9 @@ func (h *Handler) OrgBankImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
rows, err := parseBankCSV(file)
|
rows, err := parseBankCSV(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
render(w, orgBankImportTmpl, &OrgBankImportData{
|
renderOrg(w, orgBankImportTmpl, &OrgBankImportData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Bank Import", Route: "orgs",
|
Title: org.Name + " — Bank Import", Route: "org-ledger",
|
||||||
Org: *org, MyRole: me.Role, FiscalYear: activeYear,
|
Org: *org, MyRole: me.Role, FiscalYear: activeYear,
|
||||||
Error: "could not parse CSV: " + err.Error(),
|
Error: "could not parse CSV: " + err.Error(),
|
||||||
})
|
})
|
||||||
@ -1639,9 +1643,9 @@ func (h *Handler) OrgBankImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if r.FormValue("confirm") != "1" {
|
if r.FormValue("confirm") != "1" {
|
||||||
// preview mode
|
// preview mode
|
||||||
render(w, orgBankImportTmpl, &OrgBankImportData{
|
renderOrg(w, orgBankImportTmpl, &OrgBankImportData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Bank Import", Route: "orgs",
|
Title: org.Name + " — Bank Import", Route: "org-ledger",
|
||||||
Org: *org, MyRole: me.Role, FiscalYear: activeYear,
|
Org: *org, MyRole: me.Role, FiscalYear: activeYear,
|
||||||
Rows: rows,
|
Rows: rows,
|
||||||
})
|
})
|
||||||
@ -1674,9 +1678,9 @@ func (h *Handler) OrgBankImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
imported++
|
imported++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render(w, orgBankImportTmpl, &OrgBankImportData{
|
renderOrg(w, orgBankImportTmpl, &OrgBankImportData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Bank Import", Route: "orgs",
|
Title: org.Name + " — Bank Import", Route: "org-ledger",
|
||||||
Org: *org, MyRole: me.Role, FiscalYear: fy,
|
Org: *org, MyRole: me.Role, FiscalYear: fy,
|
||||||
Imported: imported,
|
Imported: imported,
|
||||||
})
|
})
|
||||||
@ -1780,9 +1784,9 @@ func (h *Handler) OrgAnalysis(w http.ResponseWriter, r *http.Request) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgAnalysisTmpl, &OrgAnalysisData{
|
renderOrg(w, orgAnalysisTmpl, &OrgAnalysisData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — Analysis", Route: "orgs",
|
Title: org.Name + " — Analysis", Route: "org-analysis",
|
||||||
Org: *org, MyRole: me.Role, FiscalYear: *year, FiscalYears: years,
|
Org: *org, MyRole: me.Role, FiscalYear: *year, FiscalYears: years,
|
||||||
EventRows: eventRows, TeamRows: teamRows,
|
EventRows: eventRows, TeamRows: teamRows,
|
||||||
TotalPlannedIncome: totalPI, TotalActualIncome: totalAI,
|
TotalPlannedIncome: totalPI, TotalActualIncome: totalAI,
|
||||||
@ -1864,9 +1868,9 @@ func (h *Handler) OrgReport(w http.ResponseWriter, r *http.Request) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render(w, orgReportTmpl, &OrgReportData{
|
renderOrg(w, orgReportTmpl, &OrgReportData{
|
||||||
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
UserID: r.Header.Get("X-Auth-User-Id"), Email: r.Header.Get("X-Auth-Email"),
|
||||||
Title: org.Name + " — " + year.Label + " Report", Route: "orgs",
|
Title: org.Name + " — " + year.Label + " Report", Route: "org-report",
|
||||||
Org: *org, MyRole: me.Role, FiscalYear: *year, FiscalYears: years,
|
Org: *org, MyRole: me.Role, FiscalYear: *year, FiscalYears: years,
|
||||||
EventReports: eventReports,
|
EventReports: eventReports,
|
||||||
TotalPlannedIncome: totalPI, TotalActualIncome: totalAI,
|
TotalPlannedIncome: totalPI, TotalActualIncome: totalAI,
|
||||||
|
|||||||
@ -328,6 +328,7 @@ type OrgHomeData struct {
|
|||||||
MyTeamIDs []string
|
MyTeamIDs []string
|
||||||
FiscalYears []FiscalYear
|
FiscalYears []FiscalYear
|
||||||
ActiveYear *FiscalYear
|
ActiveYear *FiscalYear
|
||||||
|
FiscalYear FiscalYear // populated from ActiveYear for base_org.html nav
|
||||||
Teams []OrgTeam
|
Teams []OrgTeam
|
||||||
Members []OrgMember
|
Members []OrgMember
|
||||||
}
|
}
|
||||||
|
|||||||
@ -570,11 +570,11 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<a href="/" class="nav-brand">
|
<a href="/dashboard" class="nav-brand">
|
||||||
<div class="nav-brand-icon">₣</div>
|
<div class="nav-brand-icon">₣</div>
|
||||||
Finance
|
Personal
|
||||||
</a>
|
</a>
|
||||||
<a href="/" class="{{if eq .Route "dashboard"}}active{{end}}">Dashboard</a>
|
<a href="/dashboard" class="{{if eq .Route "dashboard"}}active{{end}}">Dashboard</a>
|
||||||
<a href="/transactions" class="{{if eq .Route "transactions"}}active{{end}}">Transactions</a>
|
<a href="/transactions" class="{{if eq .Route "transactions"}}active{{end}}">Transactions</a>
|
||||||
<a href="/portfolio" class="{{if eq .Route "portfolio"}}active{{end}}">Portfolio</a>
|
<a href="/portfolio" class="{{if eq .Route "portfolio"}}active{{end}}">Portfolio</a>
|
||||||
<a href="/goals" class="{{if eq .Route "goals"}}active{{end}}">Goals</a>
|
<a href="/goals" class="{{if eq .Route "goals"}}active{{end}}">Goals</a>
|
||||||
@ -595,7 +595,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="/people" class="{{if eq .Route "people"}}active{{end}}">People</a>
|
<a href="/people" class="{{if eq .Route "people"}}active{{end}}">People</a>
|
||||||
<a href="/orgs" class="{{if eq .Route "orgs"}}active{{end}}">Organisations</a>
|
|
||||||
|
|
||||||
{{$settingsActive := or (eq .Route "settings") (eq .Route "auto-import")}}
|
{{$settingsActive := or (eq .Route "settings") (eq .Route "auto-import")}}
|
||||||
<div class="nav-group">
|
<div class="nav-group">
|
||||||
@ -609,6 +608,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-spacer"></div>
|
<div class="nav-spacer"></div>
|
||||||
|
<a href="/orgs" style="font-size:12px; color:var(--text3); padding:5px 9px; border:1px solid var(--border); border-radius:var(--radius-sm); text-decoration:none; transition:all 0.18s;" onmouseover="this.style.color='var(--text2)';this.style.borderColor='var(--border2)'" onmouseout="this.style.color='var(--text3)';this.style.borderColor='var(--border)'">🏢 Business</a>
|
||||||
<span class="nav-email">{{.Email}}</span>
|
<span class="nav-email">{{.Email}}</span>
|
||||||
<button class="theme-btn" id="theme-toggle" title="Toggle dark/light mode">🌙</button>
|
<button class="theme-btn" id="theme-toggle" title="Toggle dark/light mode">🌙</button>
|
||||||
<button class="nav-hamburger" id="nav-hamburger" aria-label="Menu">
|
<button class="nav-hamburger" id="nav-hamburger" aria-label="Menu">
|
||||||
@ -618,12 +618,11 @@
|
|||||||
|
|
||||||
<!-- Mobile drawer -->
|
<!-- Mobile drawer -->
|
||||||
<div class="nav-drawer" id="nav-drawer">
|
<div class="nav-drawer" id="nav-drawer">
|
||||||
<a href="/" class="{{if eq .Route "dashboard"}}active{{end}}">Dashboard</a>
|
<a href="/dashboard" class="{{if eq .Route "dashboard"}}active{{end}}">Dashboard</a>
|
||||||
<a href="/transactions" class="{{if eq .Route "transactions"}}active{{end}}">Transactions</a>
|
<a href="/transactions" class="{{if eq .Route "transactions"}}active{{end}}">Transactions</a>
|
||||||
<a href="/portfolio" class="{{if eq .Route "portfolio"}}active{{end}}">Portfolio</a>
|
<a href="/portfolio" class="{{if eq .Route "portfolio"}}active{{end}}">Portfolio</a>
|
||||||
<a href="/goals" class="{{if eq .Route "goals"}}active{{end}}">Goals</a>
|
<a href="/goals" class="{{if eq .Route "goals"}}active{{end}}">Goals</a>
|
||||||
<a href="/people" class="{{if eq .Route "people"}}active{{end}}">People</a>
|
<a href="/people" class="{{if eq .Route "people"}}active{{end}}">People</a>
|
||||||
<a href="/orgs" class="{{if eq .Route "orgs"}}active{{end}}">Organisations</a>
|
|
||||||
<hr>
|
<hr>
|
||||||
<span class="nav-drawer-section-label">Analysis</span>
|
<span class="nav-drawer-section-label">Analysis</span>
|
||||||
<a href="/reports" class="{{if eq .Route "reports"}}active{{end}}">Reports</a>
|
<a href="/reports" class="{{if eq .Route "reports"}}active{{end}}">Reports</a>
|
||||||
@ -636,6 +635,9 @@
|
|||||||
<a href="/settings?tab=accounts" class="{{if eq .Route "settings"}}active{{end}}">Accounts & Categories</a>
|
<a href="/settings?tab=accounts" class="{{if eq .Route "settings"}}active{{end}}">Accounts & Categories</a>
|
||||||
<a href="/import" class="{{if eq .Route "import"}}active{{end}}">Import CSV</a>
|
<a href="/import" class="{{if eq .Route "import"}}active{{end}}">Import CSV</a>
|
||||||
<a href="/auto-import" class="{{if eq .Route "auto-import"}}active{{end}}">Import Guide</a>
|
<a href="/auto-import" class="{{if eq .Route "auto-import"}}active{{end}}">Import Guide</a>
|
||||||
|
<hr>
|
||||||
|
<a href="/orgs">🏢 Business</a>
|
||||||
|
<a href="/">← Hub</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
612
apps/finance/services/api/main/templates/base_org.html
Normal file
612
apps/finance/services/api/main/templates/base_org.html
Normal file
@ -0,0 +1,612 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-theme="dark">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{if .Title}}{{.Title}} — {{end}}Business · Finance Hub</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"></script>
|
||||||
|
<style>
|
||||||
|
/* ── Tokens (business purple theme) ─────────────────────────────── */
|
||||||
|
:root {
|
||||||
|
--bg: #07080f;
|
||||||
|
--bg2: #0d0f1c;
|
||||||
|
--bg3: #121526;
|
||||||
|
--surface: rgba(13, 15, 28, 0.88);
|
||||||
|
--surface2: rgba(20, 22, 42, 0.75);
|
||||||
|
--border: rgba(124,58,237,0.09);
|
||||||
|
--border2: rgba(124,58,237,0.18);
|
||||||
|
--text: #ede8ff;
|
||||||
|
--text2: #9d8fc0;
|
||||||
|
--text3: #4a3f6e;
|
||||||
|
--accent: #7c3aed;
|
||||||
|
--accent2: #a855f7;
|
||||||
|
--accent-glow: rgba(124,58,237,0.22);
|
||||||
|
--green: #34d399;
|
||||||
|
--red: #f87171;
|
||||||
|
--green-dim: rgba(52,211,153,0.12);
|
||||||
|
--red-dim: rgba(248,113,113,0.13);
|
||||||
|
--shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
|
||||||
|
--shadow-md: 0 4px 16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
|
||||||
|
--shadow-lg: 0 12px 40px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.5);
|
||||||
|
--radius: 14px;
|
||||||
|
--radius-sm: 8px;
|
||||||
|
--nav-h: 58px;
|
||||||
|
}
|
||||||
|
[data-theme="light"] {
|
||||||
|
--bg: #f0eeff;
|
||||||
|
--bg2: #e4dffd;
|
||||||
|
--bg3: #d8d0fa;
|
||||||
|
--surface: rgba(255,255,255,0.92);
|
||||||
|
--surface2: rgba(237,235,255,0.85);
|
||||||
|
--border: rgba(100,40,200,0.1);
|
||||||
|
--border2: rgba(100,40,200,0.18);
|
||||||
|
--text: #1a0d35;
|
||||||
|
--text2: #4a2d8a;
|
||||||
|
--text3: #9b7fcc;
|
||||||
|
--accent: #6d28d9;
|
||||||
|
--accent2: #7c3aed;
|
||||||
|
--accent-glow: rgba(109,40,217,0.15);
|
||||||
|
--green: #059669;
|
||||||
|
--red: #dc2626;
|
||||||
|
--green-dim: rgba(5,150,105,0.1);
|
||||||
|
--red-dim: rgba(220,38,38,0.1);
|
||||||
|
--shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
|
||||||
|
--shadow-md: 0 4px 16px rgba(0,0,0,0.09);
|
||||||
|
--shadow-lg: 0 12px 40px rgba(0,0,0,0.11);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Reset & base ────────────────────────────────────────────────── */
|
||||||
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
html { scroll-behavior: smooth; }
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
line-height: 1.5;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
transition: background 0.3s ease, color 0.3s ease;
|
||||||
|
}
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background-image:
|
||||||
|
radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,58,237,0.07) 0%, transparent 60%),
|
||||||
|
radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168,85,247,0.04) 0%, transparent 55%);
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
body > * { position: relative; z-index: 1; }
|
||||||
|
|
||||||
|
/* ── Animations ──────────────────────────────────────────────────── */
|
||||||
|
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
|
||||||
|
@keyframes slideIn { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }
|
||||||
|
@keyframes shimmer { 0% { background-position:-200% center; } 100% { background-position:200% center; } }
|
||||||
|
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }
|
||||||
|
@keyframes spin { to { transform:rotate(360deg); } }
|
||||||
|
|
||||||
|
/* ── Nav ─────────────────────────────────────────────────────────── */
|
||||||
|
.nav {
|
||||||
|
height: var(--nav-h);
|
||||||
|
background: rgba(10,8,20,0.88);
|
||||||
|
backdrop-filter: blur(16px) saturate(180%);
|
||||||
|
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 28px;
|
||||||
|
gap: 4px;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 200;
|
||||||
|
box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0,0,0,0.3);
|
||||||
|
}
|
||||||
|
[data-theme="light"] .nav {
|
||||||
|
background: rgba(238,235,255,0.9);
|
||||||
|
box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0,0,0,0.08);
|
||||||
|
}
|
||||||
|
.nav-brand {
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-right: 4px;
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
.nav-brand-icon {
|
||||||
|
width: 28px; height: 28px;
|
||||||
|
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||||
|
border-radius: 7px;
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
box-shadow: 0 2px 8px var(--accent-glow);
|
||||||
|
}
|
||||||
|
.nav-divider {
|
||||||
|
width: 1px; height: 20px;
|
||||||
|
background: var(--border2);
|
||||||
|
margin: 0 8px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.nav-breadcrumb {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text3);
|
||||||
|
text-decoration: none;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.nav-breadcrumb span {
|
||||||
|
color: var(--text);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.nav a:not(.nav-brand):not(.nav-breadcrumb) {
|
||||||
|
color: var(--text2);
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 13.5px;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
transition: all 0.18s ease;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.nav a:not(.nav-brand):not(.nav-breadcrumb):hover { color: var(--text); background: var(--surface2); }
|
||||||
|
.nav a.active { color: var(--accent2); background: var(--accent-glow); }
|
||||||
|
.nav-spacer { flex: 1; }
|
||||||
|
|
||||||
|
.nav-hub {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
color: var(--text3) !important;
|
||||||
|
font-size: 12px !important;
|
||||||
|
padding: 5px 9px !important;
|
||||||
|
border: 1px solid var(--border) !important;
|
||||||
|
border-radius: var(--radius-sm) !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
transition: all 0.18s ease !important;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
.nav-hub:hover { color: var(--text2) !important; border-color: var(--border2) !important; background: var(--surface2) !important; }
|
||||||
|
|
||||||
|
/* ── Nav dropdown ─────────────────────────────────────────────────── */
|
||||||
|
.nav-group { position: relative; }
|
||||||
|
.nav-group-btn {
|
||||||
|
display: flex; align-items: center; gap: 4px;
|
||||||
|
color: var(--text2);
|
||||||
|
font-size: 13.5px; font-weight: 500;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
border: none; background: none; cursor: pointer;
|
||||||
|
transition: all 0.18s ease; white-space: nowrap;
|
||||||
|
}
|
||||||
|
.nav-group-btn:hover { color: var(--text); background: var(--surface2); }
|
||||||
|
.nav-group-btn.active { color: var(--accent2); background: var(--accent-glow); }
|
||||||
|
.nav-group-btn svg { width:10px; height:10px; transition: transform 0.18s ease; }
|
||||||
|
.nav-group:hover .nav-group-btn svg { transform: rotate(180deg); }
|
||||||
|
.nav-dropdown {
|
||||||
|
display: none;
|
||||||
|
position: absolute; top: calc(100% + 6px); left: 0;
|
||||||
|
background: var(--surface);
|
||||||
|
border: 1px solid var(--border2);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
box-shadow: var(--shadow-md);
|
||||||
|
min-width: 160px;
|
||||||
|
z-index: 200;
|
||||||
|
padding: 6px;
|
||||||
|
flex-direction: column; gap: 2px;
|
||||||
|
}
|
||||||
|
.nav-group:hover .nav-dropdown { display: flex; }
|
||||||
|
.nav-dropdown a {
|
||||||
|
display: block;
|
||||||
|
padding: 7px 12px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
font-size: 13px; font-weight: 500;
|
||||||
|
color: var(--text2); text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
transition: all 0.15s ease;
|
||||||
|
}
|
||||||
|
.nav-dropdown a:hover { color: var(--text); background: var(--surface2); }
|
||||||
|
.nav-dropdown a.active { color: var(--accent2); background: var(--accent-glow); }
|
||||||
|
.nav-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
|
||||||
|
|
||||||
|
.nav-email { font-size: 12px; color: var(--text3); padding: 0 8px; }
|
||||||
|
.theme-btn {
|
||||||
|
width: 34px; height: 34px;
|
||||||
|
border-radius: 9px;
|
||||||
|
border: 1px solid var(--border2);
|
||||||
|
background: var(--surface2);
|
||||||
|
color: var(--text2);
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 15px;
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
transition: all 0.18s ease;
|
||||||
|
}
|
||||||
|
.theme-btn:hover { color: var(--text); background: var(--bg3); transform: scale(1.05); }
|
||||||
|
|
||||||
|
/* ── Layout ──────────────────────────────────────────────────────── */
|
||||||
|
.container {
|
||||||
|
max-width: 1240px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 28px 24px 48px;
|
||||||
|
animation: fadeUp 0.4s ease-out both;
|
||||||
|
}
|
||||||
|
h1 { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; }
|
||||||
|
|
||||||
|
/* ── Cards ───────────────────────────────────────────────────────── */
|
||||||
|
.card {
|
||||||
|
background: var(--surface);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
padding: 22px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
-webkit-backdrop-filter: blur(8px);
|
||||||
|
transition: box-shadow 0.2s ease, border-color 0.2s ease;
|
||||||
|
}
|
||||||
|
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border2); }
|
||||||
|
.card h2 {
|
||||||
|
font-size: 11px; font-weight: 600; color: var(--text3);
|
||||||
|
text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.card .value { font-size: 30px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.1; }
|
||||||
|
.value-card { position: relative; overflow: hidden; }
|
||||||
|
.value-card::before {
|
||||||
|
content: ''; position: absolute; inset: 0; border-radius: var(--radius);
|
||||||
|
background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.value-card::after {
|
||||||
|
content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
|
||||||
|
background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
|
||||||
|
border-radius: var(--radius) var(--radius) 0 0;
|
||||||
|
background-size: 200% auto;
|
||||||
|
animation: shimmer 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Colour utilities ────────────────────────────────────────────── */
|
||||||
|
.positive { color: var(--green); }
|
||||||
|
.negative { color: var(--red); }
|
||||||
|
|
||||||
|
/* ── Grid ────────────────────────────────────────────────────────── */
|
||||||
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
|
||||||
|
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
|
||||||
|
|
||||||
|
/* ── Tables ──────────────────────────────────────────────────────── */
|
||||||
|
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
|
||||||
|
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
|
||||||
|
th {
|
||||||
|
text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 600;
|
||||||
|
color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px;
|
||||||
|
border-bottom: 1px solid var(--border2); white-space: nowrap;
|
||||||
|
}
|
||||||
|
td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
|
||||||
|
tbody tr { transition: background 0.12s ease; }
|
||||||
|
tbody tr:hover td { background: var(--surface2); }
|
||||||
|
tbody tr:last-child td { border-bottom: none; }
|
||||||
|
.cents { text-align: right; font-variant-numeric: tabular-nums; }
|
||||||
|
|
||||||
|
/* ── Buttons ─────────────────────────────────────────────────────── */
|
||||||
|
.btn {
|
||||||
|
display: inline-flex; align-items: center; gap: 5px;
|
||||||
|
padding: 8px 16px; border-radius: var(--radius-sm);
|
||||||
|
font-size: 13.5px; font-weight: 500;
|
||||||
|
border: none; cursor: pointer; text-decoration: none;
|
||||||
|
transition: all 0.18s ease; white-space: nowrap; line-height: 1;
|
||||||
|
}
|
||||||
|
.btn:hover { transform: translateY(-1px); }
|
||||||
|
.btn:active { transform: translateY(0); }
|
||||||
|
.btn-primary {
|
||||||
|
background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 2px 10px var(--accent-glow);
|
||||||
|
}
|
||||||
|
.btn-primary:hover { box-shadow: 0 4px 18px var(--accent-glow); }
|
||||||
|
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
|
||||||
|
.btn-danger:hover { background: rgba(248,113,113,0.25); }
|
||||||
|
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text2); }
|
||||||
|
.btn-outline:hover { background: var(--surface2); color: var(--text); border-color: var(--accent); }
|
||||||
|
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
|
||||||
|
|
||||||
|
/* ── Forms ───────────────────────────────────────────────────────── */
|
||||||
|
.form-group { margin-bottom: 14px; }
|
||||||
|
.form-group label {
|
||||||
|
display: block; font-size: 12px; font-weight: 600;
|
||||||
|
color: var(--text2); margin-bottom: 5px; letter-spacing: 0.3px;
|
||||||
|
}
|
||||||
|
.form-label {
|
||||||
|
display: block; font-size: 11px; font-weight: 700;
|
||||||
|
color: var(--text3); margin-bottom: 5px; letter-spacing: 0.05em; text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.form-group input, .form-group select, .form-group textarea, .form-input {
|
||||||
|
width: 100%; padding: 9px 12px;
|
||||||
|
border: 1px solid var(--border2); border-radius: var(--radius-sm);
|
||||||
|
font-size: 13.5px; background: var(--bg2); color: var(--text);
|
||||||
|
transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
|
||||||
|
outline: none; box-sizing: border-box; font-family: inherit;
|
||||||
|
}
|
||||||
|
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-input:focus {
|
||||||
|
border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--bg3);
|
||||||
|
}
|
||||||
|
.form-group input::placeholder, .form-input::placeholder { color: var(--text3); opacity: 0.7; }
|
||||||
|
.form-input[type="file"] { padding: 7px 10px; cursor: pointer; color: var(--text2); }
|
||||||
|
.form-input[type="file"]::-webkit-file-upload-button {
|
||||||
|
background: var(--bg3); border: 1px solid var(--border2); border-radius: 4px;
|
||||||
|
color: var(--text2); font-size: 12px; padding: 4px 10px; margin-right: 10px; cursor: pointer; font-family: inherit;
|
||||||
|
}
|
||||||
|
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=reset]):not([type=hidden]):not([type=color]),
|
||||||
|
select, textarea {
|
||||||
|
background: var(--bg2); color: var(--text); border-color: var(--border2); font-family: inherit;
|
||||||
|
}
|
||||||
|
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=reset]):not([type=hidden]):not([type=color]):focus,
|
||||||
|
select:focus, textarea:focus {
|
||||||
|
outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
|
||||||
|
}
|
||||||
|
input::placeholder, textarea::placeholder { color: var(--text3); opacity: 0.7; }
|
||||||
|
select option { background: var(--bg2); color: var(--text); }
|
||||||
|
input[type="color"] { padding: 4px; height: 38px; cursor: pointer; }
|
||||||
|
.form-input option { background: var(--bg2); color: var(--text); }
|
||||||
|
textarea.form-input { resize: vertical; min-height: 72px; line-height: 1.5; }
|
||||||
|
|
||||||
|
/* Team avatars */
|
||||||
|
.team-avatar {
|
||||||
|
display: inline-flex; align-items: center; justify-content: center;
|
||||||
|
width: 32px; height: 32px; border-radius: 8px; font-size: 17px; line-height: 1;
|
||||||
|
flex-shrink: 0; background: var(--bg3); border: 1px solid var(--border2); user-select: none;
|
||||||
|
}
|
||||||
|
.team-avatar-sm { width: 22px; height: 22px; border-radius: 5px; font-size: 12px; }
|
||||||
|
.team-avatar-lg { width: 48px; height: 48px; border-radius: 12px; font-size: 26px; }
|
||||||
|
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||||
|
.emoji-opt {
|
||||||
|
width: 36px; height: 36px; border-radius: 8px; border: 2px solid transparent;
|
||||||
|
background: var(--bg3); font-size: 18px; cursor: pointer;
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
transition: border-color 0.12s, background 0.12s;
|
||||||
|
}
|
||||||
|
.emoji-opt:hover { background: var(--surface2); }
|
||||||
|
.emoji-opt.selected { border-color: var(--accent); background: var(--accent-glow); }
|
||||||
|
|
||||||
|
/* ── Badges ──────────────────────────────────────────────────────── */
|
||||||
|
.badge {
|
||||||
|
display: inline-flex; align-items: center; gap: 5px;
|
||||||
|
padding: 3px 10px; border-radius: 20px;
|
||||||
|
font-size: 11.5px; font-weight: 600; letter-spacing: 0.2px;
|
||||||
|
}
|
||||||
|
.category-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
|
||||||
|
|
||||||
|
/* ── Empty states ────────────────────────────────────────────────── */
|
||||||
|
.empty-state { text-align: center; padding: 52px 24px; }
|
||||||
|
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.4; }
|
||||||
|
.empty-state p { font-size: 14px; color: var(--text3); }
|
||||||
|
.empty-state h3 { font-size: 17px; color: var(--text2); margin-bottom: 8px; }
|
||||||
|
|
||||||
|
/* ── Misc utils ──────────────────────────────────────────────────── */
|
||||||
|
.flex { display: flex; gap: 8px; align-items: center; }
|
||||||
|
.flex-wrap { flex-wrap: wrap; }
|
||||||
|
.mb-16 { margin-bottom: 16px; }
|
||||||
|
.mb-8 { margin-bottom: 8px; }
|
||||||
|
.mt-16 { margin-top: 16px; }
|
||||||
|
.text-center { text-align: center; }
|
||||||
|
.text-right { text-align: right; }
|
||||||
|
.text-muted { color: var(--text3); font-size: 12px; }
|
||||||
|
.error { color: var(--red); font-size: 13px; margin-bottom: 12px; }
|
||||||
|
.success { color: var(--green); font-size: 13px; margin-bottom: 12px; }
|
||||||
|
|
||||||
|
/* ── Modals ──────────────────────────────────────────────────────── */
|
||||||
|
.modal-backdrop {
|
||||||
|
display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65);
|
||||||
|
backdrop-filter: blur(4px); z-index: 500; align-items: center; justify-content: center;
|
||||||
|
}
|
||||||
|
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); }
|
||||||
|
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
|
||||||
|
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
|
||||||
|
|
||||||
|
/* ── Scroll-reveal ───────────────────────────────────────────────── */
|
||||||
|
.animate-on-scroll {
|
||||||
|
opacity: 0; transform: translateY(18px);
|
||||||
|
transition: opacity 0.5s ease-out, transform 0.5s ease-out;
|
||||||
|
}
|
||||||
|
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
|
||||||
|
.animate-on-scroll:nth-child(2) { transition-delay: 0.07s; }
|
||||||
|
.animate-on-scroll:nth-child(3) { transition-delay: 0.14s; }
|
||||||
|
.animate-on-scroll:nth-child(4) { transition-delay: 0.21s; }
|
||||||
|
.animate-on-scroll:nth-child(5) { transition-delay: 0.28s; }
|
||||||
|
|
||||||
|
/* ── Hamburger / mobile ──────────────────────────────────────────── */
|
||||||
|
.nav-hamburger {
|
||||||
|
display: none; width: 36px; height: 36px;
|
||||||
|
border: none; background: none; cursor: pointer; color: var(--text2);
|
||||||
|
flex-direction: column; justify-content: center; align-items: center; gap: 5px;
|
||||||
|
border-radius: var(--radius-sm); transition: background 0.18s;
|
||||||
|
}
|
||||||
|
.nav-hamburger:hover { background: var(--surface2); }
|
||||||
|
.nav-hamburger span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.25s ease, opacity 0.25s ease; }
|
||||||
|
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
|
||||||
|
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
|
||||||
|
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
|
||||||
|
.nav-drawer {
|
||||||
|
display: none; position: fixed; inset: var(--nav-h) 0 0 0;
|
||||||
|
background: var(--bg); z-index: 199; overflow-y: auto;
|
||||||
|
padding: 12px 16px 32px; flex-direction: column; gap: 4px; animation: slideIn 0.2s ease-out both;
|
||||||
|
}
|
||||||
|
.nav-drawer.open { display: flex; }
|
||||||
|
.nav-drawer a, .nav-drawer-section-label {
|
||||||
|
display: block; padding: 11px 14px; border-radius: var(--radius-sm);
|
||||||
|
font-size: 15px; font-weight: 500; color: var(--text2); text-decoration: none; transition: all 0.15s;
|
||||||
|
}
|
||||||
|
.nav-drawer a:hover { color: var(--text); background: var(--surface2); }
|
||||||
|
.nav-drawer a.active { color: var(--accent2); background: var(--accent-glow); }
|
||||||
|
.nav-drawer-section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); padding-top: 16px; padding-bottom: 4px; }
|
||||||
|
.nav-drawer hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
|
||||||
|
|
||||||
|
/* ── Responsive ──────────────────────────────────────────────────── */
|
||||||
|
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.nav-hamburger { display: flex; }
|
||||||
|
.nav > a:not(.nav-brand):not(.nav-hub),
|
||||||
|
.nav > .nav-group, .nav > .nav-spacer,
|
||||||
|
.nav > .nav-divider, .nav > .nav-breadcrumb,
|
||||||
|
.nav-email { display: none; }
|
||||||
|
.container { padding: 16px 12px 32px; }
|
||||||
|
.grid { grid-template-columns: 1fr 1fr; }
|
||||||
|
.card { padding: 16px; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="nav">
|
||||||
|
<!-- Hub link -->
|
||||||
|
<a href="/" class="nav-hub">← Hub</a>
|
||||||
|
|
||||||
|
<!-- Brand -->
|
||||||
|
<a href="/orgs" class="nav-brand">
|
||||||
|
<div class="nav-brand-icon">🏢</div>
|
||||||
|
Business
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{{if .Org.Slug}}
|
||||||
|
<div class="nav-divider"></div>
|
||||||
|
<!-- Org breadcrumb -->
|
||||||
|
<a href="/orgs/{{.Org.Slug}}" class="nav-breadcrumb"><span>{{.Org.Name}}</span></a>
|
||||||
|
<div class="nav-divider"></div>
|
||||||
|
|
||||||
|
<!-- Org nav links -->
|
||||||
|
<a href="/orgs/{{.Org.Slug}}" class="{{if eq .Route "org-home"}}active{{end}}">Overview</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/requests" class="{{if eq .Route "org-requests"}}active{{end}}">Requests</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/ledger" class="{{if eq .Route "org-ledger"}}active{{end}}">Ledger</a>
|
||||||
|
|
||||||
|
{{with .FiscalYear}}{{if .ID}}
|
||||||
|
<div class="nav-group">
|
||||||
|
<button class="nav-group-btn {{if or (eq $.Route "org-events") (eq $.Route "org-event-detail") (eq $.Route "org-analysis") (eq $.Route "org-report")}}active{{end}}">
|
||||||
|
Year <svg viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M1 1l4 4 4-4"/></svg>
|
||||||
|
</button>
|
||||||
|
<div class="nav-dropdown">
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/events" class="{{if or (eq $.Route "org-events") (eq $.Route "org-event-detail")}}active{{end}}">Events</a>
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/analysis" class="{{if eq $.Route "org-analysis"}}active{{end}}">Analysis</a>
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/report" class="{{if eq $.Route "org-report"}}active{{end}}">Report</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}{{end}}
|
||||||
|
|
||||||
|
<div class="nav-group">
|
||||||
|
<button class="nav-group-btn {{if or (eq .Route "org-teams") (eq .Route "org-members")}}active{{end}}">
|
||||||
|
Team <svg viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M1 1l4 4 4-4"/></svg>
|
||||||
|
</button>
|
||||||
|
<div class="nav-dropdown">
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/teams" class="{{if eq .Route "org-teams"}}active{{end}}">Teams</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/members" class="{{if eq .Route "org-members"}}active{{end}}">Members</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<div class="nav-spacer"></div>
|
||||||
|
<span class="nav-email">{{.Email}}</span>
|
||||||
|
<button class="theme-btn" id="theme-toggle" title="Toggle dark/light mode">🌙</button>
|
||||||
|
<button class="nav-hamburger" id="nav-hamburger" aria-label="Menu">
|
||||||
|
<span></span><span></span><span></span>
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- Mobile drawer -->
|
||||||
|
<div class="nav-drawer" id="nav-drawer">
|
||||||
|
<a href="/">← Hub</a>
|
||||||
|
<a href="/orgs" class="{{if eq .Route "org-list"}}active{{end}}">Organisations</a>
|
||||||
|
{{if .Org.Slug}}
|
||||||
|
<hr>
|
||||||
|
<span class="nav-drawer-section-label">{{.Org.Name}}</span>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}" class="{{if eq .Route "org-home"}}active{{end}}">Overview</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/requests" class="{{if eq .Route "org-requests"}}active{{end}}">Requests</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/ledger" class="{{if eq .Route "org-ledger"}}active{{end}}">Ledger</a>
|
||||||
|
{{with .FiscalYear}}{{if .ID}}
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/events" class="{{if or (eq $.Route "org-events") (eq $.Route "org-event-detail")}}active{{end}}">Events</a>
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/analysis" class="{{if eq $.Route "org-analysis"}}active{{end}}">Analysis</a>
|
||||||
|
<a href="/orgs/{{$.Org.Slug}}/years/{{.ID}}/report" class="{{if eq $.Route "org-report"}}active{{end}}">Report</a>
|
||||||
|
{{end}}{{end}}
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/teams" class="{{if eq .Route "org-teams"}}active{{end}}">Teams</a>
|
||||||
|
<a href="/orgs/{{.Org.Slug}}/members" class="{{if eq .Route "org-members"}}active{{end}}">Members</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
{{block "content" .}}{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/* ── Theme toggle ─────────────────────────────────────────────── */
|
||||||
|
const html = document.documentElement;
|
||||||
|
const btn = document.getElementById('theme-toggle');
|
||||||
|
function applyTheme(t) {
|
||||||
|
html.setAttribute('data-theme', t);
|
||||||
|
btn.textContent = t === 'dark' ? '☀️' : '🌙';
|
||||||
|
localStorage.setItem('theme', t);
|
||||||
|
}
|
||||||
|
const saved = localStorage.getItem('theme') ||
|
||||||
|
(window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark');
|
||||||
|
applyTheme(saved);
|
||||||
|
btn.addEventListener('click', () =>
|
||||||
|
applyTheme(html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'));
|
||||||
|
|
||||||
|
/* ── Mobile hamburger ─────────────────────────────────────────── */
|
||||||
|
const hamburger = document.getElementById('nav-hamburger');
|
||||||
|
const drawer = document.getElementById('nav-drawer');
|
||||||
|
hamburger.addEventListener('click', () => {
|
||||||
|
const open = drawer.classList.toggle('open');
|
||||||
|
hamburger.classList.toggle('open', open);
|
||||||
|
document.body.style.overflow = open ? 'hidden' : '';
|
||||||
|
});
|
||||||
|
drawer.querySelectorAll('a').forEach(a =>
|
||||||
|
a.addEventListener('click', () => {
|
||||||
|
drawer.classList.remove('open');
|
||||||
|
hamburger.classList.remove('open');
|
||||||
|
document.body.style.overflow = '';
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
/* ── Animated counter ─────────────────────────────────────────── */
|
||||||
|
function animateCounter(el) {
|
||||||
|
const target = parseFloat(el.getAttribute('data-target'));
|
||||||
|
const prefix = el.getAttribute('data-prefix') || '';
|
||||||
|
const duration = parseInt(el.getAttribute('data-duration')) || 900;
|
||||||
|
const start = performance.now();
|
||||||
|
function step(now) {
|
||||||
|
const t = Math.min((now - start) / duration, 1);
|
||||||
|
const e = 1 - Math.pow(1 - t, 3);
|
||||||
|
const v = target * e;
|
||||||
|
const abs = Math.abs(v);
|
||||||
|
const sign = v < 0 ? '−' : (target > 0 ? '+' : '');
|
||||||
|
el.textContent = prefix + sign + (abs / 100).toLocaleString('pt-PT', {minimumFractionDigits:2, maximumFractionDigits:2});
|
||||||
|
if (t < 1) requestAnimationFrame(step);
|
||||||
|
}
|
||||||
|
requestAnimationFrame(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Scroll reveal ────────────────────────────────────────────── */
|
||||||
|
const io = new IntersectionObserver((entries) => {
|
||||||
|
entries.forEach(entry => {
|
||||||
|
if (!entry.isIntersecting) return;
|
||||||
|
entry.target.classList.add('visible');
|
||||||
|
entry.target.querySelectorAll('.animate-counter').forEach(c => {
|
||||||
|
if (!c.dataset.counted) { c.dataset.counted = '1'; animateCounter(c); }
|
||||||
|
});
|
||||||
|
io.unobserve(entry.target);
|
||||||
|
});
|
||||||
|
}, { threshold: 0.08 });
|
||||||
|
document.querySelectorAll('.animate-on-scroll').forEach(el => io.observe(el));
|
||||||
|
|
||||||
|
/* ── Chart.js defaults ────────────────────────────────────────── */
|
||||||
|
if (typeof Chart !== 'undefined') {
|
||||||
|
function getThemeColor(v) {
|
||||||
|
const dark = html.getAttribute('data-theme') === 'dark';
|
||||||
|
return { gridColor: dark ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.06)', textColor: dark ? '#5c6585' : '#9fa8c7' }[v];
|
||||||
|
}
|
||||||
|
Chart.defaults.color = () => getThemeColor('textColor');
|
||||||
|
Chart.defaults.borderColor = () => getThemeColor('gridColor');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
734
apps/finance/services/api/main/templates/homepage.html
Normal file
734
apps/finance/services/api/main/templates/homepage.html
Normal file
@ -0,0 +1,734 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Finance Hub</title>
|
||||||
|
<style>
|
||||||
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
html { scroll-behavior: smooth; }
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--bg: #050810;
|
||||||
|
--text: #e8f4f2;
|
||||||
|
--text2: #8ab4b0;
|
||||||
|
--text3: #3d6e6a;
|
||||||
|
--teal: #00c9b8;
|
||||||
|
--teal2: #33d9ca;
|
||||||
|
--teal-glow:rgba(0,201,184,0.25);
|
||||||
|
--purple: #7c3aed;
|
||||||
|
--purple2: #a855f7;
|
||||||
|
--purple-glow:rgba(124,58,237,0.25);
|
||||||
|
--border: rgba(255,255,255,0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
overflow-x: hidden;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Canvas background ─────────────────────────────────────────── */
|
||||||
|
#bg-canvas {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Gradient orbs ─────────────────────────────────────────────── */
|
||||||
|
.orb {
|
||||||
|
position: fixed;
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: blur(100px);
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 0;
|
||||||
|
animation: orb-drift 12s ease-in-out infinite alternate;
|
||||||
|
}
|
||||||
|
.orb-1 {
|
||||||
|
width: 600px; height: 600px;
|
||||||
|
background: radial-gradient(circle, rgba(0,201,184,0.12) 0%, transparent 70%);
|
||||||
|
top: -200px; left: -100px;
|
||||||
|
animation-delay: 0s;
|
||||||
|
}
|
||||||
|
.orb-2 {
|
||||||
|
width: 800px; height: 800px;
|
||||||
|
background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
|
||||||
|
bottom: -300px; right: -200px;
|
||||||
|
animation-delay: -4s;
|
||||||
|
}
|
||||||
|
.orb-3 {
|
||||||
|
width: 400px; height: 400px;
|
||||||
|
background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
|
||||||
|
top: 40%; left: 40%;
|
||||||
|
animation-delay: -8s;
|
||||||
|
}
|
||||||
|
@keyframes orb-drift {
|
||||||
|
from { transform: translate(0, 0) scale(1); }
|
||||||
|
to { transform: translate(40px, 30px) scale(1.08); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Page wrapper ──────────────────────────────────────────────── */
|
||||||
|
.page {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 24px 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Nav bar ───────────────────────────────────────────────────── */
|
||||||
|
.topbar {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1200px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 24px 0;
|
||||||
|
}
|
||||||
|
.topbar-logo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text);
|
||||||
|
text-decoration: none;
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
.topbar-logo-icon {
|
||||||
|
width: 36px; height: 36px;
|
||||||
|
background: linear-gradient(135deg, var(--teal), var(--purple2));
|
||||||
|
border-radius: 10px;
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
font-size: 18px;
|
||||||
|
box-shadow: 0 0 20px rgba(0,201,184,0.3), 0 0 40px rgba(124,58,237,0.2);
|
||||||
|
animation: logo-pulse 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
@keyframes logo-pulse {
|
||||||
|
0%,100% { box-shadow: 0 0 20px rgba(0,201,184,0.3), 0 0 40px rgba(124,58,237,0.2); }
|
||||||
|
50% { box-shadow: 0 0 30px rgba(0,201,184,0.5), 0 0 60px rgba(124,58,237,0.35); }
|
||||||
|
}
|
||||||
|
.topbar-email {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text3);
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Hero ──────────────────────────────────────────────────────── */
|
||||||
|
.hero {
|
||||||
|
text-align: center;
|
||||||
|
padding: 80px 0 60px;
|
||||||
|
max-width: 700px;
|
||||||
|
animation: fadeUp 0.8s ease-out both;
|
||||||
|
}
|
||||||
|
.hero-badge {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.15em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--teal);
|
||||||
|
background: rgba(0,201,184,0.08);
|
||||||
|
border: 1px solid rgba(0,201,184,0.2);
|
||||||
|
padding: 5px 14px;
|
||||||
|
border-radius: 100px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
animation: badge-glow 2.5s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
@keyframes badge-glow {
|
||||||
|
0%,100% { box-shadow: 0 0 0 rgba(0,201,184,0); }
|
||||||
|
50% { box-shadow: 0 0 16px rgba(0,201,184,0.3); }
|
||||||
|
}
|
||||||
|
.hero-title {
|
||||||
|
font-size: clamp(48px, 8vw, 80px);
|
||||||
|
font-weight: 800;
|
||||||
|
letter-spacing: -2px;
|
||||||
|
line-height: 1.0;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
background: linear-gradient(135deg, #fff 0%, var(--teal) 45%, var(--purple2) 80%, #fff 100%);
|
||||||
|
background-size: 200% auto;
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
animation: title-shimmer 6s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes title-shimmer {
|
||||||
|
0% { background-position: 0% center; }
|
||||||
|
100% { background-position: 200% center; }
|
||||||
|
}
|
||||||
|
.hero-sub {
|
||||||
|
font-size: 18px;
|
||||||
|
color: var(--text2);
|
||||||
|
line-height: 1.6;
|
||||||
|
max-width: 480px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Stats row ─────────────────────────────────────────────────── */
|
||||||
|
.stats-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 48px;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 0 60px;
|
||||||
|
animation: fadeUp 0.8s 0.15s ease-out both;
|
||||||
|
}
|
||||||
|
.stat {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.stat-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.stat-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text3);
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Products grid ─────────────────────────────────────────────── */
|
||||||
|
.products {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 24px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
animation: fadeUp 0.8s 0.25s ease-out both;
|
||||||
|
perspective: 1200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Product card ──────────────────────────────────────────────── */
|
||||||
|
.product-card {
|
||||||
|
position: relative;
|
||||||
|
background: rgba(13,18,28,0.7);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 36px 32px 32px;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform 0.08s ease-out, box-shadow 0.3s ease;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
will-change: transform;
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.product-card:hover {
|
||||||
|
box-shadow: 0 30px 80px rgba(0,0,0,0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* animated corner glow */
|
||||||
|
.product-card::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: -1px;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 1px;
|
||||||
|
background: var(--card-gradient, linear-gradient(135deg, transparent, transparent));
|
||||||
|
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
||||||
|
-webkit-mask-composite: xor;
|
||||||
|
mask-composite: exclude;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
.product-card:hover::before { opacity: 1; }
|
||||||
|
|
||||||
|
/* inner glow blob */
|
||||||
|
.card-glow {
|
||||||
|
position: absolute;
|
||||||
|
width: 200px; height: 200px;
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: blur(60px);
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.4s ease;
|
||||||
|
pointer-events: none;
|
||||||
|
top: -60px; left: -60px;
|
||||||
|
}
|
||||||
|
.product-card:hover .card-glow { opacity: 1; }
|
||||||
|
|
||||||
|
/* teal card */
|
||||||
|
.card-personal {
|
||||||
|
--card-gradient: linear-gradient(135deg, var(--teal), transparent, var(--teal2));
|
||||||
|
animation: float-a 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.card-personal .card-glow { background: radial-gradient(circle, var(--teal-glow), transparent); }
|
||||||
|
.card-personal::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0; right: 0;
|
||||||
|
width: 120px; height: 120px;
|
||||||
|
background: radial-gradient(circle, rgba(0,201,184,0.08), transparent);
|
||||||
|
border-radius: 50%;
|
||||||
|
transform: translate(30%, 30%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* purple card */
|
||||||
|
.card-business {
|
||||||
|
--card-gradient: linear-gradient(135deg, var(--purple), transparent, var(--purple2));
|
||||||
|
animation: float-b 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.card-business .card-glow { background: radial-gradient(circle, var(--purple-glow), transparent); }
|
||||||
|
.card-business::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0; right: 0;
|
||||||
|
width: 120px; height: 120px;
|
||||||
|
background: radial-gradient(circle, rgba(124,58,237,0.08), transparent);
|
||||||
|
border-radius: 50%;
|
||||||
|
transform: translate(30%, 30%);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes float-a {
|
||||||
|
0%,100% { transform: translateY(0px); }
|
||||||
|
50% { transform: translateY(-10px); }
|
||||||
|
}
|
||||||
|
@keyframes float-b {
|
||||||
|
0%,100% { transform: translateY(-6px); }
|
||||||
|
50% { transform: translateY(6px); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
.card-icon {
|
||||||
|
width: 52px; height: 52px;
|
||||||
|
border-radius: 14px;
|
||||||
|
display: flex; align-items: center; justify-content: center;
|
||||||
|
font-size: 24px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.card-personal .card-icon {
|
||||||
|
background: rgba(0,201,184,0.12);
|
||||||
|
border: 1px solid rgba(0,201,184,0.2);
|
||||||
|
box-shadow: 0 0 20px rgba(0,201,184,0.15);
|
||||||
|
}
|
||||||
|
.card-business .card-icon {
|
||||||
|
background: rgba(124,58,237,0.12);
|
||||||
|
border: 1px solid rgba(124,58,237,0.2);
|
||||||
|
box-shadow: 0 0 20px rgba(124,58,237,0.15);
|
||||||
|
}
|
||||||
|
.card-title {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: -0.4px;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.card-label {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.card-personal .card-label { color: var(--teal); }
|
||||||
|
.card-business .card-label { color: var(--purple2); }
|
||||||
|
|
||||||
|
.card-desc {
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--text2);
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* feature list */
|
||||||
|
.feature-list {
|
||||||
|
list-style: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.feature-list li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text2);
|
||||||
|
}
|
||||||
|
.feature-list li::before {
|
||||||
|
content: '';
|
||||||
|
width: 5px; height: 5px;
|
||||||
|
border-radius: 50%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.card-personal .feature-list li::before { background: var(--teal); }
|
||||||
|
.card-business .feature-list li::before { background: var(--purple2); }
|
||||||
|
|
||||||
|
/* CTA button */
|
||||||
|
.card-cta {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
margin-top: 4px;
|
||||||
|
align-self: flex-start;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.card-cta::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(255,255,255,0.08);
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s ease;
|
||||||
|
}
|
||||||
|
.card-cta:hover::before { opacity: 1; }
|
||||||
|
.card-personal .card-cta {
|
||||||
|
background: linear-gradient(135deg, var(--teal), var(--teal2));
|
||||||
|
color: #050810;
|
||||||
|
box-shadow: 0 4px 20px rgba(0,201,184,0.35);
|
||||||
|
}
|
||||||
|
.card-personal .card-cta:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 8px 30px rgba(0,201,184,0.5);
|
||||||
|
}
|
||||||
|
.card-business .card-cta {
|
||||||
|
background: linear-gradient(135deg, var(--purple), var(--purple2));
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 4px 20px rgba(124,58,237,0.35);
|
||||||
|
}
|
||||||
|
.card-business .card-cta:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 8px 30px rgba(124,58,237,0.5);
|
||||||
|
}
|
||||||
|
.cta-arrow {
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
.card-cta:hover .cta-arrow { transform: translateX(4px); }
|
||||||
|
|
||||||
|
/* ── Divider ───────────────────────────────────────────────────── */
|
||||||
|
.divider {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
height: 1px;
|
||||||
|
background: linear-gradient(90deg, transparent, var(--border), transparent);
|
||||||
|
margin: 64px 0 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Features row ──────────────────────────────────────────────── */
|
||||||
|
.features {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 16px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
animation: fadeUp 0.8s 0.35s ease-out both;
|
||||||
|
}
|
||||||
|
.feature-chip {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 16px 18px;
|
||||||
|
background: rgba(255,255,255,0.025);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 14px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text2);
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.feature-chip:hover {
|
||||||
|
background: rgba(255,255,255,0.04);
|
||||||
|
border-color: rgba(255,255,255,0.1);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.feature-chip-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Footer ────────────────────────────────────────────────────── */
|
||||||
|
.footer {
|
||||||
|
margin-top: 80px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text3);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Animations ────────────────────────────────────────────────── */
|
||||||
|
@keyframes fadeUp {
|
||||||
|
from { opacity: 0; transform: translateY(24px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Responsive ────────────────────────────────────────────────── */
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.products { grid-template-columns: 1fr; }
|
||||||
|
.features { grid-template-columns: 1fr 1fr; }
|
||||||
|
.stats-row { gap: 24px; }
|
||||||
|
.hero { padding: 50px 0 40px; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Particle canvas background -->
|
||||||
|
<canvas id="bg-canvas"></canvas>
|
||||||
|
|
||||||
|
<!-- Gradient orbs -->
|
||||||
|
<div class="orb orb-1"></div>
|
||||||
|
<div class="orb orb-2"></div>
|
||||||
|
<div class="orb orb-3"></div>
|
||||||
|
|
||||||
|
<div class="page">
|
||||||
|
|
||||||
|
<!-- Top bar -->
|
||||||
|
<div class="topbar">
|
||||||
|
<a href="/" class="topbar-logo">
|
||||||
|
<div class="topbar-logo-icon">₣</div>
|
||||||
|
Finance Hub
|
||||||
|
</a>
|
||||||
|
{{if .Email}}<span class="topbar-email">{{.Email}}</span>{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Hero -->
|
||||||
|
<section class="hero">
|
||||||
|
<div class="hero-badge">Your Financial Universe</div>
|
||||||
|
<h1 class="hero-title">Finance Hub</h1>
|
||||||
|
<p class="hero-sub">One platform for managing personal wealth and business finances — beautifully unified.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Stats -->
|
||||||
|
<div class="stats-row">
|
||||||
|
<div class="stat">
|
||||||
|
<div class="stat-value">2</div>
|
||||||
|
<div class="stat-label">Products</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat">
|
||||||
|
<div class="stat-value">∞</div>
|
||||||
|
<div class="stat-label">Organisations</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat">
|
||||||
|
<div class="stat-value">100%</div>
|
||||||
|
<div class="stat-label">Self-hosted</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Product cards -->
|
||||||
|
<div class="products" id="products">
|
||||||
|
|
||||||
|
<a href="/dashboard" class="product-card card-personal" id="card-personal">
|
||||||
|
<div class="card-glow"></div>
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="card-icon">🏦</div>
|
||||||
|
<div>
|
||||||
|
<div class="card-label">Personal</div>
|
||||||
|
<div class="card-title">My Finance</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="card-desc">Track spending, grow wealth, plan your future with full visibility into your personal finances.</p>
|
||||||
|
<ul class="feature-list">
|
||||||
|
<li>Dashboard & spending analytics</li>
|
||||||
|
<li>Transactions & auto-import</li>
|
||||||
|
<li>Investment portfolio</li>
|
||||||
|
<li>Financial goals</li>
|
||||||
|
<li>Net worth & projections</li>
|
||||||
|
<li>Tax reports</li>
|
||||||
|
</ul>
|
||||||
|
<span class="card-cta">Open Personal <span class="cta-arrow">→</span></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="/orgs" class="product-card card-business" id="card-business">
|
||||||
|
<div class="card-glow"></div>
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="card-icon">🏢</div>
|
||||||
|
<div>
|
||||||
|
<div class="card-label">Business</div>
|
||||||
|
<div class="card-title">Organisations</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="card-desc">Manage organisations, plan events, control budgets, and keep your teams aligned financially.</p>
|
||||||
|
<ul class="feature-list">
|
||||||
|
<li>Multi-org & teams</li>
|
||||||
|
<li>Events & budget planning</li>
|
||||||
|
<li>Purchase requests & approvals</li>
|
||||||
|
<li>Ledger & bank imports</li>
|
||||||
|
<li>Variance analysis</li>
|
||||||
|
<li>End-of-year reports</li>
|
||||||
|
</ul>
|
||||||
|
<span class="card-cta">Open Business <span class="cta-arrow">→</span></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<!-- Feature chips -->
|
||||||
|
<div class="features">
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">🔒</span> Self-hosted & private</div>
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">🌙</span> Dark & light themes</div>
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">📊</span> Real-time analytics</div>
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">🏦</span> Multi-bank support</div>
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">👥</span> Role-based access</div>
|
||||||
|
<div class="feature-chip"><span class="feature-chip-icon">📅</span> Fiscal year lifecycle</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer">Finance Hub · Self-hosted homelab</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/* ── Particle canvas ─────────────────────────────────────────── */
|
||||||
|
(function() {
|
||||||
|
const canvas = document.getElementById('bg-canvas');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
let W, H, pts;
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
W = canvas.width = window.innerWidth;
|
||||||
|
H = canvas.height = window.innerHeight;
|
||||||
|
}
|
||||||
|
resize();
|
||||||
|
window.addEventListener('resize', () => { resize(); });
|
||||||
|
|
||||||
|
const N = 60;
|
||||||
|
function initPts() {
|
||||||
|
pts = Array.from({ length: N }, () => ({
|
||||||
|
x: Math.random() * W,
|
||||||
|
y: Math.random() * H,
|
||||||
|
vx: (Math.random() - 0.5) * 0.35,
|
||||||
|
vy: (Math.random() - 0.5) * 0.35,
|
||||||
|
r: Math.random() * 1.8 + 0.6,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
initPts();
|
||||||
|
|
||||||
|
let mouse = { x: W / 2, y: H / 2 };
|
||||||
|
window.addEventListener('mousemove', e => { mouse.x = e.clientX; mouse.y = e.clientY; });
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
ctx.clearRect(0, 0, W, H);
|
||||||
|
|
||||||
|
for (let p of pts) {
|
||||||
|
p.x += p.vx;
|
||||||
|
p.y += p.vy;
|
||||||
|
if (p.x < 0 || p.x > W) p.vx *= -1;
|
||||||
|
if (p.y < 0 || p.y > H) p.vy *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LINK = 140;
|
||||||
|
for (let i = 0; i < pts.length; i++) {
|
||||||
|
for (let j = i + 1; j < pts.length; j++) {
|
||||||
|
const dx = pts[i].x - pts[j].x;
|
||||||
|
const dy = pts[i].y - pts[j].y;
|
||||||
|
const d = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
if (d < LINK) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(pts[i].x, pts[i].y);
|
||||||
|
ctx.lineTo(pts[j].x, pts[j].y);
|
||||||
|
ctx.strokeStyle = `rgba(0,201,184,${0.06 * (1 - d / LINK)})`;
|
||||||
|
ctx.lineWidth = 0.8;
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// mouse proximity glow
|
||||||
|
const mdx = pts[i].x - mouse.x;
|
||||||
|
const mdy = pts[i].y - mouse.y;
|
||||||
|
const md = Math.sqrt(mdx * mdx + mdy * mdy);
|
||||||
|
if (md < 160) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(pts[i].x, pts[i].y, pts[i].r * 2.5, 0, Math.PI * 2);
|
||||||
|
ctx.fillStyle = `rgba(124,58,237,${0.7 * (1 - md / 160)})`;
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(pts[i].x, pts[i].y, pts[i].r, 0, Math.PI * 2);
|
||||||
|
ctx.fillStyle = 'rgba(0,201,184,0.35)';
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
requestAnimationFrame(draw);
|
||||||
|
}
|
||||||
|
draw();
|
||||||
|
})();
|
||||||
|
|
||||||
|
/* ── 3D card tilt on mousemove ───────────────────────────────── */
|
||||||
|
(function() {
|
||||||
|
const cards = document.querySelectorAll('.product-card');
|
||||||
|
const MAX_TILT = 12;
|
||||||
|
|
||||||
|
cards.forEach(card => {
|
||||||
|
card.addEventListener('mousemove', e => {
|
||||||
|
const rect = card.getBoundingClientRect();
|
||||||
|
const cx = rect.left + rect.width / 2;
|
||||||
|
const cy = rect.top + rect.height / 2;
|
||||||
|
const dx = (e.clientX - cx) / (rect.width / 2);
|
||||||
|
const dy = (e.clientY - cy) / (rect.height / 2);
|
||||||
|
const rx = -dy * MAX_TILT;
|
||||||
|
const ry = dx * MAX_TILT;
|
||||||
|
card.style.transform = `perspective(900px) rotateX(${rx}deg) rotateY(${ry}deg) translateZ(8px)`;
|
||||||
|
});
|
||||||
|
card.addEventListener('mouseleave', () => {
|
||||||
|
card.style.transform = '';
|
||||||
|
card.style.transition = 'transform 0.5s ease, box-shadow 0.3s ease';
|
||||||
|
setTimeout(() => card.style.transition = '', 500);
|
||||||
|
});
|
||||||
|
card.addEventListener('mouseenter', () => {
|
||||||
|
card.style.transition = 'transform 0.08s ease-out, box-shadow 0.3s ease';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
|
/* ── 3D rotating ring decoration ────────────────────────────── */
|
||||||
|
(function() {
|
||||||
|
// subtle CSS 3D ring animation injected dynamically
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.textContent = `
|
||||||
|
@keyframes ring-spin {
|
||||||
|
from { transform: rotateX(70deg) rotateZ(0deg); }
|
||||||
|
to { transform: rotateX(70deg) rotateZ(360deg); }
|
||||||
|
}
|
||||||
|
.ring {
|
||||||
|
position: fixed;
|
||||||
|
width: 400px; height: 400px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid rgba(0,201,184,0.08);
|
||||||
|
top: 50%; left: 50%;
|
||||||
|
margin: -200px 0 0 -200px;
|
||||||
|
animation: ring-spin 20s linear infinite;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
.ring:nth-child(2) {
|
||||||
|
width: 600px; height: 600px;
|
||||||
|
margin: -300px 0 0 -300px;
|
||||||
|
border-color: rgba(124,58,237,0.05);
|
||||||
|
animation-duration: 32s;
|
||||||
|
animation-direction: reverse;
|
||||||
|
}
|
||||||
|
.ring:nth-child(3) {
|
||||||
|
width: 240px; height: 240px;
|
||||||
|
margin: -120px 0 0 -120px;
|
||||||
|
border-color: rgba(168,85,247,0.1);
|
||||||
|
animation-duration: 14s;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
const container = document.createElement('div');
|
||||||
|
container.style.cssText = 'position:fixed;inset:0;z-index:0;pointer-events:none;perspective:800px;';
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
const r = document.createElement('div');
|
||||||
|
r.className = 'ring';
|
||||||
|
container.appendChild(r);
|
||||||
|
}
|
||||||
|
document.body.appendChild(container);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user