11import React , { useState } from "react" ;
22
3- // Corner thumbnail for a project card. Shows a rendered screenshot of the
4- // project (with the ZX rainbow ribbon baked into a corner by gif-service);
5- // falls back to the static cartridge graphic when there's no screenshot yet,
6- // the project isn 't public, or the render failed .
3+ // Tilted corner thumbnail for a project card. Shows a rendered screenshot of
4+ // the project (a square, border-padded PNG from gif-service); falls back to the
5+ // static cartridge graphic when there's no screenshot yet, the project isn't
6+ // public, or it can 't be rendered (e.g. zmac/sdcc) .
77export default function ProjectThumbnail ( { projectId, updatedAt } ) {
88 const [ failed , setFailed ] = useState ( false ) ;
99 const version = updatedAt ? Date . parse ( updatedAt ) || 0 : 0 ;
@@ -19,27 +19,19 @@ export default function ProjectThumbnail({ projectId, updatedAt }) {
1919 height : "120px" ,
2020 background : "#000" ,
2121 borderRadius : "20px" ,
22+ transform : "rotate(12deg)" ,
2223 overflow : "hidden" ,
23- // Screenshots read cleaner upright and opaque; the cartridge fallback
24- // keeps its original tilted, translucent look.
25- transform : showShot ? "none" : "rotate(12deg)" ,
24+ // Screenshots are the real content, so show them opaque; the cartridge
25+ // fallback keeps its original faded decoration look.
2626 opacity : showShot ? 1 : 0.7 ,
2727 } }
2828 >
29- { showShot ? (
30- < img
31- src = { `/screenshots/${ projectId } .png?v=${ version } ` }
32- alt = ""
33- onError = { ( ) => setFailed ( true ) }
34- style = { { width : "100%" , height : "100%" , objectFit : "cover" } }
35- />
36- ) : (
37- < img
38- src = "/assets/images/zx-square.png"
39- alt = ""
40- style = { { width : "94%" , height : "94%" , objectFit : "cover" , margin : "3%" } }
41- />
42- ) }
29+ < img
30+ src = { showShot ? `/screenshots/${ projectId } .png?v=${ version } ` : "/assets/images/zx-square.png" }
31+ alt = ""
32+ onError = { showShot ? ( ) => setFailed ( true ) : undefined }
33+ style = { { width : "94%" , height : "94%" , objectFit : "cover" , margin : "3%" } }
34+ />
4335 </ div >
4436 ) ;
4537}
0 commit comments