packages feed

svg-icons 2.6.0.0 → 2.7.0.0

raw patch · 5 files changed

+190/−58 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- SvgIcons.Core.Utils: cleanDecimals :: Int -> String -> String
+ SvgIcons.Icons.Coding: xmlCode :: Svg
+ SvgIcons.Icons.Computer: circulo :: Svg
+ SvgIcons.Icons.Office: bookOpen :: Svg

Files

src/SvgIcons/Core/Utils.hs view
@@ -10,7 +10,6 @@   , horizontalMirrorMatrix
   , verticalMirrorMatrix
   , frame
-  , cleanDecimals
   ) where
 
 import Data.Char
@@ -104,7 +103,7 @@ consecutive corners of the viewbox and also connects opposite
 middle points of the sides of the viewbox.
 
-![framed svg](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/test/test_strk.svg)
+![framed svg](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/test/test.svg)
 -}
 frame 
   :: Float    -- ^ stroke-width
@@ -131,26 +130,3 @@       l  (x + w/2) (y + h)
       m   x        (y + h/2)
       l  (x + w)   (y + h/2)
-
-
--- Takes a number n and a string s, 
--- and returns a string equal to s except that every decimal
--- number inside s will have its decimal part capped at n digits
-{- |
-Please ignore this function.
--}
-cleanDecimals :: Int -> String -> String
-cleanDecimals n s = 
-    f [] [] s
-  where
-    f aux acc [] = reverse (aux ++ acc)
-    f aux acc (c:cs) = 
-      if c == '.'
-        then f "." acc cs
-        else if aux == []
-          then f [] (c : acc) cs
-          else if (not $ isDigit c)
-            then f [] (c : aux ++ acc) cs
-            else if (length aux < n)
-              then f (c : aux) acc cs
-              else f aux acc cs
src/SvgIcons/Icons/Coding.hs view
@@ -5,6 +5,7 @@ module SvgIcons.Icons.Coding
   ( svgCoding
   , haskell
+  , xmlCode
   ) where
 
 import           Text.Blaze.Svg11 ((!))
@@ -22,11 +23,13 @@ >svgCoding :: [ (String , S.Svg) ]
 >svgCoding =
 >  [ (,) "haskell" haskell
+<  , (,) "xmlCode" xmlCode
 >  ]
 -}
 svgCoding :: [ (String , S.Svg) ]
 svgCoding =
   [ (,) "haskell" haskell
+  , (,) "xmlCode" xmlCode
   ]
 
 
@@ -114,4 +117,53 @@       l   x10  y5
       l   x13  y5
       l   x13  y7
