Chan page is nice

This commit is contained in:
Nicolas A. Tonne
2015-04-10 01:24:42 +02:00
parent f997de2a36
commit 00dcb03727
7 changed files with 136 additions and 103 deletions

View File

@@ -6,7 +6,6 @@
else $list=$list[1];
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<?php include("php/header.php"); ?>
@@ -19,48 +18,69 @@
<a href="//zoff.no" class="brand-logo hide-on-small-only">
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff">
</a>
<div class="brand-logo center">
<a href="zoff.no" class="hide-on-med-and-up">Zöff</a>
<div class="brand-logo">
<a href="//zoff.no" class="hide-on-med-and-up">Zöff</a>
<span class="hide-on-med-and-up">/</span>
<span id="chan" class="chan" title="Show big URL" onclick="show()"><?php echo(ucfirst($list));?></span>
<span id="chan" class="chan hide" title="Show big URL" onclick="show()"><?php echo(ucfirst($list));?></span>
</div>
<form>
<div class="input-field">
<input id="search" type="search" required title="Search for songs..." spellcheck="false" placeholder="Search" onsubmit="null;" autocomplete="off">
<label for="search"><i class="mdi-action-search"></i></label>
<i class="mdi-navigation-close"></i>
</div>
</form>
<ul id="nav-mobile" class="right">
<ul class="right">
<li>
<a href="#" id="settings" onclick="skip();">
<a class="nav-btn" href="#" id="skip" onclick="skip();">
<i class="mdi-av-skip-next"></i>
Skip
<span class="hover-text">Skip</span>
</a>
</li>
<li>
<a href="#" onclick="admin();">
<a class="nav-btn" href="#" onclick="admin();" data-activates="mobile-demo" id="settings">
<i class="mdi-action-settings"></i>
Settings
<span class="hover-text">Conf</span>
</a>
</li>
</ul>
<ul class="side-nav" id="mobile-demo">
<li><a href="sass.html">Sass</a></li>
<li><a href="components.html">Components</a></li>
<li><a href="javascript.html">Javascript</a></li>
<li><a href="mobile.html">Mobile</a></li>
<?php include("php/panel.php");?>
</ul>
<form id="searchform">
<div>
<input id="search" type="search" required title="Search for songs..." spellcheck="false" placeholder="Search" onsubmit="null;" autocomplete="off">
<!--<label for="search"><i class="mdi-action-search"></i></label>
<i class="mdi-navigation-close"></i>-->
</div>
</form>
</div>
</nav>
</div>
</header>
<main class="center-align container">
<div class="section">
<main class="container center-align main">
<div class="row">
<div class="col s12 m9 video-container">
<div id="player" class="ytplayer"></div>
</div>
<div id="playlist" class="col s12 m3">
<div id="wrapper">
<div id="list-song-html">
<div id="list-song" class="card list-song">
<a class="clickable votebg">
<div class="card-image cardbg list-image"></div>
</a>
<div class="card-content">
<p class="left-align">
<span class="flow-text truncate list-title"></span>
<span class="highlighted hide">Votes:&nbsp;</span>
<span class="list-votes hide"></span>
</p>
</div>
<div class="card-action hide">
<a id="del" onclick="vote('id','del')" class="clickable" class="waves-effect waves-orange btn-flat">Remove</a>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<div id="controls"></div>
<?php include("php/footer.php"); ?>
</body>

View File

