Fix mobile kinda
continuous-integration/drone/push Build is passing Details

This commit is contained in:
DutchEllie 2022-06-22 12:39:36 +02:00
parent dbfdaf38bb
commit d66bb5afeb
Signed by: DutchEllie
SSH Key Fingerprint: SHA256:dKq6ZSgN5E3Viqrw/+xAdf2VdR6hdRGNyrYqXXwfjTY
5 changed files with 64 additions and 10 deletions

View File

@ -9,6 +9,7 @@ type htmlBlock struct {
Iclass string Iclass string
Isrc string // HTML document source Isrc string // HTML document source
Iid string
// TODO: implement invisibility for other background functions // TODO: implement invisibility for other background functions
} }
@ -17,6 +18,11 @@ func newHTMLBlock() *htmlBlock {
return &htmlBlock{} return &htmlBlock{}
} }
func (b *htmlBlock) ID(v string) *htmlBlock {
b.Iid = v
return b
}
func (b *htmlBlock) Class(v string) *htmlBlock { func (b *htmlBlock) Class(v string) *htmlBlock {
b.Iclass = app.AppendClass(b.Iclass, v) b.Iclass = app.AppendClass(b.Iclass, v)
return b return b
@ -46,12 +52,18 @@ type uiBlock struct {
Iclass string Iclass string
Iui []app.UI Iui []app.UI
Iid string
} }
func newUIBlock() *uiBlock { func newUIBlock() *uiBlock {
return &uiBlock{} return &uiBlock{}
} }
func (b *uiBlock) ID(v string) *uiBlock {
b.Iid = v
return b
}
func (b *uiBlock) Class(v string) *uiBlock { func (b *uiBlock) Class(v string) *uiBlock {
b.Iclass = app.AppendClass(b.Iclass, v) b.Iclass = app.AppendClass(b.Iclass, v)
return b return b

View File

@ -34,9 +34,8 @@ func (m *menu) OnAppUpdate(ctx app.Context) {
func (m *menu) Render() app.UI { func (m *menu) Render() app.UI {
return app.Div(). return app.Div().
Class("left").
Class("block"). Class("block").
Class("leftbarblock-nop"). // Class("leftbarblock-nop").
Class("navbar"). Class("navbar").
Body( Body(
app.Ul().Body( app.Ul().Body(

View File

@ -16,11 +16,14 @@ type page struct {
IleftBar []app.UI IleftBar []app.UI
Imain []app.UI Imain []app.UI
hideRightContent bool
// TODO: Possibly add "updateavailable" here, so it shows up on every page // TODO: Possibly add "updateavailable" here, so it shows up on every page
} }
func newPage() *page { func newPage() *page {
return &page{} return &page{
hideRightContent: false,
}
} }
func (p *page) Background(v ...app.UI) *page { func (p *page) Background(v ...app.UI) *page {
@ -48,6 +51,11 @@ func (p *page) Main(v ...app.UI) *page {
return p return p
} }
func (p *page) OnMount(ctx app.Context) {
ctx.Handle("right-hide", p.hideRight)
ctx.Handle("right-show", p.showRight)
}
func (p *page) Render() app.UI { func (p *page) Render() app.UI {
if p.IbackgroundClass == "" { if p.IbackgroundClass == "" {
p.IbackgroundClass = app.AppendClass(p.IbackgroundClass, "background") p.IbackgroundClass = app.AppendClass(p.IbackgroundClass, "background")
@ -66,7 +74,9 @@ func (p *page) Render() app.UI {
}), }),
), ),
app.Div(). app.Div().
Style("display", visible(p.hideRightContent)).
Class("right"). Class("right").
ID("right").
Body( Body(
app.Range(p.Imain).Slice(func(i int) app.UI { app.Range(p.Imain).Slice(func(i int) app.UI {
return p.Imain[i] return p.Imain[i]
@ -74,3 +84,18 @@ func (p *page) Render() app.UI {
), ),
) )
} }
func visible(v bool) string {
if v {
return "none"
}
return "block"
}
func (p *page) hideRight(ctx app.Context, a app.Action) {
p.hideRightContent = true
}
func (p *page) showRight(ctx app.Context, a app.Action) {
p.hideRightContent = false
}

View File

@ -129,9 +129,10 @@ func (m *menu) Render() app.UI {
), ),
app.Div(). app.Div().
Style("display", visible(m.hideMenu && m.showHamburgerMenu)). Style("display", visible(m.hideMenu && m.showHamburgerMenu)).
Style("position", "absolute"). Style("position", "relative").
Style("top", "0"). // Style("top", "0").
Style("left", "0"). // Style("left", "0").
// Style("right", "0").
Style("width", "100%"). Style("width", "100%").
Style("height", "100%"). Style("height", "100%").
Style("overflow", "hidden"). Style("overflow", "hidden").
@ -164,8 +165,10 @@ func pxToString(px int) string {
func (m *menu) onHamburgerButtonClick(ctx app.Context, e app.Event) { func (m *menu) onHamburgerButtonClick(ctx app.Context, e app.Event) {
m.showHamburgerMenu = true m.showHamburgerMenu = true
ctx.NewAction("right-hide")
} }
func (m *menu) hideHamburgerMenu(ctx app.Context, e app.Event) { func (m *menu) hideHamburgerMenu(ctx app.Context, e app.Event) {
m.showHamburgerMenu = false m.showHamburgerMenu = false
ctx.NewAction("right-show")
} }

View File

@ -1,11 +1,17 @@
html { html {
overflow-y: scroll; /* overflow-y: scroll; */
margin: 0px; margin: 0;
height: 100%; height: 100%;
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar {
display: none;
} }
body { body {
margin: 0px; margin: 0;
height: 100%; height: 100%;
background-image: url(images/background_star.gif); background-image: url(images/background_star.gif);
} }
@ -66,6 +72,7 @@ body {
color:aliceblue; color:aliceblue;
font-family: havakana; font-family: havakana;
font-size: 1.1em; font-size: 1.1em;
box-sizing: border-box;
} }
.navbar { .navbar {
@ -358,12 +365,13 @@ div.comment-message p{
@media only screen and (max-width: 914px) { @media only screen and (max-width: 914px) {
.header { .header {
font-size: 10vw; font-size: 10vw;
height: fit-content;
} }
.main { .main {
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
width: 100%; width: 100%;
box-sizing: border-box; height: 100%;
} }
.block { .block {
@ -373,9 +381,16 @@ div.comment-message p{
.right { .right {
width: 100%; width: 100%;
max-width: none; max-width: none;
z-index: 0;
} }
.leftbarblock { .leftbarblock {
display: none; display: none;
} }
.left {
z-index: 1;
max-width: unset;
width: 100%;
}
} }