Documentation
¶
Overview ¶
templ: version: v0.3.960
templ: version: v0.3.960
templ: version: v0.3.960
templ: version: v0.3.960
Index ¶
- Variables
- func DrawerSlot(c echo.Context, book *model.Book) templ.Component
- func ImageSrc(Url string) string
- func ImageXData(Url string) string
- func InsertData(bookData any, serverStatus any) templ.Component
- func InsertRawJSONScript(data string) templ.Component
- func MainArea(c echo.Context, book *model.Book, readMode string, pagedIndex int, ...) templ.Component
- func ScrollModeHandler(c echo.Context) error
- func ScrollPage(c echo.Context, book *model.Book, readMode string, pagedIndex int, ...) templ.Component
- func ScrollPagination(book *model.Book, paginationIndex int) templ.Component
Constants ¶
This section is empty.
Variables ¶
var PAGED_SIZE = 32
Functions ¶
func DrawerSlot ¶
卷轴模式页面,放在侧栏里的【非共通设置】
func ImageSrc ¶
压缩尺寸,切白边,无缓存等选项,http://192.168.3.26:58642/api/get_file?id=xE2Nmdj&filename=001_By_zhonyk_cover.jpg&resize_max_width=200&no-cache=true
func ImageXData ¶
ImageXData 在Go函数里面计算图片的x-data属性。渲染结果例: x-data="{ isDoublePage: false, imageUrl: '/api/get_file?id=asxScIDD&filename=1.jpg' + ($store.global.autoCrop ? "&auto_crop=1" : ")"
func InsertRawJSONScript ¶
func MainArea ¶
func MainArea(c echo.Context, book *model.Book, readMode string, pagedIndex int, startIndex int) templ.Component
ScrollMainArea 定义 BodyHTML 需要更复杂的屏幕状态判断的时候,可以参考:https://developer.mozilla.org/zh-CN/docs/Web/API/Screen/orientation orientation: (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation tips:hx-get 用于获取图片的URL,hx-trigger 用于触发加载,hx-swap 用于替换元素,innerHTML默认值,将内容放在目标元素内 outerHTML用返回的内容替换整个目标元素 hx-target 用于指定目标元素 https://htmx.org/docs/#triggers https://htmx.org/docs/#swapping tips: Alpine.js 动态CSS,只支持内联写法 min-h-16 是为了图片未加载时,图片高度为0,导致页面不美观。极端设置下会导致图片变形。 text-center:居中 alert文字,因为需要等待css加载,所以现在没设置alt文字。
func ScrollModeHandler ¶ added in v1.1.0
ScrollModeHandler 阅读界面(卷轴模式)
Types ¶
This section is empty.