-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39fc036
commit 750b348
Showing
10 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class LandingsController < ApplicationController | ||
def show | ||
render Landings::ShowView.new | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
module Landings | ||
class ShowView < ApplicationView | ||
def view_template | ||
div class: "w-full flex items-center justify-center mb-8" do | ||
div class: "flex flex-col items-center justify-center gap-12 max-w-4xl" do | ||
h1 class: "text-6xl font-bold" do | ||
span do | ||
"A " | ||
end | ||
span class: "text-rose-600" do | ||
"Ruby" | ||
end | ||
|
||
span do | ||
" component library for " | ||
end | ||
|
||
span class: "text-teal-500" do | ||
"DaisyUI" | ||
end | ||
|
||
span do | ||
" using " | ||
end | ||
|
||
span class: "text-yellow-500" do | ||
"Phlex" | ||
end | ||
end | ||
|
||
h2 class: "text-xl" do | ||
<<~TXT | ||
PhlexyUI is a component library built with Phlex, a Ruby gem for | ||
building fast object-oriented HTML components. On top of DaisyUI, | ||
the most popular component library for Tailwind CSS. | ||
TXT | ||
end | ||
|
||
div class: "flex gap-4 self-start" do | ||
Button :outline, as: :a, href: examples_path(:button) do | ||
"Browse components" | ||
end | ||
|
||
Button :primary, as: :a, href: docs_path(:installation) do | ||
"Get started" | ||
end | ||
end | ||
end | ||
end | ||
|
||
render Examples::DemoComponent.new( | ||
component: Component.from_name("Card"), | ||
title: "Card", | ||
example_method: method(:example) | ||
) | ||
end | ||
|
||
private | ||
|
||
def example | ||
Card :base_100 do |card| | ||
figure do | ||
img(src:) | ||
end | ||
|
||
card.body do | ||
card.title do | ||
"Shoes!" | ||
end | ||
|
||
p do | ||
"If a dog chews shoes whose shoes does he choose?" | ||
end | ||
|
||
card.actions class: "justify-end" do | ||
Button :primary do | ||
"Buy Now" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
def src | ||
"https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters