Skip to content

Commit c773878

Browse files
committed
Generate animated GIFs for emulator demos in gallery
1 parent d17b371 commit c773878

17 files changed

Lines changed: 540 additions & 11 deletions

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,32 @@ Modern 8-bit Computer
1313
It blends the core principles of 8-bit computing with modern hardware components, making it practical and capable of handling everyday tasks.
1414

1515
<div class="hero-split">
16-
<div><span class="emu-gallery"><iframe id="emu-gallery-frame" title="X65 Emu" src="/emu/emu.html?disable-speaker-icon&disable-gui&file=roms/mixed_modes.xex"></iframe><a id="emu-gallery-link" href="/emu/?rom=roms/mixed_modes.xex#Emu"></a></span></div>
16+
<div><span class="emu-gallery"><img id="emu-gallery-image" src="/emu/roms/mixed_modes.gif" data-fallback="/emu/roms/mixed_modes.png" alt="X65 emulator demo"><a id="emu-gallery-link" href="/emu/?rom=roms/mixed_modes.xex#Emu"></a></span></div>
1717
<div><a href="/timeline.html"><img src="/media/2025-07-21_DEV-board.png" alt="X65 DEV-board"></a></div>
1818
</div>
1919

2020
<script>
2121
(function () {
2222
var demos = [
23-
{% for item in site.data.emu %}{% if item.gallery %} "{% unless item.xex contains 'http' %}roms/{% endunless %}{{ item.xex }}",
23+
{% for item in site.data.emu %}{% if item.gallery %} {
24+
rom: "{% unless item.xex contains 'http' %}roms/{% endunless %}{{ item.xex }}",
25+
src: "/emu/roms/{% if item.gallery == true %}{{ item.img | replace: '.png', '.gif' }}{% else %}{{ item.img }}{% endif %}",
26+
png: "/emu/roms/{{ item.img }}"
27+
},
2428
{% endif %}{% endfor %} ];
25-
var frame = document.getElementById('emu-gallery-frame');
29+
var image = document.getElementById('emu-gallery-image');
2630
var link = document.getElementById('emu-gallery-link');
2731
var current = 'roms/mixed_modes.xex';
32+
image.onerror = function () { image.src = image.getAttribute('data-fallback'); };
2833
function swap() {
2934
if (demos.length === 0) return;
3035
var next;
3136
do { next = demos[Math.floor(Math.random() * demos.length)]; }
32-
while (demos.length > 1 && next === current);
33-
current = next;
34-
frame.src = '/emu/emu.html?disable-speaker-icon&disable-gui&file=' + next;
35-
link.href = '/emu/?rom=' + next + '#Emu';
37+
while (demos.length > 1 && next.rom === current);
38+
current = next.rom;
39+
image.setAttribute('data-fallback', next.png);
40+
image.src = next.src;
41+
link.href = '/emu/?rom=' + next.rom + '#Emu';
3642
}
3743
setInterval(swap, 30000);
3844
})();

_data/emu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
img: MODE6_Farfar-perso1.png
3838
xex: MODE6_Farfar-perso1.xex
3939
src: https://arnaud-carre.github.io/2022-12-30-amiga-ham/
40-
gallery: true
40+
gallery: png
4141
- title: MODE7 (affine)<br>X65 mascot
4242
img: MODE7_mascot.png
4343
xex: MODE7_mascot.xex
@@ -93,7 +93,7 @@
9393
- title: Dune I<br>Chani encounter
9494
img: Dune_Chani.png
9595
xex: Dune_Chani.xex
96-
gallery: true
96+
gallery: png
9797
# - title: LukHash - Raster Bar<br>tribute
9898
# img: raster_bar.png
9999
# xex: raster_bar.xex

assets/style.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,12 @@ iframe#Emu {
315315
height: 240px;
316316
max-width: 100%;
317317
}
318-
.emu-gallery iframe {
318+
.emu-gallery img {
319319
width: 100%;
320320
height: 100%;
321-
border: none;
322321
display: block;
322+
object-fit: contain;
323+
image-rendering: pixelated;
323324
}
324325
.emu-gallery a {
325326
position: absolute;

emu/roms/4BB.gif

2.57 MB
Loading

emu/roms/80_columns.gif

9.88 KB
Loading

emu/roms/MODE0_text.gif

9.56 KB
Loading

emu/roms/MODE1_lobo_2.gif

25.2 KB
Loading

emu/roms/MODE2_SWBoy.gif

4.79 KB
Loading

emu/roms/MODE2_hello-glyphs.gif

28.2 KB
Loading
20.2 KB
Loading

0 commit comments

Comments
 (0)