basics.ex 672 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. defmodule CvGenView.Basics do
  2. use Phoenix.Component
  3. attr(:name, :string, required: true)
  4. attr(:title, :string, required: true)
  5. def basics(assigns) do
  6. ~H"""
  7. <h1><%= @name %></h1>
  8. <h2><%= @title %></h2>
  9. """
  10. end
  11. def about(assigns),
  12. do: ~H"""
  13. <p><%= @summary %></p>
  14. """
  15. def css(),
  16. do: """
  17. #basics {
  18. display: grid;
  19. justify-items: center;
  20. }
  21. #basics > h1 {
  22. text-transform: uppercase;
  23. font-weight: 700;
  24. font-size: 2em;
  25. }
  26. #basics > h2 {
  27. text-transform: uppercase;
  28. color: #334960;
  29. opacity: 0.7;
  30. text-align: center;
  31. max-width: 30ch;
  32. }
  33. """
  34. end