diff options
Diffstat (limited to 'luax/components')
| -rw-r--r-- | luax/components/animated_bg.luax | 3 | ||||
| -rw-r--r-- | luax/components/carousel.luax | 10 | ||||
| -rw-r--r-- | luax/components/navbar-item.luax | 6 | ||||
| -rw-r--r-- | luax/components/navbar.luax | 17 | ||||
| -rw-r--r-- | luax/components/project.luax | 60 |
5 files changed, 96 insertions, 0 deletions
diff --git a/luax/components/animated_bg.luax b/luax/components/animated_bg.luax new file mode 100644 index 0000000..029c933 --- /dev/null +++ b/luax/components/animated_bg.luax @@ -0,0 +1,3 @@ +return function() + return <div></div> +end diff --git a/luax/components/carousel.luax b/luax/components/carousel.luax new file mode 100644 index 0000000..f2c5fbe --- /dev/null +++ b/luax/components/carousel.luax @@ -0,0 +1,10 @@ +return function(props) + if props == nil or props.children == nil or #props.children == 0 then + return nil + end + + return + <div class="carousel-wrapper"> + {$ props.children $} + </div> +end diff --git a/luax/components/navbar-item.luax b/luax/components/navbar-item.luax new file mode 100644 index 0000000..d201f82 --- /dev/null +++ b/luax/components/navbar-item.luax @@ -0,0 +1,6 @@ +return function(props) + return + <a class={'navbar-item navbar-item-' .. props.attrs.name} href={props.attrs.href} rel={props.attrs.rel}> + {$ props.children $} + </a> +end diff --git a/luax/components/navbar.luax b/luax/components/navbar.luax new file mode 100644 index 0000000..15b782e --- /dev/null +++ b/luax/components/navbar.luax @@ -0,0 +1,17 @@ +local NavbarItem = require('components.navbar-item') + +return function() + return + <div class="navbar-container"> + <div class="navbar"> + <NavbarItem name="home" href="/">[Home]</NavbarItem> + <NavbarItem name="games" href="/games">[Games]</NavbarItem> + <NavbarItem name="projects" href="/projects">[Other Projects]</NavbarItem> + <NavbarItem name="github" href="https://github.com/Duckonaut">[GitHub]</NavbarItem> + <NavbarItem name="itch" href="https://duckonaut.itch.io/">[Itch.io]</NavbarItem> + <NavbarItem name="twitter" href="https://twitter.com/duckonaut">[Twitter]</NavbarItem> + <NavbarItem name="mastodon" href="https://mastodon.gamedev.place/@duckonaut" rel="me">[Mastodon]</NavbarItem> + <NavbarItem name="contact" href="/contact">[Contact]</NavbarItem> + </div> + </div> +end diff --git a/luax/components/project.luax b/luax/components/project.luax new file mode 100644 index 0000000..ddb8c69 --- /dev/null +++ b/luax/components/project.luax @@ -0,0 +1,60 @@ +local Carousel = require('components.carousel') + +function getProjectImageLink(project, image) + return 'assets/' .. project.type .. 's/' .. project.name_normalized .. '/' .. image +end + +function getProjectTechIconLink(tech) + return 'assets/images/' .. tech .. '.png' +end + +function getProjectTargetIconLink(target) + return 'assets/images/' .. target .. '.png' +end + +return function (props) + local project = props.attrs.project + local techs = {} + for _, tech in ipairs(project.tech) do + techs[#techs + 1] = <img class="grow icon" src={getProjectTechIconLink(tech)} /> + end + local targets = {} + for _, target in ipairs(project.targets) do + targets[#targets + 1] = <img class="grow icon" src={getProjectTargetIconLink(target)} /> + end + + local images = nil + if project.images then + images = {} + for _, image in ipairs(project.images) do + images[#images + 1] = <img class="carousel-item" src={getProjectImageLink(project, image)} /> + end + + images = <Carousel>{$ images $}</Carousel> + end + + return ( + <div class="project"> + <div class="project-title"><a href={project.link}>{$ project.name $}</a></div> + <div class="project-info"> + <div class="icon-row"> + <div class="icon-text">Made using</div> + <div class="icon-container"> + {$ techs $} + </div> + </div> + <div class="icon-row"> + <div class="icon-text">Available on</div> + <div class="icon-container"> + {$ targets $} + </div> + </div> + <hr /> + <div class="project-description"> + {$ project.description $} + </div> + </div> + {$ images $} + </div> + ) +end |
