New theme

Started by Qube, July 01, 2017, 23:36:34

Previous topic - Next topic

Qube

I've changed the theme to a more darker one and spent some time tweaking the colours to be hopefully nice and relaxing :P

Hopefully most of you like it and if not, well, tough  ;D - There's probably a few CSS elements that I've missed so if you spot any super small / big text or barely readable text due to colouring etc, let me know.

Syntax highlighting for Blitz is now improved too :

If you are having issues with how it looks, i.e. crap, then browse a few entries in the code archives which magically fixes the bizarre dynamic cache system of GeSHi.

BlitzMax firepaint sample :

Code (blitzmax) Select

Rem

Firepaint demo:

Hold down mouse button to emit *FIRE*!

EndRem

Strict

'For minimal build...
Rem
Framework BRL.D3D7Max2D
Import BRL.Basic
Import BRL.System
Import BRL.PNGLoader
Import BRL.FreeAudioAudio
Import BRL.WAVLoader
End Rem

Import "color.bmx"

Incbin "stars.png"
Incbin "player.png"
Incbin "bullet.png"
Incbin "shoot.wav"

Const WIDTH=640,HEIGHT=480
Const DEPTH=32,HERTZ=60

Const GRAVITY#=.15,SPARKS_PER_FRAME=55

Global sparks:TList=New TList
Global bullets:TList=New TList

Type TEntity

Field link:TLink

Method remove()
link.remove
End Method

Method AddLast( list:TList )
link=list.AddLast( Self )
End Method

Method Update() Abstract

End Type

Type TSpark Extends TEntity

Field x#,y#,xs#,ys#
Field color[3],rot#,rots#

Method Update()

ys:+GRAVITY
x:+xs
y:+ys

If x<0 Or x>=WIDTH Or y>=HEIGHT
remove
Return
EndIf

rot=rot+rots
SetHandle 8,8
SetRotation rot#
SetAlpha 1-y/HEIGHT
SetColor color[0],color[1],color[2]
DrawRect x,y,17,17
SetHandle 0,0

End Method

