Skip to content

Commit

Permalink
Add resourcesPath; disable wheel event, it messes with things when th…
Browse files Browse the repository at this point in the history
…e user wants to scroll a textbox in Multimedia
  • Loading branch information
joshpowlison committed Aug 19, 2018
1 parent 0b507e7 commit 2544759
Show file tree
Hide file tree
Showing 52 changed files with 110 additions and 37 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
engine.wait .1
content.style time:2s;filter:brightness(1);

engine.wait 2
content.style filter:brightness(1);
What is your name? <input data-var="name"><input type="submit" value="Confirm">

susan.style time:1s;left:-25%;
[susan]<shout>What are you doing out here?! Everyone's looking for you, it's time to sing you Happy Birthday!</shout>
Expand All @@ -31,6 +30,28 @@
[ben]<shake>Um, when everyone sings Happy Birthday, I get all anxious and stuff.</shake>

susan grin
[susan][name], are you getting this?
[susan]...
susan angry
[susan]<shout><shake>Ehhhh?! What are you doing hanging out with [name]?!</shake></shout>

ben habit
[ben][name]'s one of the few people who understands->

[susan]Hey [name]! Do you think Ben should come back to the party? <input type="button" data-go="//Yes" value="Yes"> <input type="button" data-go="//No" value="No">

//Yes
[susan]See, I told you, Ben. Quit being such a wuss, come on back to the party with me!

//No
[susan]See, I told you, Ben-
[susan]...
[susan]<shout><shake>WHAAAAAAT?!?! I thought you were on my side, [name]!</shake></shout>

[ben]I don't want to come, Susan.

[susan]Eh... eh!!!!

[susan]<sing>Then we'll sing something else!</sing>
ben shy_blush
[ben]It's not that. They're all surrounding me, <speed rate=".9">I get so claustrophobic, </speed><speed rate=".7">it's like I can hear them all breathing at once </speed><speed rate=".5">and I can feel the air around me get thick </speed><speed rate=".3">and it becomes hard to breathe </speed><speed rate=".1">and even think->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added examples/multimedia/(Sintel) 52.mp4
Binary file not shown.
1 change: 1 addition & 0 deletions examples/multimedia/(The 900).html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Kiaral stepped forward, and yelled back, "Hail fellow! We are running from an ogre."</p><p>The crossbowman moaned, "Deemus! What kind of adventures are you pulling others into now, and especially a foreigner!"</p><p>Deemus stated defensively, "As soon as the ogre looked our way, I knew we had to bolt. I had to protect this young traveler-"</p><p>The crossbowman facepalmed and muttered, "The ogre won't chase you unless you provoked it... gah, Deemus, what kind of nonsense are you putting into this young lady's head?"</p><p>"Non-nonsense, fair sir."</p><p>"What are you doing out here anyway?"</p><p>Kiaral bowed, "Deemus is helping me find the ecocrystal, which I presume is straight ahead. I'm a tourist who wants to see it and all the other ecocrystals in the world." She removed a small journal from a pocket sewn into her dress, "I've been keeping notes on all of my travels, and sketches, and can't wait to learn what all the world has to offer!" Her excitement was infectious, except to Deemus, who didn't care.</p><p>From atop the tower, "Don't you know we have tour guides that go out once a week? You'd have been better going out with anybody besides Deemus."</p><p>Deemus scowled. "I'd disagree, if you weren't already so obviously wrong."</p><p>Kiaral spoke, "I only have a week to visit each location. I might return here later, but I couldn't schedule the tour properly, unfortunately." She looked down at the ground, seemingly embarrassed.</p><p>"You and Deemus go see the ecocrystal. Just the obvious rules: don't take any chunks from it, don't take any shards of it you find, and don't litter or disrespect the premises. If I find you breaking any rules, I'll give a shout if you didn't know that one and escort you out of the Ogre Woods if you did."</p><p>Kiaral clapped her hands together, "Thank you!" She ran past the tower through the brush ahead.</p><p>"And Deemus!"</p><p>Deemus looked up at the crossbowman, who was smiling. "Don't do anything stupid. She's from the Waterfall; I can tell by her accent and hair. They're good people but remember everything."</p><p>"What are you trying to tell me?"</p><p>"Don't do anything you want her to remember. Like you already have." He chuckled, "Lying about ogres to a tourist, really? You don't think she's done her own research on them?"</p><p>Deemus sighed, but couldn't snap back for fear of Kiaral hearing.</p>
Binary file added examples/multimedia/2017-11-20 (Part 1) 97.mp3
Binary file not shown.
40 changes: 40 additions & 0 deletions examples/multimedia/2017-11-20 (kinetic-novel) 35.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
> AU little-idea loop play
> BG forest forest.jpg
> DS susan = {,0,magenta,bold}Susan{}#
> DS ben = {,0,aqua,bold}Ben{}#

