diff --git a/lib/route_planner/previews/fullview.bmp b/lib/route_planner/previews/fullview.bmp new file mode 100644 index 0000000..d375742 Binary files /dev/null and b/lib/route_planner/previews/fullview.bmp differ diff --git a/lib/route_planner/previews/half_horizontalview.bmp b/lib/route_planner/previews/half_horizontalview.bmp new file mode 100644 index 0000000..2425e77 Binary files /dev/null and b/lib/route_planner/previews/half_horizontalview.bmp differ diff --git a/lib/route_planner/previews/half_verticalview.bmp b/lib/route_planner/previews/half_verticalview.bmp new file mode 100644 index 0000000..f928779 Binary files /dev/null and b/lib/route_planner/previews/half_verticalview.bmp differ diff --git a/lib/route_planner/previews/quadrantview.bmp b/lib/route_planner/previews/quadrantview.bmp new file mode 100644 index 0000000..b57055c Binary files /dev/null and b/lib/route_planner/previews/quadrantview.bmp differ diff --git a/lib/route_planner/route_planner.rb b/lib/route_planner/route_planner.rb new file mode 100644 index 0000000..8116ec9 --- /dev/null +++ b/lib/route_planner/route_planner.rb @@ -0,0 +1,43 @@ +module Plugins + class Routes < Base + def locals + { routes:, origin:, destination:, last_updated: } + end + + private + + def routes + [ + { + name: "Via N234", + distance: "13.2 km", + duration: "17 min", + is_fastest: true, + travel_mode: '🚘' + }, + { + name: "via R. São Romão/N234 and N234", + distance: "15.8 km", + duration: "18 min", + is_fastest: false, + travel_mode: '🚘' + }, + { + name: "via CM1037", + distance: "12.9 km", + duration: "18 min", + is_fastest: false, + travel_mode: '🚘' + } + ] + end + + def origin = "Febres, Portugal" + end + + def destination = "Ourentã, Portugal" + end + + def last_updated = "7:30 AM" + end +end \ No newline at end of file diff --git a/lib/route_planner/views/full.html.erb b/lib/route_planner/views/full.html.erb new file mode 100644 index 0000000..23f10d9 --- /dev/null +++ b/lib/route_planner/views/full.html.erb @@ -0,0 +1,57 @@ +
+
+
+
+
+
+ <%= origin %> → <%= destination %> +
+
+
+
+
+ <%= last_updated %> + Last Updated +
+
+
+ +
+ +
+ <% routes.each do |route| %> +
+
+
+
+ <% if route[:is_fastest] %> + ★ + <% end %> +
+
+ <%= route[:name] %> (<%= route[:travel_mode] %>) +
+ <%= route[:duration] %> + <%= route[:distance] %> +
+
+ <% if route[:is_fastest] %> + Fastest Route + <% else %> + Alternative Route + <% end %> +
+
+
+
+
+ <% end %> +
+
+ +
+ + Daily Commute + Route Planner +
+
\ No newline at end of file diff --git a/lib/route_planner/views/half_horizontal.html.erb b/lib/route_planner/views/half_horizontal.html.erb new file mode 100644 index 0000000..be8fbd7 --- /dev/null +++ b/lib/route_planner/views/half_horizontal.html.erb @@ -0,0 +1,46 @@ +
+
+
+
+
+ <%= origin %> → <%= destination %> +
+
+ +
+ +
+ <% routes.each do |route| %> +
+
+
+ <% if route[:is_fastest] %> + ★ + <% end %> +
+
+ <%= route[:name] %> (<%= route[:travel_mode] %>) +
+ <%= route[:duration] %> + <%= route[:distance] %> +
+ <% if route[:is_fastest] %> + Fastest Route + <% else %> + Alternative Route + <% end %> + +
+
+
+ + <% end %> +
+
+ +
+ + Daily Commute + Route Planner +
+
\ No newline at end of file diff --git a/lib/route_planner/views/half_vertical.html.erb b/lib/route_planner/views/half_vertical.html.erb new file mode 100644 index 0000000..0dfc753 --- /dev/null +++ b/lib/route_planner/views/half_vertical.html.erb @@ -0,0 +1,43 @@ +
+
+
+
+
+ <%= origin %> → <%= destination %> +
+
+ +
+ +
+ <% routes.each do |route| %> +
+
+ <% if route[:is_fastest] %> + ★ + <% end %> +
+
+ <%= route[:name] %> (<%= route[:travel_mode] %>) +
+ <%= route[:duration] %> + (<%= route[:distance] %>) +
+ <% if route[:is_fastest] %> + Fastest Route + <% else %> + Alternative Route + <% end %> + +
+
+ <% end %> +
+
+ +
+ + Daily Commute + Route Planner +
+
\ No newline at end of file diff --git a/lib/route_planner/views/quadrant.html.erb b/lib/route_planner/views/quadrant.html.erb new file mode 100644 index 0000000..1cc44ac --- /dev/null +++ b/lib/route_planner/views/quadrant.html.erb @@ -0,0 +1,35 @@ +
+
+
+
+
+ <%= origin %> → <%= destination %> +
+
+ +
+ <% routes.each_with_index do |route, index| %> +
+
+ <% if route[:is_fastest] %> + ★ + <% end %> +
+
+ <%= route[:name] %> (<%= route[:travel_mode] %>) +
+ <%= route[:duration] %> + (<%= route[:distance] %>) +
+
+
+ <% end %> + +
+ +
+ + Daily Commute + Route Planner +
+
\ No newline at end of file