Function CreateSpark:TSpark( x#,y#,color[] )
Local spark:TSpark=New TSpark
Local an#=Rnd(360),sp#=Rnd(3,5)
spark.x=x
spark.y=y
spark.xs=Cos(an)*sp
spark.ys=Sin(an)*sp
spark.rots=Rnd(-15,15)
spark.color=color
spark.AddLast sparks
Return spark
End Function

End Type

Type TBullet Extends TEntity

Field x#,y#,ys#
Field rot#,img:TImage

Method Update()
ys:-.01
y:+ys
If y<0
remove
Return
EndIf
rot:+3
SetRotation rot
DrawImage img,x,y
End Method

Function CreateBullet:TBullet( x#,y#,img:TImage )
Local bullet:TBullet=New TBullet
bullet.x=x
bullet.y=y
bullet.ys=-1
bullet.img=img
bullet.AddLast bullets
Return bullet
End Function

End Type

Function UpdateEntities( list:TList )
For Local entity:TEntity=EachIn list
entity.Update
Next
End Function

Graphics WIDTH,HEIGHT,DEPTH,HERTZ

AutoMidHandle True

Local fire:TSound=LoadSound( "incbin::shoot.wav" )
Local dude:TImage=LoadImage( "incbin::player.png" ),dude_x=WIDTH/2,dude_y=HEIGHT-30
Local bull:TImage=LoadImage( "incbin::bullet.png" ),bull_x,bull_y
Local stars:TImage=LoadImage( "incbin::stars.png" ),stars_x,stars_y

Local show_debug,color_rot#

While Not KeyHit( KEY_ESCAPE )

Cls

stars_y:+1
SetBlend MASKBLEND
TileImage stars,stars_x,stars_y
TileImage stars,stars_x+7,stars_y*2
TileImage stars,stars_x+7,stars_y*3

If KeyDown( KEY_LEFT )
dude_x:-5
Else If  KeyDown( KEY_RIGHT )
dude_x:+5
EndIf

SetBlend MASKBLEND
DrawImage dude,dude_x,dude_y

If KeyHit( KEY_SPACE )
PlaySound fire
TBullet.CreateBullet dude_x,dude_y-16,bull
EndIf

If MouseDown(1)
color_rot:+1.5
color_rot:Mod 360
Local color:TRGBColor=HSVColor( color_rot,1,1 ).RGBColor()
Local rgb[]=[Int(color.Red()*255),Int(color.Green()*255),Int(color.Blue()*255)]
For Local k=1 To SPARKS_PER_FRAME
TSpark.CreateSpark MouseX(),MouseY(),rgb
Next
EndIf

SetBlend MASKBLEND
UpdateEntities bullets
SetRotation 0

SetBlend LIGHTBLEND
UpdateEntities sparks
SetAlpha 1
SetRotation 0
SetColor 255,255,255

If KeyHit( Asc("D") ) show_debug=1-show_debug

If show_debug
DrawText "MemAlloced="+GCMemAlloced(),0,0
EndIf

Flip

Wend



Blitz3D firepaint 3D sample :

Code (blitzbasic) Select

;EnableDirectInput False

Global info1$="Firepaint3D Demo"
Global info2$="Features dynamically colored sprites"

Include "../start.bb"

AmbientLight 0,0,0

Const grav#=-.02,intensity=5

Type Frag
Field ys#,alpha#,entity
End Type

pivot=CreatePivot()

camera=CreateCamera( pivot )
CameraClsMode camera,False,True

;create blitzlogo 'cursor'
cursor=CreateSphere( 8,camera )
EntityTexture cursor,LoadTexture( "blitzlogo.bmp",3 )
MoveEntity cursor,0,0,25
EntityBlend cursor,3
EntityFX cursor,1

;create sky sphere
sky=CreateSphere()
tex=LoadTexture( "stars.bmp" )
ScaleTexture tex,.125,.25
EntityTexture sky,tex
ScaleEntity sky,500,500,500
EntityFX sky,1
FlipMesh sky

spark=LoadSprite( "bluspark.bmp" )

time=MilliSecs()

MoveMouse 0,0

While Not KeyDown(1)

Repeat
elapsed=MilliSecs()-time
Until elapsed>0

time=time+elapsed
dt#=elapsed*60.0/1000.0

Local x_speed#,y_speed#

x_speed=(MouseXSpeed()-x_speed)/4+x_speed
y_speed=(MouseYSpeed()-y_speed)/4+y_speed
MoveMouse 320,240

TurnEntity pivot,0,-x_speed,0 ;turn player left/right
TurnEntity camera,-y_speed,0,0 ;tilt camera
TurnEntity cursor,0,dt*5,0

If MouseDown(1)
For t=1 To intensity
f.Frag=New Frag
f\ys=0
f\alpha=Rnd(2,3)
f\entity=CopyEntity( spark,cursor )
EntityColor f\entity,Rnd(255),Rnd(255),Rnd(255)
EntityParent f\entity,0
RotateEntity f\entity,Rnd(360),Rnd(360),Rnd(360)
num=num+1
Next
EndIf

For f.Frag=Each Frag
f\alpha=f\alpha-dt*.02
If f\alpha>0
al#=f\alpha
If al>1 Then al=1
EntityAlpha f\entity,al
MoveEntity f\entity,0,0,dt*.4
ys#=f\ys+grav*dt
dy#=f\ys*dt
f\ys=ys
TranslateEntity f\entity,0,dy,0
Else
FreeEntity f\entity
Delete f
num=num-1
EndIf
Next

UpdateWorld
RenderWorld
; GetColor 0,0
; Color 255,0,255
; Rect 0,ScanLine(),640,1
Flip
Wend

End
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Mikey


markcwm

Wow. Nice one Qube. It definitely looks better.

The only problem I think, the text font size is just a bit too small now, us half-blind people will struggle with it. The code font seems to be a size bigger but the syntax highlighted code seems to be smaller as well.

GW

I'm gonna vote for keeping the font size as-is. 

Qube

I've made the font a tiny tiny bit bigger. Looks like a good compromise between us blind bats and super vision people :)
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

markcwm

Yay, that's perfect. I'm not a blind bat, I don't wear glasses but I still like a fairly large type.

Qube

QuoteI'm not a blind bat, I don't wear glasses but I still like a fairly large type.
I am. I need distance and reading glasses. Well, except for super close up whereby my eyesight is still good ( like a few inches from my face ).
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

LineOf7s

"Life's biggest obstacles are your greatest opportunities to excel"

Rooster

Looks good, although I do miss the galaxy background.

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

MikeHart

theme looks good on my Samsung A5 too.

MikeHart

Ok, found something not working right. When I open the gallery on my entry, I can only see 2.5 comments out of 4 and the comments can't be scrolled.

MikeHart

Request: Is is possible to get notifactions on comments in your gallery entries?

RonTek

Nice theme and contrast!

Qube

QuoteOk, found something not working right. When I open the gallery on my entry, I can only see 2.5 comments out of 4 and the comments can't be scrolled.
I see 4 comments. Can you post a pic of what you see?. Perhaps it's easy to miss a comment as there is no avatar to flesh it out.



QuoteRequest: Is is possible to get notifactions on comments in your gallery entries?
I think that's a feature of the pro version of the gallery plugin which is $49. If it becomes an important feature request then I'll grab hold of the pro version.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.