@@ -46,7 +46,6 @@ foreach($fil as $files){
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<?php include("header.php"); ?>
@@ -55,7 +54,7 @@ foreach($fil as $files){
<header>
<nav>
<div class="nav-wrapper">
<a href="//zoff.no" class="brand-logo hide-on-small-only">
<a href="#" class="brand-logo hide-on-small-only">
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff">
</a>
<a href="zoff.no" class="brand-logo hide-on-med-and-up">Zöff</a>

View File

@@ -106,15 +106,40 @@ hide mdi-action-visibility mdi-action-visibility-off
/* INDEX PAGE */
#zicon{
/* width: 50px; */
/* margin: 7px 20px; */
height: 100%;
}
.section .search {
padding-top: 2.5rem;
transition: padding 1s ease;
}
#channels li{opacity: 0;}
/* Channel page */
/*------------------- Channel page ---------------------------------------------------------------------------- */
#searchform{
width: 50%;
margin-left: 25%;
}
.main{
width: 100%;
max-width:99%;
margin: 0px;
padding:0px;
}
.video-container{
height: calc(100% - 64px);
}
#playlist{
padding:0px 15px;
}
.nav-btn
{
transition: background-color .2s;
min-width: 64px;
}
.nav-btn:hover{background-color:rgba(0,0,0,0.5);}
.hover-text{display:none;}
.nav-btn:hover > .hover-text {display:inline;}
.list-image{height:40px;}
.list-title{display:block;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -5,6 +5,7 @@ var myScroll;
var scroller = false;
var showToggle =true;
var chan = $("#chan").html();
var list_html = $("#list-song-html").html();
var hasadmin=0;
function updateList()
@@ -38,23 +39,18 @@ function updateList()
$.each(list.songs, function(j, listeID){
var video_title=listeID.title.replace(/\\\'/g, "'").replace(/&quot;/g,"'").replace(/&amp;/g,"&");
var video_id = listeID.id;
if(find && $.inArray(video_id, bright) == -1) brightness = "brightness";
else if(find && $.inArray(video_id, bright) != -1) brightness = "brightness fullbrightness";
else brightness = "";
var video_thumb = "http://i.ytimg.com/vi/"+video_id+"/mqdefault.jpg";
var odd = ""; if(j%2===0)odd=" oddlist";
var delsong = ""; if(pass_corr=="correct")delsong="<input id='del' title='Remove' type='button' class='button' value='X' onclick=\"vote('"+video_id+"','del')\">";
var finalhtml="<div id='result' class='"+video_id+" result "+brightness+" lresult"+odd+"'>"+
"<img class='thumb lthumb' src='"+video_thumb+"'>"+
"<div class='ltitle'>"+video_title+"</div>"+
"<div class='votes'>"+listeID.votes+
"<a onclick=\"vote('"+video_id+"','pos');\" id='plus'>+</a>"+
"<a onclick=\"vote('"+video_id+"','neg');\" id='minus'>-</a>"+
delsong+
"</div>"+
"</div>";
$("#wrapper").append(finalhtml);
var video_thumb = "background-image:url('http://img.youtube.com/vi/"+video_id+"/mqdefault.jpg');";
//var delsong = ""; if(pass_corr=="correct");
var video_votes = listeID.votes;
$("#wrapper").append(list_html);
var song = $("#list-song");
song.find(".list-title").text(video_title);
song.find(".list-votes").text(video_votes);
song.find(".votebg").attr("onclick", "vote('"+video_id+"','pos')");
song.find(".list-image").attr("style",video_thumb);
song.attr("id",video_id);
});
if($("#playlist").height() != $("#player").height() || (peis && $("#playlist").height() != $("#jplayer").height()))
{
if(!window.mobilecheck())
@@ -101,9 +97,6 @@ function updateList()
else
$("#setpass").text("Channel has no admin");
}
$("#settings").css("visibility", "visible");
$("#settings").css("opacity", "0.7");
$("#wrapper").css("opacity", "1");
}, 2500);
}

View File

@@ -11,14 +11,11 @@ function getCookie(cname) {
$(document).ready(function (){
Materialize.showStaggeredList('#channels');
var deg = 0;
var pr = 15;
var pad = 0;
document.getElementById("zicon").addEventListener("click", function(){
deg = deg + 365;
pr = pr + 0.5;
document.getElementById("zicon").style.transform = "rotate("+deg+"deg)";
document.getElementById("zicon").style.width = pr+"%";
if(pr >= 60)
pad+=10;
document.getElementById("zicon").style.paddingLeft = pad+"%";
if(pad >= 100)
window.location.href = 'https://www.youtube.com/v/mK2fNG26xFg?autoplay=1&showinfo=0&autohide=1';
});
if(navigator.userAgent.toLowerCase().indexOf("android") > -1){

View File

@@ -37,6 +37,7 @@ var colorThief;
$(document).ready(function()
{
$("#settings").sideNav();
colorThief = new ColorThief();
window.mobilecheck = function() {
var check = false;
@@ -46,8 +47,6 @@ $(document).ready(function()
if(!window.mobilecheck())
{
$("#change").css("opacity", "0");
$("#wrapper").css("opacity", "0");
Notification.requestPermission();
}