<commit_before>(ns cat-camp.views.home-page
  (:require [cat-camp.session :as ses]
            [secretary.core :as sec]))


(defn player-input [key placeholder]
  [:div
   [:input.player-input
    {:type "text"
     :value (ses/global-state key)
     :placeholder placeholder
     :on-change #(ses/global-put! key (-> % .-target .-value))}]])

(defn named-players []
  (->> [:p1 :p2 :p3 :p4]
       (map ses/global-state)
       (remove #(= "" %))
       count))

(defn button-title []
  (cond
   (= 3 (named-players)) "Play with 3 players"
   (= 4 (named-players)) "Play with 4 players"
   :else "Let's Go!"))<commit_msg>autofocus first input on home-page<commit_after>(ns cat-camp.views.home-page
  (:require [cat-camp.session :as ses]
            [secretary.core :as sec]))

(defn player-input [key placeholder]
  [:div
   [:input.player-input
    (let [pi {:type "text"
              :value (ses/global-state key)
              :placeholder placeholder
              :on-change #(ses/global-put! key (-> % .-target .-value))}]
      (if (= key :p1)
        (assoc pi :autofocus "autofocus")
        pi))]])

(defn named-players []
  (->> [:p1 :p2 :p3 :p4]
       (map ses/global-state)
       (remove #(= "" %))
       count))

(defn button-title []
  (cond
   (= 3 (named-players)) "Play with 3 players"
   (= 4 (named-players)) "Play with 4 players"
   :else "Let's Go!"))
{'fraction_non_alphanumeric': 0.18432510885341075, 'fraction_numerical': 0.012336719883889695, 'mean_word_length': 2.456140350877193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5304504', 'n_tokens_mistral': 518, 'n_tokens_neox': 499, 'n_words': 123}