// designed by Angeliki Diakrousi // draggable $(document).ready(function() { var a = 3; $('.draggable').draggable({ start: function(event, ui) { $(this).css("z-index", a++); } }); // $('#resize').resizable({handles: 'se'}).draggable({ // start: function(event, ui) { $(this).css("z-index", a++); } // });; // font size relative to div draggable/resizable size var $wrapper = $(".scaleable-wrapper"); $wrapper.each(function (d) { var $this = $(this); // var $el = $("#very-specific-design"); var elHeight = $this.outerHeight(); var elWidth = $this.outerWidth(); $this.resizable({ resize: doResize }); function doResize(event, ui) { var scale, origin; scale = Math.min( ui.size.width / elWidth, ui.size.height / elHeight ); // scale=1.0; // scale=2*scale $this.css({ transform: "translate(-50%, -50%) " + "scale(" + scale + ")" }); } var starterData = { size: { width: $this.width(), height: $this.height() } } // console.log("starterData", starterData, this); doResize(null, starterData); }); // scripts for tab button function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } // var a1 = document.getElementById("a1"), a2 = document.getElementById("a2"), but = document.getElementById("but"); but.addEventListener("click", function () { if (a1.paused) { a1.play(); a2.play(); a3.play(); a4.play(); } else { a1.pause(); a2.pause(); a3.pause(); a4.pause(); } }) a1.addEventListener("play", function(){ but.innerHTML="pause" }) a1.addEventListener("pause", function(){ but.innerHTML="listen" }) var links=document.querySelectorAll("div.sub a") for (var i=0, l=links.length; idiv'), transcriptWrapper = document.querySelector('#transcriptWrapper'), audio = document.querySelector('#a2'), previousDialogueTime = -1; function playTranscript() { var currentDialogueTime = Math.max.apply(Math, dialogueTimings.filter(function(v){return v <= audio.currentTime})); if(previousDialogueTime !== currentDialogueTime) { previousDialogueTime = currentDialogueTime; var currentDialogue = dialogues[dialogueTimings.indexOf(currentDialogueTime)]; transcriptWrapper.scrollTop = currentDialogue.offsetTop - 50; var previousDialogue = document.getElementsByClassName('speaking')[0]; if(previousDialogue !== undefined) previousDialogue.className = previousDialogue.className.replace('speaking',''); currentDialogue.className +=' speaking'; } } ; var dialogueTimings3 = [1,10,13,20,27,31,53,58,135], dialogues3 = document.querySelectorAll('#transcript3>div'), transcriptWrapper3 = document.querySelector('#transcriptWrapper3'), audio = document.querySelector('#a3'), previousDialogueTime = -1; function playTranscript3() { var currentDialogueTime = Math.max.apply(Math, dialogueTimings3.filter(function(v){return v <= audio.currentTime})); if(previousDialogueTime !== currentDialogueTime) { previousDialogueTime = currentDialogueTime; var currentDialogue = dialogues3[dialogueTimings3.indexOf(currentDialogueTime)]; transcriptWrapper3.scrollTop = currentDialogue.offsetTop - 50; var previousDialogue = document.getElementsByClassName('speaking3')[0]; if(previousDialogue !== undefined) previousDialogue.className = previousDialogue.className.replace('speaking3',''); currentDialogue.className +=' speaking3'; } } ; // dropdown menu /* When the user clicks on the button, toggle between hiding and showing the dropdown content */ function myFunction2() { document.getElementById("myDropdown2").classList.toggle("show2"); } // Close the dropdown if the user clicks outside of it window.onclick2 = function(event) { if (!event.target.matches('.dropbtn2')) { var dropdowns = document.getElementsByClassName("dropdown-content2"); var i; for (i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains('show2')) { openDropdown.classList.remove('show2'); } } } } // for thesis // var socket = new WebSocket(`wss://hypothes.is/ws?access_token=${'6879-n8AksBoSB7kYoQ3eEwzpEr3nFQEmSp3XN-0PcKL_Sik'}`) });