forked from varia/web-narrowcast
Browse Source
created link and about page; moved scripts to sepparate JS file; minor css arrangements side bar etc;master
JoanaChicau
4 years ago
4 changed files with 208 additions and 179 deletions
@ -0,0 +1,23 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<title>NARROWCAST</title> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
|||
<link rel="stylesheet" type="text/css" media="all" href="narrowstyle.css"></link> |
|||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css" rel="stylesheet" type='text/css'> |
|||
</head> |
|||
<body id="about"> |
|||
|
|||
|
|||
<div class="linkmore"><a href="https://stream.vvvvvvaria.org/">back<span> ↗</span><br></a></div> |
|||
|
|||
|
|||
<div> |
|||
<h1> about the < NARROWCAST > </h1> |
|||
<p class="about"> ... some more words from THE VARIA BROADCATS TEAM (AKA BROADCATS ˚ᆺ˚)´ coming soon ... </p> |
|||
|
|||
</div> |
|||
|
|||
</body> |
|||
</html> |
@ -0,0 +1,136 @@ |
|||
// SCRIPTS FOR THE NEW AUDIO PLAYER
|
|||
|
|||
(function(){ |
|||
|
|||
function waitForIt(selector, time) { |
|||
if(document.querySelector(selector)!=null) { |
|||
|
|||
var chat_title = document.getElementsByClassName("chatbox-title__text")[0]; |
|||
var element = document.createElement("span"); |
|||
|
|||
element.innerHTML = '<audio id="player" preload="none" src="http://w-i-t-m.net:8001/radiodrama"></audio><div><button onclick="document.getElementById(\'player\').play()">Play</button><button onclick="document.getElementById(\'player\').pause();document.getElementById(\'player\').src=document.getElementById(\'player\').src;">Stop</button><button onclick="document.getElementById(\'player\').volume += 0.1">Vol +</button><button onclick="document.getElementById(\'player\').volume -= 0.1">Vol -</button></div>'; |
|||
|
|||
chat_title.insertAdjacentElement('afterend', element); |
|||
|
|||
return; |
|||
} |
|||
else { |
|||
setTimeout(function() { |
|||
|
|||
waitForIt(selector, time); |
|||
|
|||
}, time); |
|||
} |
|||
} |
|||
|
|||
waitForIt(".toggle-smiley", 1000); |
|||
})(); |
|||
|
|||
$(function() { |
|||
console.log("PARENT READY"); |
|||
$("iframe").on("load", function(){ |
|||
console.log("LOADED"); |
|||
$(this).contents().find('.kiwi-startup-common').hide(); |
|||
}); |
|||
}); |
|||
|
|||
|
|||
// SCRIPT for button to hide side pannel -->
|
|||
|
|||
function fside() { |
|||
var element = document.getElementById("side"); |
|||
element.classList.toggle("sideminclicked"); |
|||
} |
|||
|
|||
|
|||
function fsidemobile(x) { |
|||
if (x.matches) { // If media query matches
|
|||
var element = document.getElementById("side"); |
|||
element.classList.toggle("sideminclicked"); |
|||
} else { |
|||
element.classList.toggle(""); |
|||
} |
|||
} |
|||
|
|||
var x = window.matchMedia("(max-width: 768px)") |
|||
fsidemobile(x) |
|||
x.addListener(fsidemobile) |
|||
|
|||
// SCRIPT DRAG AND RESIZE
|
|||
|
|||
|
|||
// library: https://interactjs.io/docs/installation#cdn-streamlined
|
|||
// needs embed <script src="interact.min.js"></script>
|
|||
// script above same as <script src="https://cdnjs.cloudflare.com/ajax/libs/interact.js/1.2.6/interact.min.js"></script> -->
|
|||
// also found this other options: https://www.webcomponents.org/element/jifalops/drag-resize and https://codepen.io/zz85/pen/gbOoVP
|
|||
|
|||
|
|||
interact('.resize-drag') |
|||
.draggable({ |
|||
onmove: window.dragMoveListener |
|||
}) |
|||
.resizable({ |
|||
preserveAspectRatio: true, |
|||
edges: { left: true, right: true, bottom: true, top: true } |
|||
}) |
|||
.on('resizemove', function (event) { |
|||
var target = event.target, |
|||
x = (parseFloat(target.getAttribute('data-x')) || 0), |
|||
y = (parseFloat(target.getAttribute('data-y')) || 0); |
|||
|
|||
// update the element's style
|
|||
target.style.width = event.rect.width + 'px'; |
|||
target.style.height = event.rect.height + 'px'; |
|||
|
|||
// translate when resizing from top or left edges
|
|||
x += event.deltaRect.left; |
|||
y += event.deltaRect.top; |
|||
|
|||
target.style.webkitTransform = target.style.transform = |
|||
'translate(' + x + 'px,' + y + 'px)'; |
|||
|
|||
target.setAttribute('data-x', x); |
|||
target.setAttribute('data-y', y); |
|||
target.textContent = event.rect.width + '×' + event.rect.height; |
|||
}); |
|||
|
|||
function dragMoveListener (event) { |
|||
var target = event.target, |
|||
// keep the dragged position in the data-x/data-y attributes
|
|||
x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx, |
|||
y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy; |
|||
|
|||
// translate the element
|
|||
target.style.webkitTransform = |
|||
target.style.transform = |
|||
'translate(' + x + 'px, ' + y + 'px)'; |
|||
|
|||
// update the posiion attributes
|
|||
target.setAttribute('data-x', x); |
|||
target.setAttribute('data-y', y); |
|||
} |
|||
|
|||
|
|||
// src="https://vjs.zencdn.net/7.10.2/video.min.js"
|
|||
|
|||
// var player = videojs("#player");
|
|||
|
|||
|
|||
// var aud1= document.getElementById('audioBG');
|
|||
// var dur1= document.getElementById('dur1');
|
|||
// function mDur(dur,aud){dur.max= aud.duration};
|
|||
// function mPlay(dur,aud){dur.value=aud.currentTime};
|
|||
// function mSet(dur,aud){aud.currentTime=dur.value};
|
|||
|
|||
|
|||
// function playpause(podcast){
|
|||
// var myAudio = document.getElementById(podcast);
|
|||
// var myIcon = document.querySelector("."+podcast);
|
|||
// if (myAudio.paused) {
|
|||
// myIcon.className = podcast+" fa b-pause";
|
|||
// myAudio.play();
|
|||
// } else {
|
|||
// myIcon.className = podcast+" fa b-play";
|
|||
// myAudio.pause();
|
|||
// }
|
|||
// }
|
Loading…
Reference in new issue