|
1 | | -import React, { MouseEvent } from 'react'; |
| 1 | +import React from 'react'; |
| 2 | +import Head from 'next/head'; |
2 | 3 | import styles from '@/styles/powered.module.css'; |
3 | 4 | import drawnDownAbyss1 from '@/assets/drawn-down-abyss-1.png'; |
4 | 5 | import froggo1 from '@/assets/froggo-swing-n-grapple-1.png'; |
@@ -66,26 +67,33 @@ class Powered extends React.Component<any, any> { |
66 | 67 | } |
67 | 68 |
|
68 | 69 | return ( |
69 | | - <div |
70 | | - className={styles.powered} |
71 | | - style={{ |
72 | | - backgroundImage: `url(${currentGame.image})`, |
73 | | - }} |
74 | | - > |
75 | | - <div className={styles.poweredcontainer}> |
76 | | - <div className={styles.header}>Pygame Powered</div> |
77 | | - Over the many years pygame has been around, there have been amazing projects created by the community. |
78 | | - <div className={styles.poweredcards}> |
79 | | - {games.map((data, key) => { |
80 | | - return ( |
81 | | - <div key={key} onMouseEnter={this.changeBackground} data-info={key}> |
82 | | - <PoweredCard name={data.name} author={data.author} link={data.mainlink} /> |
83 | | - </div> |
84 | | - ); |
85 | | - })} |
| 70 | + <> |
| 71 | + <Head> |
| 72 | + {games.map((data, key) => { |
| 73 | + return <link key={key} rel="preload" href={data.image} as="image" />; |
| 74 | + })} |
| 75 | + </Head> |
| 76 | + <div |
| 77 | + className={styles.powered} |
| 78 | + style={{ |
| 79 | + backgroundImage: `url(${currentGame.image})`, |
| 80 | + }} |
| 81 | + > |
| 82 | + <div className={styles.poweredcontainer}> |
| 83 | + <div className={styles.header}>Pygame Powered</div> |
| 84 | + Over the many years pygame has been around, there have been amazing projects created by the community. |
| 85 | + <div className={styles.poweredcards}> |
| 86 | + {games.map((data, key) => { |
| 87 | + return ( |
| 88 | + <div key={key} onMouseEnter={this.changeBackground} data-info={key}> |
| 89 | + <PoweredCard name={data.name} author={data.author} link={data.mainlink} /> |
| 90 | + </div> |
| 91 | + ); |
| 92 | + })} |
| 93 | + </div> |
86 | 94 | </div> |
87 | 95 | </div> |
88 | | - </div> |
| 96 | + </> |
89 | 97 | ); |
90 | 98 | } |
91 | 99 | } |
|
0 commit comments