Фикс стилей
This commit is contained in:
parent
e849e705c3
commit
a20e2ace25
7 changed files with 30 additions and 22 deletions
|
@ -21,18 +21,16 @@ templ Layout(params HeaderParams) {
|
|||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/"><strong>ШОргРу</strong></a></li>
|
||||
</ul>
|
||||
<ul hx-boost="true" hx-indicator=".loader">
|
||||
<div class="header">
|
||||
<a href="/"><strong>ШОргРу</strong></a>
|
||||
<div class="top-menu" hx-boost="true" hx-indicator=".loader">
|
||||
<span aria-busy="true" class="loader htmx-indicator">Загрузка...</span>
|
||||
<li><a href="/">Главная</a></li>
|
||||
<li><a href="/random">Случайные</a></li>
|
||||
<li><a href="/top">Топ</a></li>
|
||||
<li><a href="/add">Добавить цитату</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<a href="/">Главная</a>
|
||||
<a href="/random">Рандом</a>
|
||||
<a href="/top">Топ</a>
|
||||
<a href="/add">Добавить</a>
|
||||
</div>
|
||||
</div>
|
||||
{ children... }
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -68,7 +68,7 @@ func Layout(params HeaderParams) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><meta name=\"yandex-verification\" content=\"ee0e23da00ce9fe4\"><title>ШОргРу</title></head><body><main class=\"container\"><nav><ul><li><a href=\"/\"><strong>ШОргРу</strong></a></li></ul><ul hx-boost=\"true\" hx-indicator=\".loader\"><span aria-busy=\"true\" class=\"loader htmx-indicator\">Загрузка...</span><li><a href=\"/\">Главная</a></li><li><a href=\"/random\">Случайные</a></li><li><a href=\"/top\">Топ</a></li><li><a href=\"/add\">Добавить цитату</a></li></ul></nav>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><meta name=\"yandex-verification\" content=\"ee0e23da00ce9fe4\"><title>ШОргРу</title></head><body><main class=\"container\"><div class=\"header\"><a href=\"/\"><strong>ШОргРу</strong></a><div class=\"top-menu\" hx-boost=\"true\" hx-indicator=\".loader\"><span aria-busy=\"true\" class=\"loader htmx-indicator\">Загрузка...</span> <a href=\"/\">Главная</a> <a href=\"/random\">Рандом</a> <a href=\"/top\">Топ</a> <a href=\"/add\">Добавить</a></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ templ List(quotes []model.Quote, page, count int) {
|
|||
<nav>
|
||||
<ul hx-boost="true" hx-indicator=".loader">
|
||||
if page > 0 {
|
||||
<li><a href={ templ.URL(fmt.Sprintf("/?page=%d", page-1)) }>←</a></li>
|
||||
<li><a href={ templ.URL(fmt.Sprintf("?page=%d", page-1)) }>←</a></li>
|
||||
}
|
||||
for _, p := range generatePagination(page, count/20) {
|
||||
if p == "..." {
|
||||
|
@ -30,12 +30,12 @@ templ List(quotes []model.Quote, page, count int) {
|
|||
} else if p == strconv.Itoa(page) {
|
||||
<li>[{ p }]</li>
|
||||
} else {
|
||||
<li><a href={ templ.URL(fmt.Sprintf("/?page=%s", p)) }>{ p }</a></li>
|
||||
<li><a href={ templ.URL(fmt.Sprintf("?page=%s", p)) }>{ p }</a></li>
|
||||
}
|
||||
}
|
||||
|
||||
if page < count/20 {
|
||||
<li><a href={ templ.URL(fmt.Sprintf("/?page=%d", page+1)) }>→</a></li>
|
||||
<li><a href={ templ.URL(fmt.Sprintf("?page=%d", page+1)) }>→</a></li>
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -65,7 +65,7 @@ func List(quotes []model.Quote, page, count int) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 templ.SafeURL = templ.URL(fmt.Sprintf("/?page=%d", page-1))
|
||||
var templ_7745c5c3_Var3 templ.SafeURL = templ.URL(fmt.Sprintf("?page=%d", page-1))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
@ -104,7 +104,7 @@ func List(quotes []model.Quote, page, count int) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 templ.SafeURL = templ.URL(fmt.Sprintf("/?page=%s", p))
|
||||
var templ_7745c5c3_Var5 templ.SafeURL = templ.URL(fmt.Sprintf("?page=%s", p))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var5)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
@ -116,7 +116,7 @@ func List(quotes []model.Quote, page, count int) templ.Component {
|
|||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/tpl/list.templ`, Line: 33, Col: 64}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/tpl/list.templ`, Line: 33, Col: 63}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
@ -133,7 +133,7 @@ func List(quotes []model.Quote, page, count int) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 templ.SafeURL = templ.URL(fmt.Sprintf("/?page=%d", page+1))
|
||||
var templ_7745c5c3_Var7 templ.SafeURL = templ.URL(fmt.Sprintf("?page=%d", page+1))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
|
|
@ -22,12 +22,11 @@ templ Random(quotes []model.Quote) {
|
|||
hx-get="/random"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#random"
|
||||
hx-target="#random"
|
||||
hx-indicator="#loader"
|
||||
>
|
||||
Загрузить ещё...
|
||||
</a>
|
||||
<span aria-busy="true" id="loader" class="htmx-indicator">Загрузка...</span>
|
||||
</div>
|
||||
<span aria-busy="true" id="loader" class="htmx-indicator">Загрузка...</span>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ func Random(quotes []model.Quote) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a role=\"button\" hx-get=\"/random\" hx-swap=\"outerHTML\" hx-select=\"#random\" hx-target=\"#random\" hx-indicator=\"#loader\">Загрузить ещё...</a> <span aria-busy=\"true\" id=\"loader\" class=\"htmx-indicator\">Загрузка...</span></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a role=\"button\" hx-get=\"/random\" hx-swap=\"outerHTML\" hx-select=\"#random\" hx-indicator=\"#loader\">Загрузить ещё...</a></div><span aria-busy=\"true\" id=\"loader\" class=\"htmx-indicator\">Загрузка...</span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
|
@ -22,4 +22,15 @@ article footer {
|
|||
}
|
||||
.htmx-request.htmx-indicator{
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-bottom: var(--pico-block-spacing-vertical);
|
||||
}
|
||||
|
||||
.top-menu {
|
||||
text-align: end;
|
||||
}
|
Loading…
Reference in a new issue