Skip to content

Commit

Permalink
Donation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Gorin committed Feb 27, 2021
1 parent 16361a2 commit 7417130
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 60 deletions.
5 changes: 5 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ label.game-url {
margin-bottom: 20px;
}

.donation-notice {
margin-top: 20px;
color: #666;
}

.turn-banner {
padding: 5px;
margin-top: 5px;
Expand Down
3 changes: 3 additions & 0 deletions assets/elm/I18n/De.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"Wir suchen einen Gegner für Sie! Geben Sie uns eine Sekunde oder teilen Sie diese URL mit allen, die gerade mit Ihnen spielen möchten:"

HelpMeKeepItAdFree ->
"Helfen Sie mir, Pairs One werbefrei zu halten, indem Sie spenden: "

Theme ->
"Thema"

Expand Down
7 changes: 5 additions & 2 deletions assets/elm/I18n/En.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ translate t =
"Play again"

Accuracy value ->
"Accuracy: " ++ (toString value) ++ "%"
"Accuracy: " ++ toString value ++ "%"

Score value ->
"Score: " ++ (toString value)
"Score: " ++ toString value

Scoreboard t ->
case t of
Expand All @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"We are looking for an opponent for you! Give us a second, or share this URL with anyone who might want to play with you right now:"

HelpMeKeepItAdFree ->
"Help me keep Pairs One ad-free by donating on"

Theme ->
"Theme"

Expand Down
3 changes: 3 additions & 0 deletions assets/elm/I18n/Es.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"¡Estamos buscando un oponente para ti! Danos un segundo o comparte esta URL con cualquiera que quiera jugar contigo ahora mismo:"

HelpMeKeepItAdFree ->
"Ayúdame a mantener Pairs One sin publicidad donando en "

Theme ->
"Tema"

Expand Down
9 changes: 6 additions & 3 deletions assets/elm/I18n/Fr.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ translate t =
"Rejouer"

Accuracy value ->
"Justesse: " ++ (toString value) ++ "%"
"Justesse: " ++ toString value ++ "%"

Score value ->
"Score: " ++ (toString value)
"Score: " ++ toString value

Scoreboard t ->
case t of
Expand All @@ -48,7 +48,10 @@ translate t =
"Partager cet URL avec votre/vos adversaire(s):"

ShareThisUrlRandom ->
"Vous cherchez un adversaire! Donnez-nous une seconde, ou bien partagez cet URL avec quelqu'un qui voudrait jouer avec vous maintenant :"
"Aidez-moi à garder Pairs One sans publicité en faisant un don sur"

HelpMeKeepItAdFree ->
""

Theme ->
"Thème"
Expand Down
3 changes: 3 additions & 0 deletions assets/elm/I18n/It.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"Stiamo cercando un avversario per te! Dacci un secondo o condividi questo URL con chiunque voglia giocare con te in questo momento:"

HelpMeKeepItAdFree ->
"Aiutami a mantenere Pairs One senza pubblicità donando su"

Theme ->
"Tema"

Expand Down
3 changes: 3 additions & 0 deletions assets/elm/I18n/Pl.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"Szukamy dla Ciebie przeciwnika! Daj nam chwilę lub udostępnij ten adres URL komuś, kto chciałby teraz z Tobą zagrać:"

HelpMeKeepItAdFree ->
"Pomóż mi utrzymać Pairs One bez reklam, przekazując darowiznę na"

Theme ->
"Motyw"

Expand Down
7 changes: 5 additions & 2 deletions assets/elm/I18n/Pt.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ translate t =
"Jogar novamente"

Accuracy value ->
"Percentual de acerto: " ++ (toString value) ++ "%"
"Percentual de acerto: " ++ toString value ++ "%"

Score value ->
"Score: " ++ (toString value)
"Score: " ++ toString value

Scoreboard t ->
case t of
Expand All @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"As soon as there is another player available, we'll hook you up! If you don't want to wait, share this URL with anybody you want to play with:"

HelpMeKeepItAdFree ->
"Ajude-me a manter o Pairs One sem anúncios, doando no"

Theme ->
"Theme"

Expand Down
7 changes: 5 additions & 2 deletions assets/elm/I18n/Ru.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ translate t =
"Сыграть снова"

Accuracy value ->
"Точность: " ++ (toString value) ++ "%"
"Точность: " ++ toString value ++ "%"

Score value ->
"Счет: " ++ (toString value)
"Счет: " ++ toString value

Scoreboard t ->
case t of
Expand All @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"Мы подыскиваем тебе оппонента! Дай нам минуту - либо поделись вот этой ссылкой с тем, кто непротив сыграть с тобой прямо сейчас:"

HelpMeKeepItAdFree ->
"Помоги оставить Pairs One свободной от рекламы на"

Theme ->
"Тема"

Expand Down
1 change: 1 addition & 0 deletions assets/elm/I18n/Translation.elm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Translation
| Scoreboard Scoreboard
| ShareThisUrl
| ShareThisUrlRandom
| HelpMeKeepItAdFree
| Theme
| Size
| Public
Expand Down
7 changes: 5 additions & 2 deletions assets/elm/I18n/Uk.elm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ translate t =
"Зіграти знову"

Accuracy value ->
"Точність: " ++ (toString value) ++ "%"
"Точність: " ++ toString value ++ "%"

Score value ->
"Score: " ++ (toString value)
"Score: " ++ toString value

Scoreboard t ->
case t of
Expand All @@ -50,6 +50,9 @@ translate t =
ShareThisUrlRandom ->
"We are looking for an opponent for you! Give us a second, or share this URL with anyone who might want to play with you right now:"

HelpMeKeepItAdFree ->
"Допоможіть мені зберегти Pairs One без реклами, пожертвувавши на"

Theme ->
"Theme"

Expand Down
101 changes: 52 additions & 49 deletions assets/elm/View.elm
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
module View exposing (view)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Decode as Json
import String


-- submodules

import ScoreboardView exposing (..)
import ReplayView exposing (..)
import BoardView exposing (..)
import ChatView exposing (..)
import Types.Model exposing (..)
import Types.Game exposing (isLocal)
import Types.Msg exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import I18n exposing (..)
import I18n.Translation exposing (..)
import Json.Decode as Json
import PlayersView exposing (..)
import ReplayView exposing (..)
import ScoreboardView exposing (..)
import String
import Types.Game exposing (isLocal)
import Types.Model exposing (..)
import Types.Msg exposing (..)


view : Model -> Html Msg
view model =
case List.length (model.game.cards.values) of
case List.length model.game.cards.values of
0 ->
loading

Expand All @@ -41,6 +39,7 @@ game : Model -> Html Msg
game model =
if model.isCompleted then
completedGame model

else
div [ class "row" ]
[ prestartOverlay model
Expand All @@ -58,14 +57,15 @@ chatArea : Model -> List (Html Msg)
chatArea model =
let
isSinglePlayer =
(List.length model.game.players) == 1
List.length model.game.players == 1
in
if isLocal model.game || isSinglePlayer then
[]
else
[ userName model
, chatView model
]
if isLocal model.game || isSinglePlayer then
[]

else
[ userName model
, chatView model
]


completedGame : Model -> Html Msg
Expand All @@ -85,17 +85,17 @@ userName model =
t =
I18n.translate model.locale
in
div [ class "user-name-area" ]
[ label [] [ text <| t <| YourName ]
, div [ class "input-group input-group--name" ]
[ input
[ class "form-control", onInput OnInputPlayerName, value model.playerName ]
[]
, span [ class "input-group-btn" ]
[ button [ class "btn btn-default", onClick SetUserName ] [ text "ok" ]
]
div [ class "user-name-area" ]
[ label [] [ text <| t <| YourName ]
, div [ class "input-group input-group--name" ]
[ input
[ class "form-control", onInput OnInputPlayerName, value model.playerName ]
[]
, span [ class "input-group-btn" ]
[ button [ class "btn btn-default", onClick SetUserName ] [ text "ok" ]
]
]
]


prestartOverlay : Model -> Html Msg
Expand All @@ -107,31 +107,34 @@ prestartOverlay model =
hint =
if model.random then
ShareThisUrlRandom

else
ShareThisUrl
in
if not <| gameIsActive model then
div []
[ div [ class "pairs-overlay" ] []
, div [ class "pairs-modal" ]
[ div [ class "form-group" ]
[ label [ class "game-url" ] [ span [ class "fa fa-spinner fa-pulse" ] [], text " ", text <| t <| hint ]
, div [ class "input-group clipboard-input" ]
[ input
[ class "form-control game-url"
, value (gameUrl model)
, onClick SelectGameUrlInput
]
[]
, span [ class "input-group-btn" ]
[ button
[ class "btn btn-default clipboard", onClick CopyUrl ]
[ img [ src "/images/clippy.svg", alt "copy to clipboard", width 13 ] []
]
if not <| gameIsActive model then
div []
[ div [ class "pairs-overlay" ] []
, div [ class "pairs-modal" ]
[ div [ class "form-group" ]
[ label [ class "game-url" ] [ span [ class "fa fa-spinner fa-pulse" ] [], text " ", text <| t <| hint ]
, div [ class "input-group clipboard-input" ]
[ input
[ class "form-control game-url"
, value (gameUrl model)
, onClick SelectGameUrlInput
]
[]
, span [ class "input-group-btn" ]
[ button
[ class "btn btn-default clipboard", onClick CopyUrl ]
[ img [ src "/images/clippy.svg", alt "copy to clipboard", width 13 ] []
]
]
]
, div [ class "donation-notice" ] [ text "🙌", text <| t <| HelpMeKeepItAdFree, text " ", a [ target "_blank", href "https://patreon.com/mxgrn" ] [ text "Patreon" ] ]
]
]
else
div [] []
]

else
div [] []

0 comments on commit 7417130

Please sign in to comment.