Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 177 additions & 20 deletions .github/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,136 @@
opacity: 0.85;
margin: 0;
}
#source-link {
#metrics {
position: fixed;
top: 20px;
right: 20px;
bottom: 24px;
left: 24px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0;
padding: 10px;
border-radius: 999px;
border: 1px solid rgba(96, 158, 255, 0.35);
background: linear-gradient(135deg, rgba(18, 30, 58, 0.85), rgba(8, 12, 28, 0.85));
box-shadow: 0 12px 28px rgba(10, 22, 48, 0.45), inset 0 0 12px rgba(64, 124, 255, 0.25);
font-size: 0.78rem;
letter-spacing: 0.14em;
text-transform: uppercase;
backdrop-filter: blur(12px);
z-index: 8;
overflow: hidden;
max-width: 56px;
min-height: 46px;
box-sizing: border-box;
transition: max-width 0.28s ease, padding 0.28s ease, border-color 0.28s ease;
}
#metrics:hover,
#metrics:focus-within {
max-width: 320px;
padding: 8px 14px;
border-color: rgba(126, 188, 255, 0.6);
justify-content: flex-start;
}
#source-link {
display: inline-flex;
color: inherit;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
border-radius: 50%;
color: #d7e5ff;
text-decoration: none;
opacity: 0.8;
transition: opacity 0.2s ease, transform 0.2s ease;
}
#source-link svg {
width: 24px;
height: 24px;
width: 20px;
height: 20px;
fill: currentColor;
transition: transform 0.2s ease, opacity 0.2s ease;
}
#source-link:hover svg,
#source-link:focus svg {
transform: scale(1.05);
#source-link:hover,
#source-link:focus-visible {
opacity: 1;
transform: translateY(-1px);
}
.metrics-details {
display: inline-flex;
align-items: center;
gap: 12px;
opacity: 0;
transform: translateX(-6px);
pointer-events: none;
max-width: 0;
flex: 0 1 0%;
overflow: hidden;
margin-left: 0;
transition: opacity 0.18s ease, transform 0.2s ease, max-width 0.28s ease, margin-left 0.28s ease;
}
#metrics:hover .metrics-details,
#metrics:focus-within .metrics-details {
opacity: 1;
transform: translateX(0);
pointer-events: auto;
max-width: 260px;
flex-basis: 260px;
margin-left: 12px;
}
#metrics label {
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
color: #d7e5ff;
font-weight: 600;
cursor: default;
}
#metrics label::before {
content: '';
width: 16px;
height: 16px;
background-repeat: no-repeat;
background-size: contain;
opacity: 0.85;
}
#metrics label::after {
position: absolute;
bottom: 120%;
left: 50%;
padding: 4px 8px;
border-radius: 6px;
background: rgba(12, 20, 40, 0.9);
box-shadow: 0 6px 14px rgba(6, 12, 28, 0.3);
color: rgba(215, 229, 255, 0.85);
font-size: 0.65rem;
letter-spacing: 0.1em;
text-transform: uppercase;
white-space: nowrap;
transform: translate(-50%, 4px);
opacity: 0;
pointer-events: none;
transition: opacity 0.18s ease, transform 0.18s ease;
content: attr(data-hint);
}
#metrics label:hover::after,
#metrics label:focus-visible::after {
opacity: 1;
transform: translate(-50%, 0);
}
#uv_label::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23d7e5ff' d='M8 7a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 1.5c-2.9 0-5.5 1.31-5.5 3.25V13c0 .55.45 1 1 1h9c.55 0 1-.45 1-1v-1.25C13.5 9.81 10.9 8.5 8 8.5Z'/%3E%3C/svg%3E");
}
#pv_label::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23d7e5ff' d='M8 3.5c3.04 0 5.64 1.84 6.94 4.5-1.3 2.66-3.9 4.5-6.94 4.5S2.36 10.66 1.06 8C2.36 5.34 4.96 3.5 8 3.5Zm0 2.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z'/%3E%3C/svg%3E");
}
#metrics .separator {
color: rgba(215, 229, 255, 0.45);
font-size: 0.7rem;
letter-spacing: normal;
}
</style>
<script src="./coi-serviceworker.min.js"></script>
<script defer src="https://stateflare.yuchanns.xyz/track.js"></script>
</head>
<body>
<div id="overlay">
Expand All @@ -88,16 +197,25 @@ <h1 id="overlay-title"></h1>
</div>
</div>
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<a
id="source-link"
href="https://github.com/cloudwu/deepfuture"
target="_blank"
rel="noopener noreferrer"
>
<svg viewBox="0 0 16 16" aria-hidden="true">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8" />
</svg>
</a>
<div id="metrics" aria-live="polite" aria-expanded="false">
<a
id="source-link"
href="https://github.com/cloudwu/deepfuture"
target="_blank"
rel="noopener noreferrer"
aria-label="Source code on GitHub"
>
<svg viewBox="0 0 16 16" aria-hidden="true">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8" />
</svg>
</a>
<div class="metrics-details">
<span class="separator" aria-hidden="true">/</span>
<label id="uv_label" data-hint="UV" aria-label="Unique Visitors" title="UV"></label>
<span class="separator" aria-hidden="true">/</span>
<label id="pv_label" data-hint="PV" aria-label="Page Views" title="PV"></label>
</div>
</div>

