aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
blob: dbe46d01460758c36aeacf6d7d1b8b91e7d72b59 (plain) (blame)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
session_start(); ?>
<!DOCTYPE html>
<html lang=en>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv='cache-control' content='no-cache'>
    <meta http-equiv='expires' content='0'>
    <meta http-equiv='pragma' content='no-cache'>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>procrastiSlides: great for procratinators who need to get a presentation out, quick! 😆</title>
    <meta name="description" content="create .pdf presentations from markdown! 🤗 procrastiSlides is a simple presentation(s) site that respects your dark mode setting and has responsive web design.
         non-intruisive ads, no tracking, nothing but quick slides from plain text/markdown. 🏫 try copy and pasting your school notes! that might even work 😂">
    <?php include "includes/link-tags-in-head.php"; ?>
    <meta name="color-scheme" content="light dark">
</head>

<body>
    <?php
    include "includes/procrastislides-banner.php";
    include "includes/main-info.php";
    include "includes/nav-header.php";
    ?>
    <?php if (isset($_POST["compile"])) {
        $_SESSION["user-input"] = $_POST["user-input"]; ?>
        <div class="centered">
            <h3>🎨 please select your presentation theme 🎭</h3>
            <form action="download.php" method="post" onsubmit="showGeneratingIndicator()">
                <table class="centered">
                    <thead>
                        <tr>
                            <th>
                                <h2>preview</h2>
                            </th>
                            <th>
                                <h2>select</h2>
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $themes = [
                            '90sMakeUpCommercial' => '90sMakeUpCommercial',
                            'chicagoOlives' => 'chicagoOlives',
                            'earlyCupertino' => 'earlyCupertino',
                            'ohioCustard' => 'ohioCustard',
                            'raleighAroundMe' => 'raleighAroundMe',
                            'redmond2013' => 'redmond2013',
                            'defaultIsKing' => 'defaultIsKing',
                            'cuppertinoIsh' => 'cuppertinoIsh',
                            'lazyProfessor' => 'lazyProfessor',
                            'redmond2003' => 'redmond2003',
                            'strengthInNumbers' => 'strengthInNumbers',
                            'thatMagazine' => 'thatMagazine',
                        ];

                        foreach ($themes as $key => $theme) {
                            echo "<tr>
                            <td>
                                <img loading='lazy' class='theme-select' src='img/{$key}.webp' alt='{$theme}'>
                            </td>
                            <td>
                                <button type='submit' name='{$key}'>{$theme}</button>
                            </td>
                          </tr>";
                        }
                        ?>
                    </tbody>
                </table>
                <div id="generating-indicator" style="display: none;">
                    <p>📊</p>
                    <p>generating presentation...</p>
                    <p>please wait.</p>
                </div>
            </form>
        </div>
        <br>
    <?php } else { ?>
        <div>
            <label for="user-input">
                <h2 class="centered">markdown goes here:</h2>
            </label>
            <form action="index.php" method="post">
                <textarea id="user-input" name="user-input" rows="8" cols="80"><?php echo $_SESSION['user-input'] ?? ''; ?></textarea>
                <div class="centered">
                    <button type="submit" name="compile">create presentation</button>
                </div>
            </form>
            <br><br>
            <details>
                <summary style="font-size: 1.125rem;"><strong>← expand for a brief <emphasis>"how-to"</emphasis> 📖</strong></summary>
                <p>
                <ul>
                    <li>type '#' to indicate that you are starting a new slide and then press ↵ (enter/return) twice.</li>
                    <li>you can add a "slide title" after each '#' to name that portion of your presentation.</li>
                    <ul>
                        <li>a space between "#" and your slide title is required: <br><br> </li>
                        <ul class="no-bullets">
                            <li># [YOUR TITLE GOES HERE]</li>
                        </ul>
                        <br>
                    </ul>
                    <li>type/format text underneath the '#' for the slide contents.</li>
                    <ul>
                        <li>make sure to start typing your slide content two ↵'s ("enter key presses") away from the "#".</li>
                        <li>lists require to be formatted in this manner as well: <br><br> </li>
                        <ul class="no-bullets">
                            <li># slide title <br><br>
                                This is a list <br><br>
                                * item 1 <br>
                                * item 2 <br>
                                * item 3 <br>
                            </li>
                        </ul>
                    </ul>
                </ul>
                <br>
                <p class="centered"> <i>It's highly recommended that you use markdown lists rather than plain text lists</i> </p><br>
                </p>
            </details>
            <br>
            <details>
                <summary style="font-size: 1.125rem;"><strong>← expand for a quick video demo 🎬</strong></summary>
                <p>
                    <video controls>
                        <source src="vids/A4upxlH2mIHOXYRq.webm" type="video/webm">
                        <source src="vids/A4upxlH2mIHOXYRq.ogg" type="video/ogg">
                        <source src="vids/A4upxlH2mIHOXYRq.mp4" type="video/mp4">
                        Your browser does not support modern open-source video implementations 😔.
                    </video>
                </p>
            </details>
            <br>
        </div>
    <?php } ?>
    <br>
    <footer>
        <?php include "includes/nav-footer.php"; ?>
    </footer>
    <script type="text/javascript">
        function showGeneratingIndicator() {
            const generatingIndicator = document.getElementById('generating-indicator');
            generatingIndicator.style.display = 'block';
        }
    </script>
    <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
    <script type="text/javascript">
        var simplemde = new SimpleMDE({
            element: document.getElementById("user-input")
        });
    </script>
</body>

</html>