A lightweight JavaScript game engine
git clone git://soophie.de/game-engine
blob: 576f20f6a1e8c5ee8b042ad3cd0ea73264929145 (9506 bytes)[doc][blame][raw]
1
@space-1x: 20px;2
@space-2x: 40px;3
@space-4x: 80px;4
@space-8x: 160px;6
.space-1 {7
width: 100%;8
height: @space-1x;9
}11
.space-2 {12
width: 100%;13
height: @space-2x;14
}16
.space-4 {17
width: 100%;18
height: @space-4x;19
}21
.space-8 {22
width: 100%;23
height: @space-8x;24
}26
* {27
color: @color-gray-900;28
font-family: 'Inter';29
}31
body {33
@media(prefers-color-scheme: dark) {34
background: @color-black;35
}36
}38
h1 {39
font-size: 36px;40
margin-top: @space-4x;42
sup {43
font-size: 18px;44
font-weight: 600;45
padding-left: 2px;46
vertical-align: top;47
}49
@media(prefers-color-scheme: dark) {50
color: @color-white;51
}52
}54
h2 {55
font-size: 28px;56
font-weight: 700;57
margin-top: @space-8x;58
margin-bottom: @space-2x;60
@media(prefers-color-scheme: dark) {61
color: @color-white;62
}63
}65
h3 {66
font-size: 24px;67
font-weight: 600;68
margin-top: @space-2x;70
@media(prefers-color-scheme: dark) {71
color: @color-white;72
}73
}75
h4 {76
font-size: 18px;77
font-weight: 600;78
margin-top: @space-2x;80
@media(prefers-color-scheme: dark) {81
color: @color-white;82
}83
}85
p {86
color: @color-gray-700;87
font-size: 16px;88
margin-top: @space-2x;89
line-height: 26px;91
@media(prefers-color-scheme: dark) {92
color: @color-gray-400;93
}95
a {96
text-decoration: underline;97
white-space: nowrap;98
}100
mark {101
background: @color-gray-200;102
white-space: nowrap;103
border-radius: 2px;104
padding: 2px 4px;105
color: @color-gray-800;107
@media(prefers-color-scheme: dark) {108
color: @color-gray-400;109
background: darken(@color-gray-900, 8%);110
}111
}113
b {114
font-weight: 500;116
@media(prefers-color-scheme: dark) {117
color: @color-gray-100;118
}120
&.note {121
margin-bottom: calc(@space-1x / 2);122
display: inline-block;124
@media(prefers-color-scheme: dark) {125
color: @color-white;126
}127
}128
}130
span {131
color: inherit;132
display: block;133
}134
}136
.slogan {137
font-size: 64px;138
margin-bottom: @space-4x;139
}141
.slogan-subline {142
margin-bottom: @space-4x;143
}145
.subline {146
margin-top: @space-2x;147
font-weight: 500;148
font-size: 18px;149
line-height: 28px;150
color: @color-gray-600;152
@media(prefers-color-scheme: dark) {153
color: @color-gray-400;154
}155
}157
a {158
text-decoration: none;159
color: @color-gray-800;161
&:hover {162
text-decoration: underline;163
color: @color-gray-900;164
}166
@media(prefers-color-scheme: dark) {167
color: @color-gray-300;169
&:hover {170
color: @color-gray-100;171
}172
}173
}175
.list {176
padding-left: @space-1x;178
p {179
margin-left: calc(@space-1x / 2);180
}182
&.list-short {183
margin-top: @space-1x;185
p {186
margin-top: calc(@space-1x / 2);187
}188
}190
@media(prefers-color-scheme: dark) {192
li {193
color: @color-gray-400;194
}195
}196
}198
.link-list {200
span {201
margin-top: calc(@space-1x / 2);203
a {204
display: inline-block;205
margin-left: calc(@space-1x / 2);206
}207
}208
}210
&::-webkit-scrollbar {211
width: 10px;212
}214
&::-webkit-scrollbar-thumb {215
background: @color-gray-400;217
&:hover {218
background: @color-gray-500;219
}220
}222
.container {223
position: relative;224
}226
aside {227
position: fixed;228
transform: translate(calc(-100% - @space-2x), 0);229
width: 250px;230
padding-top: @space-4x;232
h4 {233
margin: 0;234
cursor: pointer;235
user-select: none;236
margin-bottom: @space-1x;237
}239
ul {240
list-style-type: none;241
margin-top: @space-2x;243
li {244
margin-top: @space-1x;245
cursor: pointer;246
user-select: none;247
font-size: 16px;248
font-weight: 500;249
color: @color-gray-700;250
line-height: 24px;252
&:hover {253
color: @color-gray-900;254
}256
@media(prefers-color-scheme: dark) {257
color: @color-gray-400;259
&:hover {260
color: @color-gray-200;261
}262
}263
}264
}265
}267
code {268
display: block;269
background: @color-gray-900;270
border-radius: 4px;271
padding: @space-1x;272
margin-top: @space-2x;273
position: relative;275
@media(prefers-color-scheme: dark) {276
background: darken(@color-gray-900, 8%);277
}279
pre {280
color: @color-gray-400;281
line-height: 22px;282
tab-size: 40px;283
font-family: 'JetBrains Mono', monospace;285
span {286
font-family: 'JetBrains Mono', monospace;287
color: inherit;289
&.n {290
color: @color-gray-50;291
}293
&.c {294
color: @color-blue-300;295
}297
&.s {298
color: @color-green-300;299
}301
&.p {302
color: @color-cyan-300;303
}305
&.x {306
color: @color-teal-400;307
}309
&.ref {310
cursor: pointer;312
&:hover {313
text-decoration: underline;314
}315
}316
}317
}319
.clipboard {320
position: absolute;321
top: 14px;322
right: 14px;323
width: 34px;324
height: 34px;325
padding: 5px;326
border-radius: 50%;327
cursor: pointer;328
color: @color-gray-600;330
&:hover {331
color: @color-gray-700;333
&::before,334
&::after {335
opacity: 1;336
}337
}339
&::before {340
content: '';341
opacity: 0;342
display: inline-block;343
position: absolute;344
user-select: none;345
pointer-events: none;346
left: 50%;347
top: -2px;348
transform: translate(-50%, 0);349
border: 5px solid transparent;350
border-top: 5px solid @color-gray-900;351
}353
&::after {354
content: attr(data-title);355
opacity: 0;356
display: inline-block;357
position: absolute;358
background: @color-gray-900;359
padding: 6px 8px;360
color: @color-white;361
font-family: 'Inter', sans-serif;362
font-size: 12px;363
border-radius: 3px;364
user-select: none;365
pointer-events: none;366
left: 50%;367
top: -25px;368
transform: translate(-50%, 0);369
}370
}371
}373
.logo {374
margin-top: @space-2x;375
cursor: pointer;376
}378
.banner {379
display: block;380
margin-top: @space-4x;382
img {383
width: 100%;384
height: 100%;385
object-fit: cover;386
display: block;387
border-radius: 4px;388
height: 500px;389
}391
p {392
margin-top: @space-2x;393
}394
}396
.embed {397
display: block;398
margin-top: @space-4x;400
iframe {401
border-radius: 4px;402
width: 100%;403
height: 500px;404
pointer-events: none;405
}407
p {408
margin-top: @space-2x;409
}410
}412
.breadcrumb {413
display: flex;414
padding-top: @space-4x;415
list-style-type: none;417
li {418
color: @color-gray-700;419
font-size: 16px;420
line-height: 24px;421
position: relative;422
padding-right: @space-1x;424
&:not(:last-of-type) {426
&::after {427
content: '/';428
display: inline-block;429
position: absolute;430
right: 7px;431
user-select: none;432
}433
}435
@media(prefers-color-scheme: dark) {436
color: @color-gray-400;438
a {439
color: @color-gray-400;441
&:hover {442
color: @color-gray-200;443
}444
}445
}446
}447
}449
.palette-list {450
display: flex;451
flex-wrap: wrap;452
list-style-type: none;453
margin-top: @space-4x;454
gap: @space-1x;456
.palette {457
display: flex;458
flex-direction: column;459
border-radius: 4px;460
width: calc(25% - @space-1x * 3 / 4);461
margin-bottom: @space-1x;463
.palette-tone {464
width: 100%;465
color: white;466
font-size: 14px;467
display: inline-flex;468
align-items: center;469
padding: calc(@space-1x / 1.25);470
cursor: pointer;471
user-select: none;472
transition: margin ease 0.2s, width ease 0.2s, height ease 0.2s, padding ease 0.2s, border-radius ease 0.2s;474
&.dark {475
color: @color-gray-900;476
font-weight: 600;477
}479
&:hover {480
margin: -4px;481
width: calc(100% + 8px);482
height: calc(100% + 8px);483
padding: calc(@space-1x / 1.25 + 4px);484
z-index: 1;485
border-radius: 4px;486
}488
&:first-of-type {489
border-top-left-radius: 4px;490
border-top-right-radius: 4px;491
}493
&:last-of-type {494
border-bottom-left-radius: 4px;495
border-bottom-right-radius: 4px;496
}497
}498
}499
}501
.icon-list {502
display: flex;503
flex-wrap: wrap;504
list-style-type: none;505
margin-top: @space-2x;506
margin-bottom: @space-2x;507
gap: @space-1x;509
.icon {510
display: flex;511
border-radius: 4px;512
justify-content: center;513
align-items: center;514
width: calc(10% - @space-1x * 9 / 10);515
aspect-ratio: 1 / 1;516
background: @color-gray-50;517
cursor: pointer;519
.ico {520
color: @color-gray-600;521
transition: color ease 0.2s;522
}524
&:hover {526
.ico {527
color: @color-gray-900;528
}529
}531
@media(prefers-color-scheme: dark) {532
background: darken(@color-gray-900, 8%);534
.ico {535
color: @color-gray-500;536
}538
&:hover {540
.ico {541
color: @color-gray-200;542
}543
}544
}545
}546
}548
footer {549
margin-top: @space-8x;550
margin-bottom: @space-4x;552
.container {553
display: flex;554
justify-content: flex-end;555
gap: @space-1x;556
}558
p {559
flex: 1;560
align-self: flex-start;561
color: @color-gray-700;562
margin: 0;563
}565
a {566
font-size: 16px;567
}569
@media(prefers-color-scheme: dark) {571
p {572
color: @color-gray-500;573
}575
a {576
color: @color-gray-500;578
&:hover {579
color: @color-gray-300;580
}581
}582
}583
}585
.tooltip {586
position: relative;588
&:hover {590
&::before,591
&::after {592
opacity: 1;593
transition-delay: 1s;594
}596
&::before {597
bottom: -13px;598
}600
&::after {601
bottom: -40px;602
}603
}605
&::before,606
&::after {607
opacity: 0;608
content: '';609
display: inline-block;610
position: absolute;611
user-select: none;612
pointer-events: none;613
transition: opacity ease 0.1s, bottom ease 0.1s;614
transition-delay: 0s;615
z-index: 2;616
left: 50%;617
transform: translate(-50%, 0);618
}620
&::before {621
border: 3px solid transparent;622
border-bottom: 3px solid @color-gray-900;623
bottom: -10px;624
}626
&::after {627
content: attr(data-title);628
background: @color-gray-900;629
font-size: 12px;630
color: @color-white;631
white-space: nowrap;632
padding: 6px 10px;633
padding-bottom: 7px;634
border-radius: 3px;635
bottom: -37px;636
height: 15px;637
min-width: 40px;638
text-align: center;639
font-weight: 400;640
}641
}643
.snackbar {644
background: @color-gray-900;645
position: fixed;646
left: @space-2x;647
bottom: @space-1x;648
border-radius: 4px;649
color: @color-white;650
padding: 18px 30px;651
pointer-events: none;652
opacity: 0;653
transition: opacity ease 0.2s, bottom ease 0.2s;655
&.active {656
opacity: 1;657
bottom: @space-2x;658
}