From dc431677f9806fe16b349d8f17f090d2ea14748a Mon Sep 17 00:00:00 2001 From: "Nicolas A. Tonne" Date: Tue, 7 Apr 2015 18:47:35 +0200 Subject: [PATCH] Cards --- php/nochan.php | 52 +++++++++++++++++++++++++++++++------- static/css/materialize.css | 13 +++++++--- static/css/style.css | 26 +++++++++++++++++++ 3 files changed, 78 insertions(+), 13 deletions(-) diff --git a/php/nochan.php b/php/nochan.php index e36b4aab..c686330e 100755 --- a/php/nochan.php +++ b/php/nochan.php @@ -8,6 +8,7 @@ if(isset($_GET['chan'])){ $dir = scandir('./lists'); $channels = array(); $all_channels = array(); +$chan_data = array(); //for all chan data $time = 60*60*24*4; //4 dager $to = 60*60*24*2; $i = 0; @@ -36,13 +37,14 @@ foreach($fil as $files){ if($i <= 12 && (!array_key_exists("frontpage", $data['conf']) || $data['conf']['frontpage'] == "true")){ //If it is true, the channelname will be shown on the frontpage array_push($channels, ucfirst(str_replace(".json", "", $files))); array_push($viewers, sizeof($data["conf"]["views"])); + array_push($chan_data, $data); } } $i++; array_push($all_channels, ucfirst(str_replace(".json", "", $files))); } -} +} ?> @@ -56,9 +58,9 @@ foreach($fil as $files){ @@ -90,11 +92,43 @@ foreach($fil as $files){
- ".$ch." - "; $v++;} - ?> +
+ $d) + { + if(count($d["songs"])>0) + { + $ch=htmlspecialchars($channels[$v]); + $views=$viewers[$v]; + $now=reset($d["nowPlaying"]); + $img="http://img.youtube.com/vi/".$now["id"]."/hqdefault.jpg"; + //echo "".$ch.""; + ?> +
+
+ +
+ +
+
+
+

+ +
+ Viewers:  + Songs:  +

+
+
+ Listen +
+
+
+ +
diff --git a/static/css/materialize.css b/static/css/materialize.css index 404fe3f2..2d848887 100755 --- a/static/css/materialize.css +++ b/static/css/materialize.css @@ -4807,7 +4807,7 @@ span.badge { margin-right: -0.75rem; } .section { - padding-top: 1rem; + padding-top: 3rem; padding-bottom: 1rem; } .section.no-pad { padding: 0; } @@ -5404,7 +5404,9 @@ small { right: 0; top: 0; bottom: 0; - width: 100%; } + width: 100%; + height: 18%; +} .card .card-image .card-title { position: absolute; bottom: 0; @@ -5420,10 +5422,13 @@ small { line-height: 48px; } .card .card-action { border-top: 1px solid rgba(160, 160, 160, 0.2); - padding: 20px; } + /* padding: 20px; */ } .card .card-action a { + padding: 0; + width: 100%; color: #ffab40; - margin-right: 20px; + /* background-color: rgba(28, 110, 236, 0.51); */ + /* margin-right: 20px; */ -webkit-transition: color .3s ease; -moz-transition: color .3s ease; -o-transition: color .3s ease; diff --git a/static/css/style.css b/static/css/style.css index 4a059a4a..ea462aac 100755 --- a/static/css/style.css +++ b/static/css/style.css @@ -33,6 +33,29 @@ main { width:100%; } +.highlighted{ + font-weight: 300; +} + +.invisible{ + opacity: 0; +} + +.cardbg{ + background-repeat: no-repeat; + background-size: 124%; + background-position: 50% 50%; + background-color: #171717; + height: 120px; +} + +.card .card-action a { + padding: 0; + margin: 0; + width: 100%; + +} + /* play mdi-av-play-arrow @@ -57,3 +80,6 @@ hide mdi-action-visibility mdi-action-visibility-off margin: 7px 20px; } +.section .search { + padding-top: 2.5rem; +}