-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
146 lines (126 loc) · 3.05 KB
/
app.js
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import { LitElement, html, css } from 'https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js';
import './components/index.js';
import './pages/index.js';
class JetlagTheGame extends LitElement {
static styles = css`
.container {
background: white;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin: 0 auto;
max-width: 800px;
padding: 20px;
transition:
transform 0.3s,
box-shadow 0.3s;
}
.container:hover {
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
h1 {
align-items: center;
border-bottom: 3px solid var(--jetlag-primary);
color: var(--jetlag-dark);
display: flex;
font-size: 24px;
font-weight: 700;
justify-content: center;
letter-spacing: 1px;
min-height: 50px;
padding-bottom: 10px;
position: relative;
text-transform: uppercase;
}
h1 span {
padding-left: 50px;
white-space: nowrap;
text-align: center;
max-width: 90%; /* Allow text to take most of the width */
}
button {
padding: 10px 20px;
background-color: var(--jetlag-primary);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition:
background-color 0.3s ease,
transform 0.2s;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
button:hover {
background-color: var(--jetlag-danger);
transform: translateY(-2px);
}
.header-icon {
background-color: white;
border-radius: 50%;
border: 3px solid var(--jetlag-accent);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
height: 40px;
left: 0;
margin-right: 15px;
object-fit: cover;
padding: 2px;
position: absolute;
width: 40px;
}
@media (max-width: 768px) {
.container {
padding: 15px;
}
.buttons {
flex-direction: column;
gap: 10px;
}
button {
width: 100%;
}
h1 {
flex-direction: column;
font-size: 18px;
padding-top: 45px;
text-align: center;
}
h1 span {
font-size: 0.8em;
line-height: 1.3;
padding-left: 0;
padding-top: 12px;
white-space: normal;
}
.header-icon {
top: 0;
left: 50%;
transform: translateX(-50%);
}
}
@media (max-width: 480px) {
h1 {
font-size: 16px;
}
}
`;
clearStorage() {
localStorage.clear();
location.reload();
}
render() {
return html`
<div class="container">
<h1>
<img src="./icons/icon-128x128.png" alt="Jet Lag Icon" class="header-icon" />
<span>Jet Lag: The Game - Hide + Seek</br>Investigation Book</span>
</h1>
<game-content></game-content>
<div class="buttons">
<button @click=${this.clearStorage}>Clear Game</button>
</div>
</div>
`;
}
}
customElements.define('jetlag-the-game', JetlagTheGame);