diff --git a/katas/BerlinClock/solutions/blehner78/README.md b/katas/BerlinClock/solutions/blehner78/README.md new file mode 100644 index 0000000..4524148 --- /dev/null +++ b/katas/BerlinClock/solutions/blehner78/README.md @@ -0,0 +1,17 @@ +# Berlin Clock draft +One try of solving the Berlin Clock with some HTML/CSS/Javascript. I have +decided to keep it as simple as possible by getting the current time +through the window object. + +## Dependencies +jquery + +## Demo +index.html + +## Features +Hide the info box by uncommenting the display: none line within the +css/styles.css file + +## Author +Bernhard Lehner diff --git a/katas/BerlinClock/solutions/blehner78/css/style.css b/katas/BerlinClock/solutions/blehner78/css/style.css new file mode 100644 index 0000000..9dc1ac1 --- /dev/null +++ b/katas/BerlinClock/solutions/blehner78/css/style.css @@ -0,0 +1,152 @@ +/** + * Styles for the Berlin Clock + **/ + +body { + font-family: Arial, sans-serif; +} +h1 { + font-size: 40px; + font-weight: bold; + margin: 0; + padding: 20px 0 12px 0; + color: #333; +} +p { + margin: 0; + padding: 0; + color: #333; +} + +.content { + display:flex; + vertical-align: middle; + height: 100%; +} + +/** + * CLOCK + **/ +.clock { + width: 320px; + height: auto; + margin: auto; + position: relative; + background: #ffffff; +} +.seconds_row { + display: block; + width: 80px; + height: 80px; + background-color: #fff; + margin: auto; + border-radius: 50%; + border: 16px solid #ddd; + margin-bottom: 12px; +} + #second { + position: relative; + width: 80px; + height: 80px; + background-color: yellow; + border-radius: 50%; + } +.five_hours_row, .one_hour_row, .five_minutes_row, .one_minute_row { + display: block; + position: relative; + width: 100%; + min-height: 60px; + border-radius: 12px; + padding: 18px 0px 6px 6px; + background-color: #ddd; + margin-bottom: 12px; + overflow: hidden; + text-align: center; +} +.col { + display: inline-block; + background-color: #fff; + margin-right: 6px; + width: 20%; + height: 48px; + border-radius: 6px; +} +.col11 { + display: inline-block; + background-color: #fff; + margin-right: 6px; + width: 5%; + height: 48px; + border-radius: 6px; +} +.hb4 { + display: block; + width: auto; + height: 48px; + background-color: red; + border-radius: 6px; +} +.mb4 { + display: block; + width: auto; + height: 48px; + background-color: yellow; + border-radius: 6px; +} +.mb11 { + display: block; + width: auto; + height: 48px; + background-color: yellow; + border-radius: 6px; +} +.mb11.red { + background-color: red; +} + + + +/** + * INFOBLOCK + * Add display none to the class infoblock to hide it + **/ + +.infoblock { + width: 280px; + margin:auto; + position: absolute; + background-color: #efefef; + right:20px; + bottom:20px; + border-radius: 12px; + overflow: hidden; + color: #888; + /*display:none;*/ +} +#row0 { + position: relative; + padding: 6px 12px 8px; + background-color: #ddd; +} +#row1 { + position: relative; + padding: 6px 12px 8px; +} +#row2 { + position: relative; + padding: 6px 12px 8px; + background-color: #ddd; +} +#row3 { + position: relative; + padding: 6px 12px 8px; +} +#row4 { + position: relative; + padding: 6px 12px 8px; + background-color: #ddd; +} +#row5 { + position: relative; + padding: 6px 12px 8px; +} \ No newline at end of file diff --git a/katas/BerlinClock/solutions/blehner78/index.html b/katas/BerlinClock/solutions/blehner78/index.html new file mode 100644 index 0000000..36a60f6 --- /dev/null +++ b/katas/BerlinClock/solutions/blehner78/index.html @@ -0,0 +1,67 @@ + +
+CURRENT TIME
'); + }, 100); +} + +// set light +function setLight(id, visible) { + if (visible) { + $('#' + id).show(); + } else { + $('#' + id).hide(); + } +} diff --git a/katas/LangtonAnt/solutions/blehner78/README.md b/katas/LangtonAnt/solutions/blehner78/README.md new file mode 100644 index 0000000..4916fb7 --- /dev/null +++ b/katas/LangtonAnt/solutions/blehner78/README.md @@ -0,0 +1,11 @@ +# Langton Ant draft +One try of solving the Langton Ant with PHP + +## Dependencies +PHP + +## Demo +index.php + +## Author +Bernhard Lehner diff --git a/katas/LangtonAnt/solutions/blehner78/css/style.css b/katas/LangtonAnt/solutions/blehner78/css/style.css new file mode 100644 index 0000000..7ef5072 --- /dev/null +++ b/katas/LangtonAnt/solutions/blehner78/css/style.css @@ -0,0 +1,72 @@ +/** + * Styles for the Langtons Ant + **/ + +body { + font-family: Arial, sans-serif; +} +h1 { + font-size: 40px; + font-weight: bold; + margin: 0; + padding: 20px 0 12px 0; + color: #333; +} +p { + margin: 0; + padding: 0; + color: #333; +} + +.content { + display:flex; + vertical-align: middle; + height: 100%; +} +.langtonsant { + width: 400px; + height: 400px; + margin: auto; + position: relative; + background: #ffffff; + border: 12px solid #dedede; +} +.langtonsant img { + width: 100%; + height: 100%; +} + +/** + * INFOBLOCK + * Add display none to the class infoblock to hide it + **/ + +.infoblock { + width: 280px; + margin:auto; + position: absolute; + background-color: #efefef; + right:20px; + bottom:20px; + border-radius: 12px; + overflow: hidden; + color: #888; + padding:20px; + /*display:none;*/ +} +.infoblock p { + padding: 6px 12px 8px; +} + + + +.antCanvas { + position: relative; + display: block; + margin: auto; + border: 12px solid #dedede; +} +.pixel { + position: absolute; + display: inline-block; +} \ No newline at end of file diff --git a/katas/LangtonAnt/solutions/blehner78/index.php b/katas/LangtonAnt/solutions/blehner78/index.php new file mode 100644 index 0000000..33d9781 --- /dev/null +++ b/katas/LangtonAnt/solutions/blehner78/index.php @@ -0,0 +1,151 @@ +"; + for($x = 0; $x < width; $x++){ + for($y = 0; $y < height; $y++){ + if(isset($antgrid[$x][$y])){ + $pagecontent .= ""; + //$step_count++; + } + } + } + $pagecontent .= ""; + $pagecontent .= "Ant Grid: w=".width." h=".height."
"; + $pagecontent .= "Pixel Size: ".pixelsize."
"; + $pagecontent .= "Steps: ".$step_count."
"; + $pagecontent .= "