<script>
(function () {
Expand All @@ -106,6 +224,45 @@ <h1 id="overlay-title"></h1>
const introEl = document.getElementById('overlay-intro');
const statusEl = document.getElementById('overlay-status');
const sourceLinkEl = document.getElementById('source-link');
const uvLabel = document.getElementById('uv_label');
const pvLabel = document.getElementById('pv_label');
const metrics = document.getElementById('metrics');

function attachLabelSanitizer(label, prefix) {
if (!label) return;
const config = { childList: true, characterData: true, subtree: true };
const regex = new RegExp('^\\s*' + prefix + '\\s*[::\\-–]?\\s*', 'i');

const apply = () => {
const raw = label.textContent || '';
if (!raw) return;
const cleaned = raw.replace(regex, '').trim();
if (cleaned !== raw) {
observer.disconnect();
label.textContent = cleaned;
observer.observe(label, config);
}
};

let observer = new MutationObserver(apply);
observer.observe(label, config);
apply();
}

attachLabelSanitizer(uvLabel, 'uv');
attachLabelSanitizer(pvLabel, 'pv');

if (metrics) {
const setExpanded = (expanded) => metrics.setAttribute('aria-expanded', expanded ? 'true' : 'false');
metrics.addEventListener('mouseenter', () => setExpanded(true));
metrics.addEventListener('mouseleave', () => setExpanded(false));
metrics.addEventListener('focusin', () => setExpanded(true));
metrics.addEventListener('focusout', () => {
if (!metrics.contains(document.activeElement)) {
setExpanded(false);
}
});
}

const locale = (navigator.language || navigator.userLanguage || 'en').toLowerCase();
const isChinese = locale.startsWith('zh');
Expand Down
50 changes: 7 additions & 43 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
name: Build Soluna
name: Build Runtime
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
strategy:
Expand All @@ -20,53 +20,17 @@ jobs:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/checkout@v5
with:
repository: floooh/sokol-tools-bin
ref: "a06f19929ff8f9824ec6dd87c21329b1f205809e"
path: sokol-tools-bin
fetch-depth: 1
- name: Setup sokol-shdc
shell: bash
run: |
TARGET_DIR="/usr/local/bin"
SHDC_BINARY="sokol-shdc"
FIND_PATH="bin/linux"
echo "Setting up sokol-tools from sokol-tools-bin/$FIND_PATH"
find sokol-tools-bin/$FIND_PATH -name $SHDC_BINARY -exec cp {} $TARGET_DIR \;
$SHDC_BINARY -h
- uses: yuchanns/actions-luamake@v1
- name: Build Soluna
uses: ./soluna/.github/actions/soluna
id: build
with:
luamake-version: "5bedfce66f075a9f68b1475747738b81b3b41c25"
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential \
libgl1-mesa-dev libglu1-mesa-dev libx11-dev \
libxrandr-dev libxi-dev libxxf86vm-dev libxcursor-dev \
libasound2-dev libfontconfig1-dev
- uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.17
actions-cache-folder: 'emsdk-cache'
- name: Build Emscripten
shell: bash
working-directory: soluna
run: |
luamake precompile
luamake -compiler emcc precompile
luamake -compiler emcc
soluna_path: "./soluna"
- name: Prepare Game Content
shell: bash
run: |
mkdir build
SOLUNA_BINARY="soluna.wasm"
SOLUNA_PATH=$(find soluna/bin -name $SOLUNA_BINARY | head -n 1)
SOLUNA_JS="soluna.js"
SOLUNA_JS_PATH=$(find soluna/bin -name $SOLUNA_JS | head -n 1)
sed -i 's/setBindGroup(groupIndex,group,(growMemViews(),HEAPU32),dynamicOffsetsPtr>>2,dynamicOffsetCount)/setBindGroup(groupIndex,group,(growMemViews(),HEAPU32).subarray(dynamicOffsetsPtr>>2,(dynamicOffsetsPtr>>2)+dynamicOffsetCount))/g' "$SOLUNA_JS_PATH"
cp "$SOLUNA_PATH" ./build/
cp "$SOLUNA_JS_PATH" ./build/
cp "${{ steps.build.outputs.SOLUNA_WASM_PATH }}" ./build/
cp "${{ steps.build.outputs.SOLUNA_JS_PATH }}" ./build/
zip -r ./build/main.zip asset core gameplay localization service visual main.game main.lua
cp .github/assets/index.html ./build/
cp .github/assets/font.zip ./build/
Expand Down
2 changes: 1 addition & 1 deletion soluna