Commit eed291c8 authored by Abinaya Sudhir's avatar Abinaya Sudhir

lavish bootstrap adapted

parent ac7921b3
This diff is collapsed.
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>CNRS GarganText</title> <title>CNRS GarganText</title>
<link href="./dist/css/bootstrap.min.css" rel="stylesheet"> <link href="./dist/css/bootstrap.min.css" rel="stylesheet">
<link href="./dist/css/lavish-bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./dist/css/menu.css"/> <link rel="stylesheet" type="text/css" href="./dist/css/menu.css"/>
</head> </head>
<body> <body>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="./dist/css/login.min.css" rel="stylesheet"> <link href="./dist/css/login.min.css" rel="stylesheet">
<link href="./dist/css/bootstrap.css" rel="stylesheet"> <link href="./dist/css/bootstrap.css" rel="stylesheet">
<link href="./dist/css/lavish-bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./dist/css/menu.css"/> <link rel="stylesheet" type="text/css" href="./dist/css/menu.css"/>
<link href="./dist/css/Login.css" rel="stylesheet"> <link href="./dist/css/Login.css" rel="stylesheet">
......
module RandomText where
import Prelude
import Control.Monad.Eff (Eff(..))
import Control.Monad.Eff.Random (RANDOM(..), randomInt)
import Data.Array (length, (!!), head, tail, take, takeEnd, drop, dropEnd)
import Data.Maybe (Maybe(Nothing, Just), fromJust)
import Data.String (toCharArray, fromCharArray)
import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\))
import Partial (crash)
import Partial.Unsafe (unsafePartial)
import Unsafe.Coerce (unsafeCoerce)
--rando Ran x [] = Ran x []
--rando Ran x xs = Ran (x <> [x']) (rando xs')
-- where
-- Ran x' xs' = randomIt xs
--
remove :: forall t5. Int -> Array t5 -> Array t5
remove n [] = []
remove n xs = unsafePartial $ case n of
0 -> fromJust $ tail xs
_ -> (take n xs) <> (drop (n+1) xs)
data Ran = Ran { l :: Char, r :: Array Char}
randomIt :: forall t46. String -> Eff ( random :: RANDOM | t46 ) Ran
randomIt ar = unsafePartial $ do
let ar' = toCharArray ar
n <- randomInt 0 (length ar' - 1)
let maybeChar = (ar' !! n )
let rest = remove n ar'
case maybeChar of
Nothing ->
crash "it should not happen"
Just char ->
pure $ Ran {l : char, r : rest}
randomText :: String -> String
randomText txt = fromCharArray ( start <> middle <> end)
where
txt' = toCharArray txt
start = take 2 txt'
middle = dropEnd 2 $ drop 2 txt'
end = takeEnd 2 txt'
testText :: String -> String
testText txt = case (length (toCharArray txt)) >= 5 of
true -> randomText txt
_ -> txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment