Skip to content

Instantly share code, notes, and snippets.

View mandrasch's full-sized avatar
🔍

Matthias Andrasch mandrasch

🔍
View GitHub Profile
@mandrasch
mandrasch / story_javascript.js
Last active April 24, 2017 19:07
Twine2 Sugarcube2 Macros for HTML5 video and audio-files in local browser
/* I used this in my interactive video textadventure: http://matthias-andrasch.de/2015/ela-twine-textadventure-mit-html5-video
Right now it only works in local browser because of preloading issues in realtime with big video files (maybe you have an idea for improving the preload)
Videos will be in the background in fullsize.
Initialize video/audio in "StoryInit" passage (important!):
<<html5loadvideo "riot" "media/video/riot.mp4">>
Example usage in twine passage:
<<html5playvideo "riot">>
@mandrasch
mandrasch / passage.html
Created September 29, 2015 15:21
Twine2 Sugarcube2 Skip video in passage
<!-- video must be initialized in storyinit before, see: https://gist.github.com/programmieraffe/b0ae841d1961e038d87a -->
<a id="skip-video">Skip intro video</a><span id="next-step" style="display:none;">[[2025|Prelude]]</span><<html5playvideo "wasteland" 53>>
<<script>>
$( document ).ready(function() {
$("#story").hide().delay(3000).fadeIn(1500);
/* thank to http://stackoverflow.com/a/2880950/809939 */
document.getElementById('wasteland').addEventListener('ended',myHandler,false);
function myHandler(e) {
@mandrasch
mandrasch / Video end event
Created October 16, 2015 15:02
html5_video_event_ended.js
/* beispiel für video <video id="testvideo">*/
/* event listener */
document.getElementById('testvideo').addEventListener('ended',zeigeDialog,false);
/* funktion, die ausgeführt wird, wenn video endet */
function zeigeDialog(e) {
/* hier dialog zeigen */
@mandrasch
mandrasch / select.html
Created April 15, 2016 10:51
Creative Commons 3.0 Ports
<!-- https://creativecommons.org/choose/?lang=en# (select " Looking for earlier license versions, including ports? ") -->
<option value="" selected="selected">
International
</option>
<option value="ar">Argentina</option>
<option value="au">Australia</option>
<option value="at">Austria</option>
<option value="be">Belgium</option>
<option value="br">Brazil</option>
<option value="bg">Bulgaria</option>
@mandrasch
mandrasch / course with telephone number.json
Last active September 14, 2016 08:15
course.json example
{
"title": "Mein flexibler Online-Kurs",
"id":1,
"authors":[{
"name":"Doerte",
"surname":"Digital",
"contact":
{
"telephone-office":"+4927192723829289",
"student-hotline-mobile":"+4929380121293812983012",
@mandrasch
mandrasch / fritz.m3u
Last active April 24, 2017 15:09
Detektor FM & RaspberryPI
#EXTM3U
#EXTINF:-1,Fritz vom rbb live hören - www.fritz.de
http://rbb-mp3-fritz-m.akacast.akamaistream.net/7/799/292093/v1/gnl.akacast.akamaistream.net/rbb_mp3_fritz_m
/* Feld "Interaction title" überschreiben (Getestet mit Google Chrome Webdeveloper Console */
var iFrameDOM = window.jQuery("iframe.h5p-editor-iframe").contents();
iFrameDOM.find("div.field-name-interaction > input").val('ÜBERSETZUNG');
/* Bookmarklet kann hier generiert werden: http://mrcoles.com/bookmarklet/ */
@mandrasch
mandrasch / index.html
Created August 12, 2017 12:09
h5p-standalone, edited demo/index.html
<html>
<head>
<link type="text/css" rel="stylesheet" media="all" href="dist/styles/h5p.css" />
<meta charset="utf-8" />
<title>H5P Webview test</title>
<script type="text/javascript" src="dist/js/h5p-standalone-main.js"></script>
<script type="text/javascript">
(function($) {
$(function() {
@mandrasch
mandrasch / quickhack.js
Created April 14, 2019 17:28
H5P dialog cards hide image until turnover
/*
1. insert via https://de.wordpress.org/plugins/custom-css-js/ plugin
2. change post-id number (can be found in source code of wordpress)
3. maybe change iframe id
4. enjoy! ;-)
See: https://h5p.org/node/70099
*/
jQuery(document).ready(function($) {
/*console.log('custom js loaded - 17');*/
/* inject css to first iframe, change postid for page */
@mandrasch
mandrasch / gist:be3c7ce89924953e38ae32c6f916885a
Last active October 23, 2019 10:22
OER World Map Search Queries for Country + Consultant
https://oerworldmap.org/resource/?filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH&filter.about.additionalType.@id=https%3A%2F%2Foerworldmap.org%2Fassets%2Fjson%2Fpersons.json%23consultant&map=11.62955,49.45440,5
First link is broken, hashtags need to be manually decoded :/
https://oerworldmap.org/resource/?filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH&filter.about.additionalType.@id=https://oerworldmap.org/assets/json/persons.json%23consultant
https://oerworldmap.org/resource/?filter.about.additionalType.@id=https%3A%2F%2Foerworldmap.org%2Fassets%2Fjson%2Fpersons.json%23consultant&filter.about.location.address.addressCountry=DE&filter.about.location.address.addressCountry=AT&filter.about.location.address.addressCountry=CH
As soon as I scroll in the map, link changes to - after it is shared, it is broken (# on wron