> CH ben habit 25%
> CH susan angry -100%

> ST content transition:filter 0s;filter:brightness(0);

> WT .1
> ST content transition:filter 1s;filter:brightness(1);

> WT 1

> CH susan angry -25%
Test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test


[susan]{,,,shout}What are you doing out here?! Everyone's looking for you, it's time to sing you Happy Birthday!

> CH ben shock_blush
> CH susan frown
[ben]Um... well...
[ben]{.5,,,}...I hate it when everyone sings me Happy Birthday.
> CH susan smirk
[susan]{,1,,}...{}what was that?
> CH ben scared
[ben]{,,,shake}Um, when everyone sings Happy Birthday, I get all anxious and stuff.

> CH susan grin
[susan]{,,,sing}Then we'll sing something else!
> CH ben shy_blush
> TB main
> TB main [ben]It's not that. They're all surrounding me, {,.025,,}I get so claustrophobic, {,.02,,}it's like I can hear them all breathing at once {,.015,,}and I can feel the air around me get thick {,.01,,}and it becomes hard to breathe {,.005,,}and even think-

[susan]{,0,,}What do you want us to sing?

> CH ben habit
[ben]I don't want anyone to sing. I just want {,,#ffa533,bold}cake{}.
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1><img class="svg-inline" src="design-files/logo.svg"> Showpony</h1>
<script>
showponyInputs.comic={
window:document.getElementById("comic")
,get:"examples/entreprenewb/" //The path to the story files. Remember the slash!
,get:"examples/entreprenewb/[lang]/" //The path to the story files. Remember the slash!
,info:"[Current File] | [File Left]"
,credits:"<a target='_blank' href='https://twitter.com/joshpowlison'>Twitter.logo</a><a target='_blank' href='https://joshpowlison.tumblr.com/'>Tumblr.logo</a><a href='https://www.webtoons.com/en/challenge/entreprenewb/list?title_no=58042' target='_blank'>LineWebtoon.logo</a><br>Entreprenewb by Josh Powlison, Public Domain"
,query:"entreprenewb"
Expand All @@ -58,7 +58,7 @@ <h1><img class="svg-inline" src="design-files/logo.svg"> Showpony</h1>
,saveId:null
,remoteSave:false
,subtitles:{
English:'examples/entreprenewb/subtitles/'
English:'examples/entreprenewb/subtitles/en/'
}
,defaultDuration:1
};
Expand All @@ -79,7 +79,8 @@ <h1><img class="svg-inline" src="design-files/logo.svg"> Showpony</h1>
,subtitles:{
English:'examples/sintel/'
}
,saveId:"showpony-site-sintel"
,saveId:null
,remoteSave:false
,cover:{
image:'examples/sintel/cover.jpg'
,content:'Sintel'
Expand Down Expand Up @@ -110,15 +111,17 @@ <h1><img class="svg-inline" src="design-files/logo.svg"> Showpony</h1>
<script>
showponyInputs.vn={
window:document.getElementById("vn")
,get:"examples/late-to-the-party/"
,get:"examples/late-to-the-party/[lang]/"
,info:"[Minutes]:[Seconds PAD2] | [Minutes Left]:[Seconds Left PAD2]"
,resourcesPath:"examples/late-to-the-party/resources/"
,query:"late-to-the-party"
,start:0
,saveId:"showpony-site-lttp"
,saveId:null
,remoteSave:false
,credits:"Josh Powlison"
,showBuffer:false
,cover:{
image:'resources/backgrounds/forest.jpg'
image:'examples/late-to-the-party/resources/backgrounds/forest.jpg'
,content:'Late to the Party'
}
};
Expand Down
66 changes: 37 additions & 29 deletions showpony/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ d('currentSubtitles', null );
d('cover' , null );
d('infiniteScroll' , false );
d('start' , 'last' );
d('resourcesPath' , 'resources/' );

var HeyBardConnection;

Expand Down Expand Up @@ -1612,7 +1613,7 @@ function runMM(inputNum=S.currentLine+1){
if(type==='audio'){
S.objects[object]=document.createElement('audio');

S.objects[object].src='resources/audio/'+object;
S.objects[object].src=S.resourcesPath+'audio/'+object;

//If an extension isn't specified, assume mp3
if(!/\./.test(object)) S.objects[object].src+='.mp3';
Expand Down Expand Up @@ -1731,7 +1732,7 @@ function runMM(inputNum=S.currentLine+1){
//If there's no period, add '.png' to the end- assume the extension
if(!/\./.test(imageNames[ii])) imageNames[ii]+='.png';

var image='url("resources/characters/'+name+'/'+imageNames[ii]+'")';
var image='url("'+S.resourcesPath+'characters/'+name+'/'+imageNames[ii]+'")';

//If the image already exists
var found=false;
Expand Down Expand Up @@ -1770,7 +1771,7 @@ function runMM(inputNum=S.currentLine+1){
runMM();
break;
case 'background':
S.objects[object].style.backgroundImage='url("resources/backgrounds/'+name+'.jpg")';
S.objects[object].style.backgroundImage='url("'+S.resourcesPath+'backgrounds/'+name+'.jpg")';
runMM();
break;
case 'audio':
Expand Down Expand Up @@ -2275,23 +2276,26 @@ var shortcutKeys={

//If shortcut keys are enabled
if(S.shortcuts){
function shortcutPermission(){
//If shortcuts aren't always enabled, perform checks
if(S.shortcuts!=='always'){
//Exit if it isn't fullscreen
if(S.window!==document.webkitFullscreenElement && S.window!==document.mozFullScreenElement && S.window!==document.fullscreenElement){
//If needs to be focused
if(S.shortcuts!=='fullscreen' && S.window!==document.activeElement) return false;
}
}

return true;
}

//Keyboard presses
window.addEventListener(
'keydown'
,function(event){
//Don't use shortcut keys if we're writing into an input right now
if(event.key===' ' || event.key==='Enter' || event.key==='f'){
if(event.target.tagName==='INPUT') return;
}

//If shortcuts aren't always enabled, perform checks
if(S.shortcuts!=='always'){
//Exit if it isn't fullscreen
if(S.window!==document.webkitFullscreenElement && S.window!==document.mozFullScreenElement && S.window!==document.fullscreenElement){
//If needs to be focused
if(S.shortcuts!=='fullscreen' && S.window!==document.activeElement) return;
}
}
//Don't use shortcut keys if we're writing into an input
if(event.target.tagName==='INPUT') return;
if(!shortcutPermission()) return;

if(shortcutKeys[event.key]
&& !event.ctrlKey
Expand All @@ -2304,21 +2308,25 @@ if(S.shortcuts){
}
}
);
}

//Scrolling
window.addEventListener('wheel',function(event){
if(event.ctrlKey) return;

if(currentType==='multimedia'){
if(event.deltaY<0){
//Go back a keyframe's length, so we get to the previous keyframe
var keyframeLength=S.files[S.currentFile].duration/keyframes.length;

S.to({time:'-'+keyframeLength});
//Scrolling
/*content.addEventListener('wheel',function(event){
if(event.ctrlKey) return;
if(!shortcutPermission()) return;
//Check if the cursor if over the window
console.log(event.target);
if(currentType==='multimedia'){
if(event.deltaY<0){
//Go back a keyframe's length, so we get to the previous keyframe
var keyframeLength=S.files[S.currentFile].duration/keyframes.length;
S.to({time:'-'+keyframeLength});
}
}
}
});
});*/
}

//We need to set this as a variable to remove it later on
//This needs to be click- otherwise, you could click outside of Showpony, release inside, and the menu would toggle. This results in messy scenarios when you're using the UI.
Expand Down

0 comments on commit 2544759

Please sign in to comment.