fullscreen toggle; hide scrollbar; fix some fonts to use local fonts

This commit is contained in:
Iam Naughton Phier 2015-02-18 16:22:15 +02:00
parent 2be40c4966
commit b10ed90e85
3 changed files with 29 additions and 33 deletions

View file

@ -41,7 +41,6 @@ class @Sahli
@loadansi picdata, inserthere
else
@loadplain picdata, inserthere
return
@loadplain = (picdata, inserthere) ->
pdiv = $('<div>')
@ -70,11 +69,9 @@ class @Sahli
inserthere.after pdiv
else
@loaderror inserthere, fname, req.statusText, req.status
return
req.open 'GET', fname, true
req.send null
return
@loadansi = (picdata, inserthere) ->
fname = @location + '/' + picdata.file
@ -85,13 +82,11 @@ class @Sahli
@origwidth = canv.width
@origheight = canv.height
@SAUCE = SAUCE
return
),
'font': '80x25'
'bits': '8'
'columns': 160
'thumbnail': 0
return
@loadhugeansi = (picdata, inserthere) ->
fname = @location + '/' + picdata.file
@ -105,23 +100,20 @@ class @Sahli
pdiv.append canv
calcheight = calcheight + canv.height
canvwidth = canv.width
return
inserthere.after pdiv
@SAUCE = SAUCE
@origwidth = canvwidth
@origheight = calcheight
pdiv.width canvwidth
return
), 30, 'bits': '8'
return
@loadavatar = (picdata, inserthere) ->
alert 'avatar', picdata, inserthere
return
@requestsahlifile = (url) ->
@loadkeys()
@DEBUG = false
@fullscreen = false
@scroll_speed= 5
@scroll_direction= 1
@asciiasgfx= false
@ -150,33 +142,31 @@ class @Sahli
@currentpic += 1
if @currentpic > filedata.length - 1
@currentpic = 0
return
@gofullscreen = ->
@togglefullscreen = ->
docElm = document.documentElement
window.setTimeout @resizedrawbox, 100
if docElm.requestFullscreen
docElm.requestFullscreen Element.ALLOW_KEYBOARD_INPUT
else if docElm.mozRequestFullScreen
docElm.mozRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
else if docElm.webkitRequestFullScreen
docElm.webkitRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
return
if @fullscreen
if document.exitFullscreen
document.exitFullscreen()
else if document.mozCancelFullScreen
document.mozCancelFullScreen()
else if document.webkitCancelFullScreen
document.webkitCancelFullScreen()
@fullscreen = false
else
if docElm.requestFullscreen
docElm.requestFullscreen Element.ALLOW_KEYBOARD_INPUT
else if docElm.mozRequestFullScreen
docElm.mozRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
else if docElm.webkitRequestFullScreen
docElm.webkitRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
@fullscreen = true
@cancelfullscreen = ->
window.setTimeout @resizedrawbox, 100, @nonfsheight
if document.exitFullscreen
document.exitFullscreen()
else if document.mozCancelFullScreen
document.mozCancelFullScreen()
else if document.webkitCancelFullScreen
document.webkitCancelFullScreen()
return
@toggledebug = ->
$('h1#top').fadeToggle()
@DEBUG = !@DEBUG
return
@keycode = (char) ->
char.toUpperCase().charCodeAt 0
@ -196,6 +186,8 @@ class @Sahli
switch ev.which
when @keycode(' ')
@nextpic()
when @keycode('f')
@togglefullscreen()
when @keycode('s')
alert("not spaaaace")
else

View file

@ -2,18 +2,19 @@ body {
background-color: black;
margin: 0px;
padding: 0px;
overflow: hidden;
}
h1#top {
border: 1px solid green;
color: green;
font-family: TopazPlus a600a1200a4000,monospace;
font-family: topaz500,monospace;
position: absolute;
top: .25ex;
left: .25ex;
}
div#drawbox {
div#sahliviewer {
border: 1px inset grey;
color: green;
padding: 0px;
@ -49,7 +50,7 @@ h6 {
-webkit-border-radius: 8;
-moz-border-radius: 8;
border-radius: 8;
font-family: "TopazPlus a600a1200a4000",mOsOul, Consolas, monospace;
font-family: topaz1200,mOsOul, Consolas, monospace;
opacity: .85;
}
@ -93,7 +94,7 @@ ul.keylist li.nodot {
}
div.infobox {
font-family: "mOsOul,TopazPlus a600a1200a4000",MicroKnightPlus, Consolas, monospace;
font-family: mosoul,topaz1200,microknight, Consolas, monospace;
position: absolute;
top: 1ex;
left: 1ex;

View file

@ -1,4 +1,7 @@
(A) fix scrolling!
(B) @EDITOR add more Amiga fonts.
(C) check below items for neccesity
@EDITOR redo filenames to load from list of files in directory (specfied in 'location')
(A) remove the SAUCE lines at bottom, return ANSI object for render @SAUCE