Titre responsive

pull/1/head
Jean-Christophe Jameux 4 years ago
parent 72f8a8255d
commit 203e597da9
  1. 6
      .gitignore
  2. 1
      Public/fav.svg
  3. 1
      Public/index.html
  4. 1
      Public/prof.js
  5. 8
      src/CalculateurDeNotes.elm
  6. 33
      src/Echologo.elm
  7. 4
      src/GenerateurDeProblemes.elm
  8. 39
      src/Prof.elm
  9. 88
      src/Style.elm

6
.gitignore vendored

@ -1,4 +1,4 @@
elm-stuff/ elm-stuff/
index.html /index.html
prof.js /prof.js
fav.svg /fav.svg

@ -0,0 +1 @@
<svg version="1.1" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><circle cx="15" cy="15" r="15" fill="#64c29b" stroke-width="0"/><g fill="#fff" stroke-width="0"><circle cx="13.8" cy="9" r="2"/><path d="M12.3,6.4A3,3 0 0 0 11.2,10.5 5,5 0 0 1 12.3,2.15a3,3 0 0 0 0,4.24"/><path d="m13.8 6a3 3 0 0 1 3 3 6 6 0 0 1 8.48 0 8 8 0 0 0-11.5-3"/><path d="M12.3,11.6A3,3 0 0 0 16.4,10.5 13,13 0 0 1 12.3,28.57a12,12 0 0 0 0,-17"/></g></svg>

After

Width:  |  Height:  |  Size: 440 B

@ -0,0 +1 @@
<!DOCTYPE html><html lang="fr"><head><meta name="description" content="Appli web pour générer des questions à partir d'un modèle."><meta charset="UTF-8" content="text/html, initial-scale=1.0" name="viewport"><link rel="icon"type="image/svg"href="fav.svg"/><title>Le coin du prof</title></head><body><div id="e"></div><script src="./prof.js"></script><script>Elm.Prof.init({node:document.getElementById("e"),flags:{l:window.innerWidth,h:window.innerHeight}})</script></body></html>

File diff suppressed because one or more lines are too long

@ -167,7 +167,7 @@ view model =
, clip , clip
, scrollbars , scrollbars
, width fill , width fill
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10
@ -190,7 +190,7 @@ view model =
, clip , clip
, scrollbars , scrollbars
, width fill , width fill
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10
@ -213,7 +213,7 @@ view model =
, clip , clip
, scrollbars , scrollbars
, width fill , width fill
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10
@ -256,7 +256,7 @@ voirNotes rpnsEleves =
, clip , clip
, scrollbars , scrollbars
, padding petitEspacement , padding petitEspacement
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10

