Skip to content

Commit f7027dc

Browse files
authored
Add demo video and update performance metrics (#217)
This PR adds a YouTube demo video to the homepage and updates the performance metrics to reflect the latest benchmarks (7.7x faster than ERB) with a link to the benchmark source.
1 parent d0b1883 commit f7027dc

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

app/views/pages/home.rb

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ def view_template
2323
end
2424
end
2525
end
26+
27+
28+
2629
div(class: "overflow-hidden") do
30+
div(class: "container mx-auto max-w-5xl px-4 flex justify-center my-8") do
31+
iframe(width: "100%", height: "720", src: "https://www.youtube.com/embed/OQZam7rug00?si=JmZNzS5u194Q0AWQ", title: "YouTube video player", frameborder: "0", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", referrerpolicy: "strict-origin-when-cross-origin", allowfullscreen: true)
32+
end
33+
2734
div(class: "relative z-10 container mx-auto max-w-5xl pt-16 lg:pt-16 py-24 lg:py-32 px-4") do
2835
div(class: "grid grid-cols-6 gap-4") do
2936
render HomeView::Card.new(class: "col-span-6 sm:col-span-3 md:col-span-4", title: "Built for Speed", subtitle: "Dive into a world where your Rails UI development happens at light speed. Phlex is not just fast - it's blazing fast.", color: :secondary) do |card|
@@ -46,16 +53,14 @@ def view_template
4653
render HomeView::Card.new(class: "col-span-6 sm:col-span-3 md:col-span-2", color: :sky) do |card|
4754
card.content do
4855
div(class: "flex flex-col items-center justify-center text-center space-y-4 h-full") do
49-
p(class: "text-6xl font-semibold") { "12x" }
50-
p { "Faster than traditional Rails ERB templates" }
56+
p(class: "text-6xl font-semibold") { "7.7x" }
57+
p do
58+
a(href: "https://github.com/palkan/view-layer-benchmarks", class: "underline") { "Faster" }
59+
span {" than traditional Rails ERB"}
60+
end
5161
end
5262
end
5363
end
54-
render HomeView::Card.new(class: "col-span-6", color: :card, title: "Speed Tests", subtitle: "Huge thanks to @KonnorRogers for running these tests") do |card|
55-
card.content do
56-
render_speed_tests
57-
end
58-
end
5964
render HomeView::Card.new(class: "col-span-6 sm:col-span-3", title: "UI that... Wow!", subtitle: "Design stunning, streamlined, and customizable UIs that not only look great but sell your app without you lifting a finger.", color: :violet) do |card|
6065
card.icon do
6166
svg(
@@ -211,24 +216,4 @@ def speed_tests
211216
}
212217
].sort_by { |test| test[:time] }
213218
end
214-
215-
def render_speed_tests
216-
div(class: "space-y-4 overflow-hidden") do
217-
speed_tests.each do |test|
218-
div(class: "sm:flex items-center space-y-2 sm:space-x-2") do
219-
h3(class: "font-semibold leading-none tracking-tight w-40") { test[:framework] }
220-
div(class: "p-1 rounded-md flex items-center gap-x-2 border flex-grow") do
221-
# bar with sky gradient
222-
div(class: "flex-grow") do
223-
div(class: "bg-gradient-to-r from-sky-400 to-sky-200 rounded h-8", style: "width: #{test[:time] * 100 / speed_tests.last[:time]}%")
224-
end
225-
# text with timex
226-
div(class: "flex-shrink-0 w-20 pr-2") do
227-
p(class: "text-sm text-right") { "#{test[:time]}x" } if test[:time] > 1
228-
end
229-
end
230-
end
231-
end
232-
end
233-
end
234219
end

0 commit comments

Comments
 (0)