A lightweight JavaScript game engine
git clone git://soophie.de/game-engine
blob: 380069e088151c8b33ded82a63c6b52c052181fc (9063 bytes)[doc][blame][raw]
1
@space-1x: 20px;2
@space-2x: 40px;3
@space-4x: 80px;4
@space-8x: 160px;6
@screen-xs: 576px;7
@screen-sm: 768px;8
@screen-md: 992px;9
@screen-lg: 1200px;11
.space-1 {12
width: 100%;13
height: @space-1x;14
}16
.space-2 {17
width: 100%;18
height: @space-2x;19
}21
.space-4 {22
width: 100%;23
height: @space-4x;24
}26
.space-8 {27
width: 100%;28
height: @space-8x;29
}31
* {32
color: @color-gray-900;33
font-family: 'Inter';34
-webkit-tap-highlight-color: transparent;35
}37
body,38
main,39
footer{40
overflow-x: hidden;41
}43
h1 {44
font-size: 36px;45
margin-top: @space-4x;47
sup {48
font-size: 18px;49
font-weight: 600;50
padding-left: 2px;51
vertical-align: top;52
}53
}55
h2 {56
font-size: 28px;57
font-weight: 700;58
margin-top: @space-4x;59
margin-bottom: @space-2x;61
@media(min-width: @screen-xs) {62
margin-top: @space-8x;63
}64
}66
h3 {67
font-size: 24px;68
font-weight: 600;69
margin-top: @space-2x;70
}72
h4 {73
font-size: 18px;74
font-weight: 600;75
margin-top: @space-2x;76
}78
p {79
color: @color-gray-700;80
font-size: 16px;81
margin-top: @space-2x;82
line-height: 26px;84
a {85
text-decoration: underline;86
}88
mark {89
background: @color-gray-200;90
border-radius: 2px;91
padding: 2px 4px;92
color: @color-gray-800;93
word-break: break-word;94
}96
b {97
font-weight: 500;99
&.note {100
margin-bottom: calc(@space-1x / 2);101
display: inline-block;102
}103
}105
span {106
color: inherit;107
display: block;108
}109
}111
.slogan {112
font-size: 44px;113
margin-bottom: @space-4x;115
@media(min-width: @screen-xs) {116
font-size: 64px;117
}118
}120
.slogan-subline {121
margin-bottom: @space-4x;122
}124
.subline {125
margin-top: @space-2x;126
font-weight: 500;127
font-size: 18px;128
line-height: 28px;129
color: @color-gray-600;130
}132
a {133
text-decoration: none;134
color: @color-gray-800;136
&:hover {137
text-decoration: underline;138
color: @color-gray-900;139
}140
}142
.list {143
padding-left: @space-1x;145
p {146
margin-left: calc(@space-1x / 2);147
}149
&.list-short {150
margin-top: @space-1x;152
p {153
margin-top: calc(@space-1x / 2);154
}155
}156
}158
&::-webkit-scrollbar {159
width: 10px;160
}162
&::-webkit-scrollbar-thumb {163
background: @color-gray-400;165
&:hover {166
background: @color-gray-500;167
}168
}170
.container {171
position: relative;172
}174
aside {175
position: fixed;176
transform: translate(calc(-100% - @space-2x), 0);177
width: 250px;178
padding-top: @space-4x;179
display: none;181
@media(min-width: @screen-lg) {182
display: block;183
}185
h4 {186
margin: 0;187
cursor: pointer;188
user-select: none;189
margin-bottom: @space-1x;190
}192
ul {193
list-style-type: none;194
margin-top: @space-2x;196
li {197
margin-top: calc(@space-1x / 2);198
cursor: pointer;199
user-select: none;200
font-size: 16px;201
font-weight: 500;202
color: @color-gray-700;203
line-height: 24px;205
&:hover {206
color: @color-gray-900;207
}208
}209
}210
}212
code {213
display: block;214
background: @color-gray-900;215
border-radius: 4px;216
padding: @space-1x;217
margin-top: @space-2x;218
position: relative;219
overflow-x: auto;221
&::-webkit-scrollbar {222
height: 8px;223
}225
&::-webkit-scrollbar-thumb {226
background: @color-gray-700;228
&:hover {229
background: @color-gray-800;230
}231
}233
pre {234
color: @color-gray-400;235
line-height: 22px;236
tab-size: 40px;237
font-family: 'JetBrains Mono', monospace;238
display: inline-block;240
span {241
font-family: 'JetBrains Mono', monospace;242
color: inherit;244
&.n {245
color: @color-gray-50;246
}248
&.c {249
color: @color-blue-300;250
}252
&.s {253
color: @color-green-300;254
}256
&.p {257
color: @color-cyan-300;258
}260
&.x {261
color: @color-teal-400;262
}264
&.ref {265
cursor: pointer;267
&:hover {268
text-decoration: underline;269
}270
}271
}272
}274
.clipboard {275
position: absolute;276
top: 14px;277
right: 14px;278
width: 34px;279
height: 34px;280
padding: 5px;281
border-radius: 50%;282
cursor: pointer;283
color: @color-gray-600;285
&:hover {286
color: @color-gray-700;288
&::before,289
&::after {290
opacity: 1;291
}292
}294
&::before {295
content: '';296
opacity: 0;297
display: inline-block;298
position: absolute;299
user-select: none;300
pointer-events: none;301
left: 50%;302
top: -2px;303
transform: translate(-50%, 0);304
border: 5px solid transparent;305
border-top: 5px solid @color-gray-900;306
}308
&::after {309
content: attr(data-title);310
opacity: 0;311
display: inline-block;312
position: absolute;313
background: @color-gray-900;314
padding: 6px 8px;315
color: @color-white;316
font-family: 'Inter', sans-serif;317
font-size: 12px;318
border-radius: 3px;319
user-select: none;320
pointer-events: none;321
left: 50%;322
top: -25px;323
transform: translate(-50%, 0);324
}325
}326
}328
.logo {329
margin-top: @space-2x;330
cursor: pointer;331
}333
.banner {334
display: block;335
margin-top: @space-4x;337
img {338
width: 100%;339
height: 100%;340
object-fit: cover;341
display: block;342
border-radius: 4px;343
height: 500px;344
}346
p {347
margin-top: @space-2x;348
}349
}351
.embed {352
display: block;353
margin-top: @space-4x;355
iframe {356
border-radius: 4px;357
width: 100%;358
height: calc(100vw * 500 / 800);359
pointer-events: none;361
@media(min-width: 800px) {362
width: 100%;363
height: 500px;364
}365
}367
p {368
margin-top: @space-2x;369
}370
}372
.breadcrumb {373
display: flex;374
padding-top: @space-2x;375
list-style-type: none;377
@media(min-width: @screen-xs) {378
padding-top: @space-4x;379
}381
li {382
color: @color-gray-700;383
font-size: 16px;384
line-height: 24px;385
position: relative;386
padding-right: @space-1x;388
&:not(:last-of-type) {390
&::after {391
content: '/';392
display: inline-block;393
position: absolute;394
right: 7px;395
user-select: none;396
}397
}398
}399
}401
.palette-list {402
display: flex;403
flex-wrap: wrap;404
list-style-type: none;405
margin-top: @space-4x;406
gap: @space-1x;408
.palette {409
display: flex;410
flex-direction: column;411
border-radius: 4px;412
width: calc(50% - @space-1x * 1 / 2);413
margin-bottom: @space-1x;415
@media(min-width: @screen-xs) {416
width: calc(25% - @space-1x * 3 / 4);417
}419
.palette-tone {420
width: 100%;421
color: white;422
font-size: 14px;423
display: inline-flex;424
align-items: center;425
padding: calc(@space-1x / 1.25);426
cursor: pointer;427
user-select: none;428
transition: margin ease 0.2s, width ease 0.2s, height ease 0.2s, padding ease 0.2s, border-radius ease 0.2s;430
&.dark {431
color: @color-gray-900;432
font-weight: 500;433
}435
&:hover {436
margin: -4px;437
width: calc(100% + 8px);438
height: calc(100% + 8px);439
padding: calc(@space-1x / 1.25 + 4px);440
z-index: 1;441
border-radius: 4px;442
}444
&:first-of-type {445
border-top-left-radius: 4px;446
border-top-right-radius: 4px;447
}449
&:last-of-type {450
border-bottom-left-radius: 4px;451
border-bottom-right-radius: 4px;452
}453
}454
}455
}457
.icon-list {458
display: flex;459
flex-wrap: wrap;460
list-style-type: none;461
margin-top: @space-2x;462
margin-bottom: @space-2x;463
gap: @space-1x;465
.icon {466
display: flex;467
border-radius: 4px;468
justify-content: center;469
align-items: center;470
width: calc(25% - @space-1x * 3 / 4);471
aspect-ratio: 1 / 1;472
background: @color-gray-50;473
cursor: pointer;475
@media(min-width: @screen-xs) {476
width: calc(16.666% - @space-1x * 5 / 6);477
}479
@media(min-width: @screen-sm) {480
width: calc(10% - @space-1x * 9 / 10);481
}483
.ico {484
color: @color-gray-600;485
transition: color ease 0.2s;486
}488
&:hover {490
.ico {491
color: @color-gray-900;492
}493
}494
}495
}497
footer {498
margin-top: @space-4x;499
margin-bottom: @space-2x;501
@media(min-width: @screen-xs) {502
margin-top: @space-8x;503
margin-bottom: @space-4x;505
a {507
&:first-of-type {508
display: flex !important;509
}510
}511
}513
.container {514
display: flex;515
justify-content: flex-end;516
gap: @space-1x;517
}519
p {520
flex: 1;521
align-self: flex-start;522
color: @color-gray-700;523
margin: 0;524
}526
a {527
font-size: 16px;528
display: flex;529
align-items: center;531
&:first-of-type {532
display: none;533
}534
}535
}537
.tooltip {538
position: relative;540
&:hover {542
&::before,543
&::after {544
opacity: 1;545
transition-delay: 1s;546
}548
&::before {549
bottom: -13px;550
}552
&::after {553
bottom: -40px;554
}555
}557
&::before,558
&::after {559
opacity: 0;560
content: '';561
display: inline-block;562
position: absolute;563
user-select: none;564
pointer-events: none;565
transition: opacity ease 0.1s, bottom ease 0.1s;566
transition-delay: 0s;567
z-index: 2;568
left: 50%;569
transform: translate(-50%, 0);570
}572
&::before {573
border: 3px solid transparent;574
border-bottom: 3px solid @color-gray-900;575
bottom: -10px;576
}578
&::after {579
content: attr(data-title);580
background: @color-gray-900;581
font-size: 12px;582
color: @color-white;583
white-space: nowrap;584
padding: 6px 10px;585
padding-bottom: 7px;586
border-radius: 3px;587
bottom: -37px;588
height: 15px;589
min-width: 40px;590
text-align: center;591
font-weight: 400;592
}593
}595
.snackbar {596
background: @color-gray-900;597
position: fixed;598
left: 50%;599
bottom: 0;600
border-radius: 4px;601
color: @color-white;602
padding: 18px 30px;603
pointer-events: none;604
opacity: 0;605
transition: opacity ease 0.2s, bottom ease 0.2s;606
transform: translate(-50%, 0);607
white-space: nowrap;609
&.active {610
opacity: 1;611
bottom: @space-1x;612
}614
@media(min-width: @screen-xs) {615
left: @space-2x;616
bottom: @space-1x;617
transform: none;619
&.active {620
bottom: @space-2x;621
}622
}623
}