@ -1,5 +1,7 @@
module Echologo exposing (echologo) module Echologo exposing (..)
import Color
import Color.Convert
import Svg exposing (..) import Svg exposing (..)
import Svg.Attributes import Svg.Attributes
exposing exposing
@ -18,9 +20,32 @@ import Svg.Attributes
) )
echologo = {-| HSL = 155, 43.5, 57.6
[ circle [ cx "15", cy "15", r "15", fill "#64c29b", strokeWidth "0" ] [] Hex = #64c29b
, g [ fill "#fff", strokeWidth "0" ] -}
vertMante =
Color.fromRgba
{ red = 100 / 255
, green = 194 / 255
, blue = 155 / 255
, alpha = 255 / 255
}
echologo couleurArrierePlan ombre =
[ circle
[ cx "15"
, cy "15"
, r "15"
, fill <| Color.Convert.colorToHex vertMante
, strokeWidth "0"
]
[]
, g
[ fill <| Color.Convert.colorToHex couleurArrierePlan
, strokeWidth "0"
, ombre
]
[ circle [ cx "13.8", cy "9", r "2" ] [] [ circle [ cx "13.8", cy "9", r "2" ] []
, path [ d "M 12.3,6.4019238 A 3,3 0 0 0 11.201924,10.5 5,5 0 0 1 12.3,2.1592831 a 3,3 0 0 0 0,4.2426407" ] [] , path [ d "M 12.3,6.4019238 A 3,3 0 0 0 11.201924,10.5 5,5 0 0 1 12.3,2.1592831 a 3,3 0 0 0 0,4.2426407" ] []
, path [ d "m13.8 6a3 3 0 0 1 3 3 6 6 0 0 1 8.485281 0 8 8 0 0 0-11.485281-3" ] [] , path [ d "m13.8 6a3 3 0 0 1 3 3 6 6 0 0 1 8.485281 0 8 8 0 0 0-11.485281-3" ] []

@ -147,7 +147,7 @@ view model =
, width fill , width fill
, clip , clip
, scrollbars , scrollbars
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10
@ -193,7 +193,7 @@ view model =
--^^^^^^^^^^ Cet attribut ne suffit pas --^^^^^^^^^^ Cet attribut ne suffit pas
, padding petitEspacement , padding petitEspacement
, Background.color <| vert 0.2 , Background.color <| couleurUI <| couleurArrierePlan
, Border.rounded 8 , Border.rounded 8
, Border.innerShadow , Border.innerShadow
{ blur = 10 { blur = 10

@ -217,7 +217,7 @@ view model =
[ CalculateurDeNotes.view model.modeleCalculateurDeNotes [ CalculateurDeNotes.view model.modeleCalculateurDeNotes
|> Element.map CalculateurDeNotesMsg |> Element.map CalculateurDeNotesMsg
|> designGeneral |> designGeneral
(model.largeur - 2 * (petitEspacement + grandEspacement)) model.largeur
CalculateurDeNotes.titre CalculateurDeNotes.titre
] ]
} }
@ -228,47 +228,12 @@ view model =
[ GenerateurDeProblemes.view model.modeleGenerateurDeProblemes [ GenerateurDeProblemes.view model.modeleGenerateurDeProblemes
|> Element.map GenerateurDeProblemesMsg |> Element.map GenerateurDeProblemesMsg
|> designGeneral |> designGeneral
(10 * (model.largeur - 2 * (petitEspacement + grandEspacement)) // 44) model.largeur
GenerateurDeProblemes.titre GenerateurDeProblemes.titre
] ]
} }
designGeneral largeur titre elmt =
layout
[ height fill
, width fill
, padding tresGrandEspacement
, Background.color <| vert 0.2
]
<|
column
[ height fill
, width fill
, Background.color <| vert 0
, Border.rounded 13
]
[ row []
[ entete 135 largeur titre
{-
, el
[ Font.size 120
, Font.color <| vert 0.2
, Font.shadow
{ offset = ( 2, 2 )
, blur = 3
, color = vert 1
}
]
<|
text titre
-}
]
, elmt
]
viewLink : String -> Html msg viewLink : String -> Html msg
viewLink path = viewLink path =
Html.li [] [ Html.a [ Html.Attributes.href path ] [ Html.text path ] ] Html.li [] [ Html.a [ Html.Attributes.href path ] [ Html.text path ] ]

@ -1,6 +1,7 @@
module Style exposing (..) module Style exposing (..)
import Color import Color
import Color.Convert
import Color.Manipulate import Color.Manipulate
import Echologo exposing (..) import Echologo exposing (..)
import Element exposing (..) import Element exposing (..)
@ -11,11 +12,18 @@ import Svg exposing (..)
import Svg.Attributes as SvgA import Svg.Attributes as SvgA
exposing exposing
( color ( color
, fill , dx
, dy
, floodColor
, floodOpacity
, fontFamily , fontFamily
, fontSize , fontSize
, height , id
, in2
, in_
, operator
, r , r
, stdDeviation
, strokeWidth , strokeWidth
, viewBox , viewBox
, x , x
@ -23,21 +31,16 @@ import Svg.Attributes as SvgA
) )
{-| HSL = 155, 43.5, 57.6 couleurUI =
-} fromRgb << Color.toRgba
echoVert =
Color.fromRgba
{ red = 100 / 255
, green = 194 / 255
, blue = 155 / 255
, alpha = 255 / 255
}
vert t = vert t =
fromRgb <| Color.Manipulate.lighten t vertMante
Color.toRgba <|
Color.Manipulate.lighten t echoVert
couleurArrierePlan =
vert 0.3
petitEspacement = petitEspacement =
@ -56,7 +59,7 @@ bouton fonction label =
Input.button Input.button
[ centerY [ centerY
, padding petitEspacement , padding petitEspacement
, Background.color <| vert -0.2 , Background.color <| couleurUI <| vert -0.2
, Border.rounded 8 , Border.rounded 8
, Border.shadow , Border.shadow
{ blur = 10 { blur = 10
@ -70,20 +73,59 @@ bouton fonction label =
} }
entete hauteur largeur titre = entete largeur titre =
html <| html <|
svg svg
[ viewBox <| "0 0 " ++ String.fromInt largeur ++ " 30" [ viewBox <| "0 0 300 30"
, SvgA.height <| String.fromInt hauteur , SvgA.width <| String.fromInt largeur
] ]
<| <|
echologo [ defs [] [ ombreInterne ] ]
++ echologo couleurArrierePlan (SvgA.filter "url(#ombreInterne)")
++ [ text_ ++ [ text_
[ x "40" [ x "30"
, y "20" , y "25"
, fontFamily "Verdana" , fontFamily "Verdana"
, SvgA.fill "white" , SvgA.fill <| Color.Convert.colorToHex couleurArrierePlan
, fontSize "15" , fontSize "20"
, SvgA.filter "url(#ombreInterne)"
] ]
[ Svg.text titre ] [ Svg.text titre ]
] ]
ombreInterne =
filter [ id "ombreInterne" ]
[ feFlood [ floodColor "black", floodOpacity ".6" ] []
, feComposite [ in2 "SourceAlpha", operator "out" ] []
, feGaussianBlur [ stdDeviation "1" ] []
, feOffset [ dx ".1", dy ".5" ] []
, feComposite [ in2 "SourceAlpha", operator "in" ] []
, feMerge []
[ feMergeNode [ in_ "SourceGraphic" ] []
, feMergeNode [] []
]
]
designGeneral largeur titre elmt =
layout
[ height fill
, width fill
, padding tresGrandEspacement
, Background.color <| couleurUI <| couleurArrierePlan
]
<|
column
[ height fill
, width fill
, Background.color <| couleurUI <| vert 0
, Border.rounded 13
]
[ row []
[ entete
(largeur - 2 * (petitEspacement + grandEspacement))
titre
]
, elmt
]

Loading…
Cancel
Save