-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (110 loc) · 4.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html>
<head>
<title>MemeCards - Meeting cards for your physical, digital, virtual meetings</title>
<meta name="author" content="Emre Piskin">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="index.css">
<link rel="manifest" href="./manifest.webmanifest">
<link rel="shortcut icon" type="image/png" href="favicon.png"/>
</head>
<body>
<div id="app"></div>
<script src="vendor/babel.min.js"></script>
<script src="vendor/react.production.min.js"></script>
<script src="vendor/react-dom.production.min.js"></script>
<!--<script src="https://unpkg.com/[email protected]/babel.min.js"></script>-->
<!--<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>-->
<!--<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>-->
<script type="text/babel" src="components/Card.js"></script>
<script type="text/babel" src="components/GitHubLinks.js"></script>
<script type="text/babel" src="components/Image.js"></script>
<script type="text/babel" src="components/Text.js"></script>
<script type="text/babel" src="hooks/useFullscreenStatus.js"></script>
<script src="cards.js"></script>
<script>
// Check that service workers are supported
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
navigator.serviceWorker.register('./service-worker.js');
});
}
</script>
<script type="text/babel">
const App = () => {
// <editor-fold desc="Fullscreen">
// @see https://github.com/Darth-Knoppix/example-react-fullscreen/blob/master/src/MaximizableView.js
const maximizableElement = React.useRef(null);
let isFullscreen, setIsFullscreen;
let errorMessage;
try {
[isFullscreen, setIsFullscreen] = useFullscreenStatus(maximizableElement);
} catch (e) {
errorMessage = '⚠️ Fullscreen is not supported on this browser';
isFullscreen = false;
setIsFullscreen = () => {};
}
const enterFullscreen = (cardName) => {
setIsFullscreen();
setCardToShow(cardName);
};
const exitFullscreen = () => {
setCardToShow('');
document.exitFullscreen();
};
// </editor-fold>
const [cardToShow, setCardToShow] = React.useState('');
const CardList = () => {
return (
<React.Fragment>
<div id="header">
MemeCards
</div>
<div id="subheader">
Meeting cards for your physical, digital, virtual meetings. No need to print,
just use your mobile device and click on a card!
<GitHubLinks />
</div>
<div className="notification">Add it to home screen:
<a href="https://www.wikihow.tech/Add-a-Link-Button-to-the-Home-Screen-of-an-iPhone">iOS</a>
<a href="https://www.wikihow.com/Set-a-Bookmark-Shortcut-in-Your-Home-Screen-on-Android">Android</a>
</div>
<div className="notification">{errorMessage}</div>
<div className="notification warning-portrait">⚠️ This app works best on portrait screen 📲</div>
<div className="row">
{cards.map((card) =>
<Card {...card} key={card.name} onClickHandler={enterFullscreen} />)
}
</div>
</React.Fragment>
)
};
const CardFullscreen = (card) => {
return (
<div
className="card-fullscreen-wrapper"
onClick={exitFullscreen}
>
<Card {...card} multiplier={4} />
</div>
)
};
return (
<div ref={maximizableElement} style={{height: '100%'}}>
{cardToShow
? <CardFullscreen {...cards.find(({name}) => name === cardToShow)} />
: <CardList />
}
</div>
)
};
ReactDOM.render(<App/>, document.querySelector('#app'));
</script>
</body>
</html>