gurt.width(), gurt.height()

This commit is contained in:
Face
2025-09-09 18:19:36 +03:00
parent bb0f4f102a
commit 03f4db7a84
4 changed files with 66 additions and 4 deletions

View File

@@ -112,6 +112,25 @@ end
-- Get all values for a parameter (for repeated params)
local tags = gurt.location.query.getAll('tag')
```
### gurt.width()
Gets the available width of the site page viewport in pixels.
```lua
local pageWidth = gurt.width()
trace.log('Page width: ' .. pageWidth .. ' pixels')
```
### gurt.height()
Gets the available height of the site page viewport in pixels.
```lua
local pageHeight = gurt.height()
trace.log('Page height: ' .. pageHeight .. ' pixels')
```
## Global: trace
The global trace table for logging messages to the console.