A lightweight JavaScript game engine
git clone git://soophie.de/game-engine
blob: e015a65b83b5390a029e471446696de7e7937977 (10863 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
body {45
@media(prefers-color-scheme: dark) {46
background: @color-black;47
}48
}50
h1 {51
font-size: 36px;52
margin-top: @space-4x;54
sup {55
font-size: 18px;56
font-weight: 600;57
padding-left: 2px;58
vertical-align: top;59
}61
@media(prefers-color-scheme: dark) {62
color: @color-white;63
}64
}66
h2 {67
font-size: 28px;68
font-weight: 700;69
margin-top: @space-4x;70
margin-bottom: @space-2x;72
@media(prefers-color-scheme: dark) {73
color: @color-white;74
}76
@media(min-width: @screen-xs) {77
margin-top: @space-8x;78
}79
}81
h3 {82
font-size: 24px;83
font-weight: 600;84
margin-top: @space-2x;86
@media(prefers-color-scheme: dark) {87
color: @color-white;88
}89
}91
h4 {92
font-size: 18px;93
font-weight: 600;94
margin-top: @space-2x;96
@media(prefers-color-scheme: dark) {97
color: @color-white;98
}99
}101
p {102
color: @color-gray-700;103
font-size: 16px;104
margin-top: @space-2x;105
line-height: 26px;107
@media(prefers-color-scheme: dark) {108
color: @color-gray-400;109
}111
a {112
text-decoration: underline;113
}115
mark {116
background: @color-gray-200;117
border-radius: 2px;118
padding: 2px 4px;119
color: @color-gray-800;120
word-break: break-word;122
@media(prefers-color-scheme: dark) {123
color: @color-gray-400;124
background: darken(@color-gray-900, 8%);125
}126
}128
b {129
font-weight: 500;131
@media(prefers-color-scheme: dark) {132
color: @color-gray-100;133
}135
&.note {136
margin-bottom: calc(@space-1x / 2);137
display: inline-block;139
@media(prefers-color-scheme: dark) {140
color: @color-white;141
}142
}143
}145
span {146
color: inherit;147
display: block;148
}149
}151
.slogan {152
font-size: 44px;153
margin-bottom: @space-4x;155
@media(min-width: @screen-xs) {156
font-size: 64px;157
}158
}160
.slogan-subline {161
margin-bottom: @space-4x;162
}164
.subline {165
margin-top: @space-2x;166
font-weight: 500;167
font-size: 18px;168
line-height: 28px;169
color: @color-gray-600;171
@media(prefers-color-scheme: dark) {172
color: @color-gray-400;173
}174
}176
a {177
text-decoration: none;178
color: @color-gray-800;180
&:hover {181
text-decoration: underline;182
color: @color-gray-900;183
}185
@media(prefers-color-scheme: dark) {186
color: @color-gray-300;188
&:hover {189
color: @color-gray-100;190
}191
}192
}194
.list {195
padding-left: @space-1x;197
p {198
margin-left: calc(@space-1x / 2);199
}201
&.list-short {202
margin-top: @space-1x;204
p {205
margin-top: calc(@space-1x / 2);206
}207
}209
@media(prefers-color-scheme: dark) {211
li {212
color: @color-gray-400;213
}214
}215
}217
.link-list {219
span {220
margin-top: calc(@space-1x / 2);222
a {223
display: inline-block;224
margin-left: calc(@space-1x / 2);225
}226
}227
}229
&::-webkit-scrollbar {230
width: 10px;231
}233
&::-webkit-scrollbar-thumb {234
background: @color-gray-400;236
&:hover {237
background: @color-gray-500;238
}239
}241
.container {242
position: relative;243
}245
aside {246
position: fixed;247
transform: translate(calc(-100% - @space-2x), 0);248
width: 250px;249
padding-top: @space-4x;250
display: none;252
@media(min-width: 1500px) {253
display: block;254
}256
h4 {257
margin: 0;258
cursor: pointer;259
user-select: none;260
margin-bottom: @space-1x;261
}263
ul {264
list-style-type: none;265
margin-top: @space-2x;267
li {268
margin-top: @space-1x;269
cursor: pointer;270
user-select: none;271
font-size: 16px;272
font-weight: 500;273
color: @color-gray-700;274
line-height: 24px;276
&:hover {277
color: @color-gray-900;278
}280
@media(prefers-color-scheme: dark) {281
color: @color-gray-400;283
&:hover {284
color: @color-gray-200;285
}286
}287
}288
}289
}291
code {292
display: block;293
background: @color-gray-900;294
border-radius: 4px;295
padding: @space-1x;296
margin-top: @space-2x;297
position: relative;298
overflow-x: auto;300
&::-webkit-scrollbar {301
height: 8px;302
}304
&::-webkit-scrollbar-thumb {305
background: @color-gray-700;307
&:hover {308
background: @color-gray-800;309
}310
}312
@media(prefers-color-scheme: dark) {313
background: darken(@color-gray-900, 8%);314
}316
pre {317
color: @color-gray-400;318
line-height: 22px;319
tab-size: 40px;320
font-family: 'JetBrains Mono', monospace;321
display: inline-block;323
span {324
font-family: 'JetBrains Mono', monospace;325
color: inherit;327
&.n {328
color: @color-gray-50;329
}331
&.c {332
color: @color-blue-300;333
}335
&.s {336
color: @color-green-300;337
}339
&.p {340
color: @color-cyan-300;341
}343
&.x {344
color: @color-teal-400;345
}347
&.ref {348
cursor: pointer;350
&:hover {351
text-decoration: underline;352
}353
}354
}355
}357
.clipboard {358
position: absolute;359
top: 14px;360
right: 14px;361
width: 34px;362
height: 34px;363
padding: 5px;364
border-radius: 50%;365
cursor: pointer;366
color: @color-gray-600;368
&:hover {369
color: @color-gray-700;371
&::before,372
&::after {373
opacity: 1;374
}375
}377
&::before {378
content: '';379
opacity: 0;380
display: inline-block;381
position: absolute;382
user-select: none;383
pointer-events: none;384
left: 50%;385
top: -2px;386
transform: translate(-50%, 0);387
border: 5px solid transparent;388
border-top: 5px solid @color-gray-900;389
}391
&::after {392
content: attr(data-title);393
opacity: 0;394
display: inline-block;395
position: absolute;396
background: @color-gray-900;397
padding: 6px 8px;398
color: @color-white;399
font-family: 'Inter', sans-serif;400
font-size: 12px;401
border-radius: 3px;402
user-select: none;403
pointer-events: none;404
left: 50%;405
top: -25px;406
transform: translate(-50%, 0);407
}408
}409
}411
.logo {412
margin-top: @space-2x;413
cursor: pointer;414
}416
.banner {417
display: block;418
margin-top: @space-4x;420
img {421
width: 100%;422
height: 100%;423
object-fit: cover;424
display: block;425
border-radius: 4px;426
height: 500px;427
}429
p {430
margin-top: @space-2x;431
}432
}434
.embed {435
display: block;436
margin-top: @space-4x;438
iframe {439
border-radius: 4px;440
width: 100%;441
height: calc(100vw * 500 / 800);442
pointer-events: none;444
@media(min-width: 800px) {445
width: 100%;446
height: 500px;447
}448
}450
p {451
margin-top: @space-2x;452
}453
}455
.breadcrumb {456
display: flex;457
padding-top: @space-2x;458
list-style-type: none;460
@media(min-width: @screen-xs) {461
padding-top: @space-4x;462
}464
li {465
color: @color-gray-700;466
font-size: 16px;467
line-height: 24px;468
position: relative;469
padding-right: @space-1x;471
&:not(:last-of-type) {473
&::after {474
content: '/';475
display: inline-block;476
position: absolute;477
right: 7px;478
user-select: none;479
}480
}482
@media(prefers-color-scheme: dark) {483
color: @color-gray-400;485
a {486
color: @color-gray-400;488
&:hover {489
color: @color-gray-200;490
}491
}492
}493
}494
}496
.palette-list {497
display: flex;498
flex-wrap: wrap;499
list-style-type: none;500
margin-top: @space-4x;501
gap: @space-1x;503
.palette {504
display: flex;505
flex-direction: column;506
border-radius: 4px;507
width: calc(50% - @space-1x * 1 / 2);508
margin-bottom: @space-1x;510
@media(min-width: @screen-xs) {511
width: calc(25% - @space-1x * 3 / 4);512
}514
.palette-tone {515
width: 100%;516
color: white;517
font-size: 14px;518
display: inline-flex;519
align-items: center;520
padding: calc(@space-1x / 1.25);521
cursor: pointer;522
user-select: none;523
transition: margin ease 0.2s, width ease 0.2s, height ease 0.2s, padding ease 0.2s, border-radius ease 0.2s;525
&.dark {526
color: @color-gray-900;527
font-weight: 500;528
}530
&:hover {531
margin: -4px;532
width: calc(100% + 8px);533
height: calc(100% + 8px);534
padding: calc(@space-1x / 1.25 + 4px);535
z-index: 1;536
border-radius: 4px;537
}539
&:first-of-type {540
border-top-left-radius: 4px;541
border-top-right-radius: 4px;542
}544
&:last-of-type {545
border-bottom-left-radius: 4px;546
border-bottom-right-radius: 4px;547
}548
}549
}550
}552
.icon-list {553
display: flex;554
flex-wrap: wrap;555
list-style-type: none;556
margin-top: @space-2x;557
margin-bottom: @space-2x;558
gap: @space-1x;560
.icon {561
display: flex;562
border-radius: 4px;563
justify-content: center;564
align-items: center;565
width: calc(25% - @space-1x * 3 / 4);566
aspect-ratio: 1 / 1;567
background: @color-gray-50;568
cursor: pointer;570
@media(min-width: @screen-xs) {571
width: calc(16.666% - @space-1x * 5 / 6);572
}574
@media(min-width: @screen-sm) {575
width: calc(10% - @space-1x * 9 / 10);576
}578
.ico {579
color: @color-gray-600;580
transition: color ease 0.2s;581
}583
&:hover {585
.ico {586
color: @color-gray-900;587
}588
}590
@media(prefers-color-scheme: dark) {591
background: darken(@color-gray-900, 8%);593
.ico {594
color: @color-gray-500;595
}597
&:hover {599
.ico {600
color: @color-gray-200;601
}602
}603
}604
}605
}607
footer {608
margin-top: @space-4x;609
margin-bottom: @space-2x;611
@media(min-width: @screen-xs) {612
margin-top: @space-8x;613
margin-bottom: @space-4x;615
a {617
&:first-of-type {618
display: flex !important;619
}620
}621
}623
.container {624
display: flex;625
justify-content: flex-end;626
gap: @space-1x;627
}629
p {630
flex: 1;631
align-self: flex-start;632
color: @color-gray-700;633
margin: 0;634
}636
a {637
font-size: 16px;638
display: flex;639
align-items: center;641
&:first-of-type {642
display: none;643
}644
}646
@media(prefers-color-scheme: dark) {648
p {649
color: @color-gray-500;650
}652
a {653
color: @color-gray-500;655
&:hover {656
color: @color-gray-300;657
}658
}659
}660
}662
.tooltip {663
position: relative;665
&:hover {667
&::before,668
&::after {669
opacity: 1;670
transition-delay: 1s;671
}673
&::before {674
bottom: -13px;675
}677
&::after {678
bottom: -40px;679
}680
}682
&::before,683
&::after {684
opacity: 0;685
content: '';686
display: inline-block;687
position: absolute;688
user-select: none;689
pointer-events: none;690
transition: opacity ease 0.1s, bottom ease 0.1s;691
transition-delay: 0s;692
z-index: 2;693
left: 50%;694
transform: translate(-50%, 0);695
}697
&::before {698
border: 3px solid transparent;699
border-bottom: 3px solid @color-gray-900;700
bottom: -10px;701
}703
&::after {704
content: attr(data-title);705
background: @color-gray-900;706
font-size: 12px;707
color: @color-white;708
white-space: nowrap;709
padding: 6px 10px;710
padding-bottom: 7px;711
border-radius: 3px;712
bottom: -37px;713
height: 15px;714
min-width: 40px;715
text-align: center;716
font-weight: 400;717
}718
}720
.snackbar {721
background: @color-gray-900;722
position: fixed;723
left: 50%;724
bottom: 0;725
border-radius: 4px;726
color: @color-white;727
padding: 18px 30px;728
pointer-events: none;729
opacity: 0;730
transition: opacity ease 0.2s, bottom ease 0.2s;731
transform: translate(-50%, 0);732
white-space: nowrap;733
z-index: 99;735
&.active {736
opacity: 1;737
bottom: @space-1x;738
}740
@media(min-width: @screen-xs) {741
left: @space-2x;742
bottom: @space-1x;743
transform: none;745
&.active {746
bottom: @space-2x;747
}748
}749
}