home.cljs 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. (ns frontend.components.home
  2. (:require [frontend.state :as state]
  3. [frontend.util :as util]
  4. [frontend.handler :as handler]
  5. [frontend.ui :as ui]
  6. [frontend.mixins :as mixins]
  7. [frontend.config :as config]
  8. [rum.core :as rum]
  9. [frontend.format :as format]
  10. [clojure.string :as string]
  11. [frontend.db :as db]
  12. [frontend.components.sidebar :as sidebar]))
  13. (rum/defc front-page
  14. []
  15. [:div.relative.min-h-screen.overflow-hidden.bg-gray-900.lg:bg-gray-300
  16. [:div.hidden.lg:block.absolute.scroll-bg.scroll-background]
  17. [:div.angled-background
  18. {:class (util/hiccup->class ".relative.min-h-screen.lg:min-w-3xl.xl:min-w-4xl.lg:flex.lg:items-center.lg:justify-center.lg:w-3/5.lg:py-20.lg:pl-8.lg:pr-8.bg-no-repeat")}
  19. [:div
  20. [:div.px-6.pt-8.pb-12.md:max-w-3xl.md:mx-auto.lg:mx-0.lg:max-w-none.lg:pt-0.lg:pb-16
  21. [:div.flex.items-center.justify-between
  22. [:div
  23. [:img.h-6.lg:h-8.xl:h-9
  24. {:alt "Gitnotes",
  25. :src "/static/img/tailwindui-logo-on-dark.svg"}]]
  26. [:div
  27. [:a.text-sm.font-semibold.text-white.focus:outline-none.focus:underline
  28. {:href (str config/api "login/github")}
  29. "Login →"]]]]
  30. [:div.px-6.md:max-w-3xl.md:mx-auto.lg:mx-0.lg:max-w-none
  31. [:p.text-sm.font-semibold.text-gray-300.uppercase.tracking-wider
  32. "\n Now in early access\n "]
  33. [:h1.mt-3.text-3xl.leading-9.font-semibold.font-display.text-white.sm:mt-6.sm:text-4xl.sm:leading-10.xl:text-5xl.xl:leading-none
  34. "\n Beautiful UI components, crafted\n "
  35. [:br.hidden.sm:inline]
  36. [:span.text-teal-400
  37. "\n by the creators of Tailwind CSS.\n "]]
  38. [:p.mt-2.text-lg.leading-7.text-gray-300.sm:mt-3.sm:text-xl.sm:max-w-xl.xl:mt-4.xl:text-2xl.xl:max-w-2xl
  39. "\n Fully responsive HTML components, designed and developed by Adam Wathan and Steve Schoger.\n "]
  40. [:div.mt-6.sm:flex.sm:mt-8.xl:mt-12
  41. [:a.w-full.sm:w-auto.inline-flex.items-center.justify-center.px-6.py-3.border.border-transparent.text-base.leading-6.font-semibold.rounded-md.text-gray-900.bg-white.shadow-sm.hover:text-gray-600.focus:outline-none.focus:text-gray-600.transition.ease-in-out.duration-150.xl:text-lg.xl:py-4
  42. {:href (str config/api "login/github")}
  43. "Login with Github"]
  44. [:a.mt-4.sm:ml-4.sm:mt-0.w-full.sm:w-auto.inline-flex.items-center.justify-center.px-6.py-3.border.border-transparent.text-base.leading-6.font-semibold.rounded-md.text-white.bg-gray-800.shadow-sm.hover:bg-gray-700.focus:outline-none.focus:bg-gray-700.transition.ease-in-out.duration-150.xl:text-lg.xl:py-4
  45. {:href "/demo"}
  46. "Live Demo"]]]
  47. [:div.mt-8.sm:mt-12.relative.h-64.overflow-hidden.bg-gray-300.lg:hidden
  48. [:div.absolute.scroll-bg.scroll-background-2]]
  49. [:div.px-6.py-8.sm:pt-12.md:max-w-3xl.md:mx-auto.lg:mx-0.lg:max-w-full.lg:py-0.lg:pt-24
  50. [:p.text-sm.font-semibold.text-gray-300.uppercase.tracking-wider
  51. "Designed and developed by"]
  52. [:div.mt-4.sm:flex
  53. [:a.flex.items-center.no-underline
  54. {:href "https://twitter.com/adamwathan"}]
  55. [:div.flex-shrink-0
  56. [:img.h-12.w-12.rounded-full.border-2.border-white
  57. {:alt "", :src "/static/img/adam.jpg"}]]
  58. [:div.ml-3
  59. [:p.font-semibold.text-white.leading-tight "Adam Wathan"]
  60. [:p.text-sm.text-gray-500.leading-tight
  61. "Creator of Tailwind CSS"]]
  62. [:a.mt-6.sm:mt-0.sm:ml-12.flex.items-center.no-underline
  63. {:href "https://twitter.com/steveschoger"}]
  64. [:div.flex-shrink-0
  65. [:img.h-12.w-12.rounded-full.border-2.border-white
  66. {:alt "", :src "/static/img/steve.jpg"}]]
  67. [:div.ml-3
  68. [:p.font-semibold.text-white.leading-tight "Steve Schoger"]
  69. [:p.text-sm.text-gray-500.leading-tight
  70. "Author of Refactoring UI"]]]]]]])
  71. (rum/defq home < (rum/local false ::loading?)
  72. {:will-mount (fn [state]
  73. (when-not (db/get-github-token)
  74. (handler/get-github-access-token))
  75. state)
  76. :q (fn [_state] (db/sub-github-token))}
  77. [state {:keys [:github/token]}]
  78. (if token
  79. (sidebar/sidebar (sidebar/main-content))
  80. (front-page)))