Cloud Meditation
Posted: Wed Jul 26, 2017 7:03 pm
Found a cool website called mrdoob.com & modded some webcode from Dav to show it. Cloud anims are good for relaxing when you feel stressed.
Tap in upper r corner to stop. I didn't want to show a button.
Tap in upper r corner to stop. I didn't want to show a button.
Code: Select all
'Cloud Meditation by gerry July 2017 adapting some code by Dav, July 2015
'
'FOR IPAD/IPHONE/IPOD TOUCH
' this is the site with cloud fx
home$="http://mrdoob.com/lab/javascript/webgl/clouds/"
'detect device
IF LOWSTR$(DEVICE_TYPE$())="ipad" THEN
dev=1
ELSE
dev=0
END IF
GRAPHICS
OPTION SCREENLOCK OFF
OPTION SPRITE POS CENTRAL
OPTION BASE 1
SET BUTTONS CUSTOM
PAGE "main" SET
'init screen
GRAPHICS CLEAR
SET TOOLBAR OFF
SET BROWSERS SCALED 'allow zooming in/out
'get current screen width
curwidth= SCREEN_WIDTH()
curheight=SCREEN_HEIGHT()
'load the homepage with cloud animation
URL$=home$
GOSUB loadpage
DRAW COLOR 0,0,0
FILL COLOR .9,.9,.9
GOSUB makebuttons
'main loop...
DO
IF BUTTON_PRESSED("quit") THEN END
'if screen rotated...
IF SCREEN_WIDTH() <> curwidth THEN
curwidth = SCREEN_WIDTH()
URL$=BROWSER_TEXT$("n", "window.location.href")
GOSUB loadpage
END IF
UNTIL 0
PAGE bm$ HIDE
PAGE "main" HIDE
TEXT
END
'==========================================
'. G O S U B S
'==========================================
'-------
loadpage:
'-------
IF dev=1 THEN
BROWSER "n" AT 0,0 SIZE SCREEN_WIDTH(),SCREEN_HEIGHT()
BROWSER "n" TEXT g$
PAUSE 1
BROWSER "n" URL URL$
ELSE
BROWSER "n" AT 0,0 SIZE SCREEN_WIDTH(),SCREEN_HEIGHT()
BROWSER "n" TEXT g$
PAUSE 1
BROWSER "n" URL URL$
END IF
GOSUB makebuttons
RETURN
'----------
makebuttons:
'----------
FILL ALPHA 0
DRAW ALPHA 0
DRAW COLOR .8,.8,.8
IF dev = 1 THEN
SET BUTTONS FONT SIZE 20
BUTTON "quit" TEXT "Quit" AT curwidth-50,20 SIZE 40,32
ELSE
SET BUTTONS FONT SIZE 14
BUTTON "quit" TEXT "Quit" AT curwidth-30,10
END IF
FILL ALPHA 1
DRAW ALPHA 1
RETURN