Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
blob: d4d8453d8fa698a81da0a110e6bfce19cba43b46 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?xml version="1.0" standalone="no"?>
<svg viewBox="-150 -150 600 800" xmlns="http://www.w3.org/2000/svg">
  <link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="../css/map.css" type="text/css" />
  <style>
    g[data-edge="north"] { --i: -2; }
    g[data-edge="south"] { --i: 52; }

    #background {
      stroke: #304b75;
      fill: #bacae3;
    }

    pattern use {
      stroke: black;
      stroke-width: 0.3px;
    }

    .cw-60-deg {
      transform: rotate(60deg);
    }

    .ccw-60-deg {
      transform: rotate(-60deg);
    }
  </style>
  <defs>
    <polygon id="hex" points="0,10 8.66,5 8.66,-5 0,-10 -8.66,-5 -8.66,5"/>
    <circle id="counter-base" cx="0" cy="0" r="5"/>

    <line id="ast-line" x1="-1.2" y1="0" x2="1.2" y2="0"/>

    <pattern id="asterisk" viewBox="-8.66 -15 17.32 30" width="17.32" height="30" patternUnits="userSpaceOnUse">
      <use y="-15" href="#ast-line"/>
      <use y="-15" style="transform-origin: 0 -15px;" class="cw-60-deg" href="#ast-line"/>
      <use y="-15" style="transform-origin: 0 -15px;" class="ccw-60-deg" href="#ast-line"/>
      <use y="15" href="#ast-line"/>
      <use y="15" style="transform-origin: 0 15px;" class="cw-60-deg" href="#ast-line"/>
      <use y="15" style="transform-origin: 0 15px;" class="ccw-60-deg" href="#ast-line"/>

      <use x="8.66" href="#ast-line"/>
      <use x="8.66" style="transform-origin: 8.66px 0;" class="cw-60-deg" href="#ast-line"/>
      <use x="8.66" style="transform-origin: 8.66px 0;" class="ccw-60-deg" href="#ast-line"/>
      <use x="-8.66" href="#ast-line"/>
      <use x="-8.66" style="transform-origin: -8.66px 0;" class="cw-60-deg" href="#ast-line"/>
      <use x="-8.66" style="transform-origin: -8.66px 0;" class="ccw-60-deg" href="#ast-line"/>
    </pattern>

    <g id="t-1" class="troop-counter-template"><use href="#counter-base"/><text>1</text></g>
    <g id="t-2" class="troop-counter-template"><use href="#counter-base"/><text>2</text></g>
    <g id="t-3" class="troop-counter-template"><use href="#counter-base"/><text>3</text></g>
    <g id="t-4" class="troop-counter-template"><use href="#counter-base"/><text>4</text></g>
    <g id="t-5" class="troop-counter-template"><use href="#counter-base"/><text>5</text></g>
    <g id="t-6" class="troop-counter-template"><use href="#counter-base"/><text>6</text></g>
    <g id="t-7" class="troop-counter-template"><use href="#counter-base"/><text>7</text></g>

    <g id="semi-auto">
      <line x1="-2" y1="1" x2="2" y2="1"/>
      <line x1="-2" y1="2" x2="2" y2="2"/>
    </g>

    <g id="auto">
      <line x1="-2" y1="0" x2="2" y2="0"/>
      <line x1="-2" y1="1" x2="2" y2="1"/>
      <line x1="-2" y1="2" x2="2" y2="2"/>
    </g>

    <g id="rifle" class="weapon-symbol">
      <use href="#semi-auto"/>
      <line x1="0" y1="-5" x2="0" y2="5"/>
      <polyline points="-2,-3.5 0,-5 2,-3.5"/>
    </g>

    <g id="smg" class="weapon-symbol">
      <use href="#auto"/>
      <line x1="0" y1="-5" x2="0" y2="4.5"/>
      <line x1="-2" y1="4.5" x2="2" y2="4.5"/>
    </g>

    <g id="blazer" class="weapon-symbol">
      <use href="#auto"/>
      <polyline points="0,-5 0,-3 -3,-2.5 3,-1.5 0,-1 0,2.5 -3,3, 3,4 0,4.5 0,5"/>
      <polyline points="-2,-3.5 0,-5 2,-3.5"/>
    </g>

    <image id="counter-prone" href="counter_prone.jpg" width="10"/>
    <image id="counter-grenade" href="counter_grenade.jpg" width="10"/>
  </defs>

  <rect id="background"/>

  <g class="gameboard">
    <rect id="dots" fill="url(#asterisk)"/>

    <g id="firing-arcs">
      <g id="shapes"/>
      <g id="lines"/>
    </g>
    <g class="grid">
      <g data-y="0">
        <g data-x="0"><use href="#hex"/></g>
        <g data-x="1"><use href="#hex"/></g>
        <g data-x="2"><use href="#hex"/></g>
      </g>
      <g data-y="1">
        <g data-x="0"><use href="#hex"/></g>
        <g data-x="1"><use href="#hex"/>
          <g class="counter" data-allegiance="attacker" data-number="1"><use href="#counter-base"/><use class="troop-number" href="#t-2"/><use class="squad-number" href="#t-1"/><use class="primary-weapon" href="#rifle"/></g>
        </g>
        <g data-x="2"><use href="#hex"/></g>
      </g>
      <g data-y="2">
        <g data-x="0"><use href="#hex"/></g>
        <g data-x="1"><use href="#hex"/></g>
        <g data-x="2"><use href="#hex"/></g>
      </g>
    </g>
  </g>

  <script href="../../map.js"></script>
</svg>