This repository was archived by the owner on Feb 4, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22< html lang ="en ">
33 < head >
44 < meta charset ="utf-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
56 < title > Minesheeper</ title >
67 < link rel ="stylesheet " href ="%PUBLIC_URL%/style.css " />
78 < link
Original file line number Diff line number Diff line change 1717body {
1818 background-color : darkgrey;
1919}
20+ .pMobile {
21+ font-size : 18px ;
22+ }
2023# bgForColor {
2124 min-height : calc (100% - 15px );
2225 width : 100% ;
@@ -31,14 +34,20 @@ body {
3134 text-shadow : -1px 1px 0px black, 1px 1px 0px black, 1px -1px 0px black,
3235 -1px -1px 0px black;
3336}
34- # displayTitle {
37+ . displayTitle {
3538 font-family : fontTitle;
36- font-size : 24pt ;
37- margin-bottom : 15px ;
3839 color : white;
3940 text-shadow : -1px 1px 1px black, 1px 1px 1px black, 1px -1px 1px black,
4041 -1px -1px 1px black;
4142}
43+ # displayTitleDesktop {
44+ font-size : 24pt ;
45+ margin-bottom : 15px ;
46+ }
47+ # displayTitleMobile {
48+ font-size : 32px ;
49+ padding-top : 15px ;
50+ }
4251* {
4352 vertical-align : middle;
4453 font-family : arial;
@@ -68,6 +77,19 @@ button > div,
6877 left : 0 ;
6978 position : absolute;
7079}
80+ .buttonMobile {
81+ font-size : 30px ;
82+ border : none;
83+ }
84+ .buttonMobile : active {
85+ font-size : 24px ;
86+ }
87+ .buttonMobile ,
88+ .buttonMobile : active {
89+ background-color : transparent;
90+ -webkit-tap-highlight-color : transparent;
91+ outline : none;
92+ }
7193.back {
7294 opacity : 75% ;
7395}
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ class Minefield extends React.Component {
5757 return true ;
5858 }
5959 render ( ) {
60- const final = this . buildUI ( ) ;
60+ const isMobile = / A n d r o i d | w e b O S | i P h o n e | i P a d | M a c | M a c i n t o s h | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ;
61+ const final = isMobile ? this . buildMobileBanner ( ) : this . buildUI ( ) ;
6162 return final ;
6263 }
6364 componentDidUpdate ( ) {
@@ -108,7 +109,7 @@ class Minefield extends React.Component {
108109 width : ( this . props . size [ 1 ] * this . props . buttonWidth ) + this . props . buttonWidthUnit
109110 } }
110111 >
111- < div id = "displayTitle" > Minesheeper</ div >
112+ < div className = "displayTitle" id = "displayTitleDesktop "> Minesheeper</ div >
112113 < div
113114 id = "gameHeader"
114115 style = { {
@@ -228,6 +229,63 @@ class Minefield extends React.Component {
228229 // Return
229230 return final ;
230231 } ;
232+ buildMobileBanner = ( ) => {
233+ const final = < div >
234+ < div
235+ className = "displayTitle"
236+ id = "displayTitleMobile"
237+ style = { {
238+ backgroundColor : this . state . cBg ,
239+ position : "absolute" ,
240+ height : "calc(100% - 15px)" ,
241+ width : "100%"
242+ } }
243+ >
244+ Minesheeper
245+ </ div >
246+ < div
247+ style = { {
248+ position : "absolute" ,
249+ top : "50px" ,
250+ margin : "30px"
251+ } }
252+ >
253+ < p className = "pMobile" > Come back on a desktop or laptop computer to herd some sheep.</ p >
254+ < br />
255+ < button
256+ className = "buttonMobile"
257+ >
258+ 🐑
259+ </ button >
260+ </ div >
261+ < div
262+ style = { {
263+ position : "absolute" ,
264+ width : "100%" ,
265+ bottom : "5vh"
266+ } }
267+ >
268+ < a
269+ href = "https://github.com/cadnza/mineSheeper"
270+ target = "_blank"
271+ rel = "noreferrer"
272+ style = { {
273+ color : this . state . cFg ,
274+ textAlign : "center"
275+ } }
276+ >
277+ < p
278+ id = "copyright"
279+ style = { {
280+ color : "inherit" ,
281+ textAlign : "inherit"
282+ } }
283+ />
284+ </ a >
285+ </ div >
286+ </ div > ;
287+ return final ;
288+ } ;
231289 resetGameProperties = ( ) => {
232290 // Reset game state parameters
233291 this . setState ( {
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ import ReactDOM from "react-dom";
33
44import Controller from "./Controller.js" ;
55
6+ document . addEventListener ( "touchstart" , ( ) => true ) ; // To enable active button styling on mobile
7+
68ReactDOM . render ( < Controller /> , document . getElementById ( "game" ) ) ;
You can’t perform that action at this time.
0 commit comments