forked from arvoelke/Dixit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay.py
70 lines (53 loc) · 1.94 KB
/
display.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""Holds template variables for HTML/JS/CSS."""
from utils import url_join
class Labels(object):
"""Text labels."""
TITLE = 'Dixit'
NEW_GAME = 'New Game'
DEFAULT_TEXT = 'Say something!'
class WebPaths(object):
"""Client-side paths to resource directories."""
STATIC = 'static'
IMAGES = url_join(STATIC, 'images')
JS = url_join(STATIC, 'js')
CSS = url_join(STATIC, 'css')
CARDS = url_join(STATIC, 'cards')
SMILIES = url_join(IMAGES, 'smilies')
JQUERY_UI = url_join(JS, 'jquery-ui-1.10.4')
class Images(object):
"""Client-side paths to images."""
BANNER = url_join(WebPaths.IMAGES, 'banner.png')
BUNNY_READY = url_join(WebPaths.IMAGES, 'bunnyready.png')
BUNNY_RUN = url_join(WebPaths.IMAGES, 'bunnyrun.png')
THINKING = url_join(WebPaths.IMAGES, 'thinking.gif')
CARD_BACK = url_join(WebPaths.IMAGES, 'cardback.png')
VOTE_TOKEN = url_join(WebPaths.IMAGES, 'votetoken.png')
YOUR_TURN = url_join(WebPaths.IMAGES, 'arrow.ico')
ICON_ACTIVE = url_join(WebPaths.IMAGES, 'bunnyicongreen.png')
ICON_AWAY = url_join(WebPaths.IMAGES, 'bunnyiconyellow.png')
ICON_ASLEEP = url_join(WebPaths.IMAGES, 'bunnyicongrey.png')
class Sizes(object):
"""Display sizes for images."""
PIECE = 45
BUNNY_PICKER = 70
CARD_WIDTH = 250
CARD_HEIGHT = 380
YOUR_TURN = 24
TOKEN = 80
class BunnyPalette(object):
"""Bunny colours to choose from."""
RED = 'c52828'
ORANGE = 'e59100'
YELLOW = 'e2e05d'
GREEN = '12751b'
BLUE = '214ddc'
PURPLE = 'a41bf3'
PINK = 'd2638d'
WHITE = 'd3ceca'
BLACK = '3a363b'
@classmethod
def is_colour(cls, cid):
"""Determines if the given colour id is valid."""
return cid in (cls.RED, cls.ORANGE, cls.YELLOW,
cls.GREEN, cls.BLUE, cls.PURPLE,
cls.PINK, cls.WHITE, cls.BLACK)