-      S.z+      S.z
+
+    
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/coding/xmlCode_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/coding/xmlCode_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/coding/xmlCode_strk.svg)
+-}
+xmlCode :: Svg
+xmlCode =
+    S.g $ do
+      S.defs $ 
+        S.path
+          ! A.id_ "HaskellSvgIcons-xmlCode-triangle"
+          ! A.d triangleDirs
+          ! A.strokeLinejoin "round"
+      S.use
+        ! A.xlinkHref "#HaskellSvgIcons-xmlCode-triangle"
+        ! A.transform (rotateAround 315 0 0)
+      S.use
+        ! A.xlinkHref "#HaskellSvgIcons-xmlCode-triangle"
+        ! A.transform (rotateAround 135 0 0)
+      S.path
+        ! A.d barDirs
+        ! A.transform (rotateAround  11 0 0)
+  where
+    k0 = 0.1
+    k1 = 0.5
+    k2 = 0.7
+    r1 = (k2 - k1) / 2
+    k3 = 0.55
+    triangleDirs = mkPath $ do
+      m   k1   k1
+      l   k0   k1
+      aa  r1   r1  0  True  False k0  k2
+      l   k2   k2
+      l   k2   k0
+      aa  r1   r1  0  True  False k1  k0
+      S.z
+    barDirs = mkPath $ do
+      m  (-r1)  k3
+      aa   r1   r1  0  True  False   r1    k3
+      l    r1 (-k3)
+      aa   r1   r1  0  True  False (-r1) (-k3)
+      S.z
+
+
+
src/SvgIcons/Icons/Computer.hs view
@@ -4,6 +4,7 @@ 
 module SvgIcons.Icons.Computer 
   ( svgComputer
+  , circulo
   , accept
   , cancel
   , plus
@@ -29,7 +30,8 @@ 
 >svgComputer :: [ (String , S.Svg) ]
 >svgComputer =
->  [ (,) "accept"      accept
+>  [ (,) "circulo"     circulo
+>  , (,) "accept"      accept
 >  , (,) "cancel"      cancel
 >  , (,) "plus"        plus
 >  , (,) "maximize"    maximize
@@ -42,7 +44,8 @@ -}
 svgComputer :: [ (String , S.Svg) ]
 svgComputer =
-  [ (,) "accept"      accept
+  [ (,) "circulo"     circulo
+  , (,) "accept"      accept
   , (,) "cancel"      cancel
   , (,) "plus"        plus
   , (,) "maximize"    maximize
@@ -57,8 +60,63 @@ --------------------------------------------------------------------------------
 
 
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/circulo_fill.svg)
 
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/circulo_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/circulo_strk.svg)
+-}
+circulo :: Svg
+circulo =
+  S.g $ do
+    S.path
+      ! A.d dirs
+  where
+    r1 = 0.8
+    r2 = 0.9
+    dirs = mkPath $ do
+      m   r1  0
+      aa  r1  r1  0  True  False  r1  0.0001
+      S.z
+      m   r2  0
+      aa  r2  r2  0  True  True   r2  (-0.0001)
+      S.z
+
+
+
+
+
 {- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_strk.svg)
+-}
+accept :: Svg
+accept =
+  S.g $ do
+    S.path
+      ! A.strokeLinejoin "round"
+      ! d dirs
+      ! A.transform (translate (-0.3) 0.3 <> rotateAround 45 0 0)
+  where
+    k1 = 0.1
+    k2 = 0.5
+    k3 = 1.3
+    dirs = mkPath $ do
+      m   (-k1) (-k1)
+      l   (-k2) (-k1)
+      aa    k1    k1   0  True  False (-k2) ( k1)
+      l   ( k1) ( k1)
+      l   ( k1) (-k3)
+      aa    k1    k1   0  True  False (-k1) (-k3)
+      S.z
+
+
+
+{- |
 ![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/plus_fill.svg)
 
 ![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/plus_full.svg)
@@ -100,35 +158,6 @@ cancel =
   S.g $ 
     plus ! A.transform (rotateAround 45 0 0)
-
-
-
-{- |
-![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_fill.svg)
-
-![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_full.svg)
-
-![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/computer/accept_strk.svg)
--}
-accept :: Svg
-accept =
-  S.g $ do
-    S.path
-      ! A.strokeLinejoin "round"
-      ! d dirs
-      ! A.transform (translate (-0.3) 0.3 <> rotateAround 45 0 0)
-  where
-    k1 = 0.1
-    k2 = 0.5
-    k3 = 1.3
-    dirs = mkPath $ do
-      m   (-k1) (-k1)
-      l   (-k2) (-k1)
-      aa    k1    k1   0  True  False (-k2) ( k1)
-      l   ( k1) ( k1)
-      l   ( k1) (-k3)
-      aa    k1    k1   0  True  False (-k1) (-k3)
-      S.z
 
 
 
src/SvgIcons/Icons/Office.hs view
@@ -5,6 +5,7 @@ module SvgIcons.Icons.Office 
   ( svgOffice
   , archive
+  , bookOpen
   , briefcase
   , clipboard
   , document
@@ -31,6 +32,7 @@ >svgOffice :: [ (String , S.Svg) ]
 >svgOffice =
 >  [ (,) "archive"    archive
+>  , (,) "bookOpen"   bookOpen
 >  , (,) "briefcase"  briefcase
 >  , (,) "clipboard"  clipboard
 >  , (,) "document"   document
@@ -45,6 +47,7 @@ svgOffice :: [ (String , S.Svg) ]
 svgOffice =
   [ (,) "archive"    archive
+  , (,) "bookOpen"   bookOpen
   , (,) "briefcase"  briefcase
   , (,) "clipboard"  clipboard
   , (,) "document"   document
@@ -577,3 +580,75 @@         ! (A.cy .: (y5 + y4)/2)
         ! (A.rx .: rx2)
         ! (A.ry .: ry2)
+
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/office/bookOpen_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/office/bookOpen_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/office/bookOpen_strk.svg)
+-}
+bookOpen :: Svg
+bookOpen =
+  S.g $ do
+    S.defs $ do
+      S.path
+        ! A.id_ "HaskellSvgIcons-bookOpen-cover"
+        ! A.d coverDirs
+        ! A.fill "none"
+      S.path
+        ! A.id_ "HaskellSvgIcons-bookOpen-pages"
+        ! A.d pagesDirs
+        ! A.strokeLinejoin "round"
+    S.use
+      ! A.xlinkHref "#HaskellSvgIcons-bookOpen-cover"
+    S.use
+      ! A.xlinkHref "#HaskellSvgIcons-bookOpen-cover"
+      ! A.transform (horizontalMirrorMatrix)
+    S.use
+      ! A.xlinkHref "#HaskellSvgIcons-bookOpen-pages"
+    S.use
+      ! A.xlinkHref "#HaskellSvgIcons-bookOpen-pages"
+      ! A.transform (horizontalMirrorMatrix)
+    S.path
+      ! A.d spineDirs
+      ! A.fill "none"
+      ! A.strokeLinejoin "round"
+  where
+    y1 = 0.55
+    y2 = 0.65
+    y3 = 0.75
+    y4 = -0.65
+    y5 = -0.7
+    y6 = -0.75
+    y7 = y5
+    x1 = 0
+    x2 = 0.75
+    x3 = 0.85
+    x4 = 0.95
+    (q1x,q1y) = (0.5 , 0.55)
+    (q2x,q2y) = (0.4 , 0.45)
+    (q3x,q3y) = (0.4 ,-1.00)
+    coverDirs = mkPath $ do
+      m   x1   y3
+      l   x4   y3
+      l   x4   y4
+      l   x3   y4
+      m   x1   y3
+      q   q1x  q1y  x3  y2
+      l   x3   y5
+      l   x2   y5
+    pagesDirs = mkPath $ do
+      m   x1   y3
+      q   q2x  q2y  x2  y1
+      l   x2   y6
+      q   q3x  q3y  x1  y7
+      S.z
+    spineDirs = mkPath $ do
+      m   (x1 - 0.07)  (y3 + 0.02)
+      l   (x1 + 0.07)  (y3 + 0.02)
+      l   (x1 + 0.07)   y3
+      l   (x1 - 0.07)   y3
+      S.z
svg-icons.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4
 name:               svg-icons
-version:            2.6.0.0
+version:            2.7.0.0
 homepage:           https://github.com/RamiroPastor/SvgIcons
 license:            BSD-3-Clause
 license-file:       LICENSE