|
7 | 7 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
9 | 9 | <link rel="icon" type="image/x-icon" href="/github-wallpapers/static/favicons/favicon.ico"> |
10 | | - <link rel="stylesheet" href="styles/styles.css"> |
| 10 | + <link rel="stylesheet" href="styles/buttons.css"> |
11 | 11 | <link rel="stylesheet" href="styles/loader.css"> |
| 12 | + <link rel="stylesheet" href="styles/styles.css"> |
12 | 13 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |
13 | 14 | </head> |
14 | 15 |
|
15 | 16 | <body> |
16 | 17 |
|
17 | | - <div class="home-button-container"> |
| 18 | + <!--Buttons--> |
| 19 | + <div class="button-container"> |
18 | 20 | <a class="button" href="https://github.com/Lucaffo/github-wallpapers"> |
19 | 21 | <i class="fa fa-github"></i> |
20 | 22 | </a> |
21 | 23 | <a class="button" href="https://github.com/Lucaffo/github-wallpapers/blob/main/docs/documentation.md"> |
22 | 24 | <i class="fa fa-book"></i> |
23 | 25 | </a> |
24 | | - </div> |
25 | | - |
26 | | - <div class="save-button-container"> |
27 | 26 | <button class="button" id="save-btn">Save</button> |
28 | 27 | </div> |
29 | 28 |
|
| 29 | + <!--Main app container--> |
30 | 30 | <div class="container"> |
| 31 | + |
| 32 | + <!--Editor--> |
31 | 33 | <div class="codemirror-container" id="input"></div> |
| 34 | + |
| 35 | + <!--Handle--> |
32 | 36 | <div class="handle" id="resize-handle"></div> |
| 37 | + |
| 38 | + <!--Canvas--> |
33 | 39 | <div class="canvas-container"> |
34 | 40 | <div id="loading-panel" class="loading-panel"> |
35 | 41 | <div class="loader"></div> |
|
38 | 44 | <canvas id="output" width="1920" height="1080"></canvas> |
39 | 45 | </div> |
40 | 46 | </div> |
41 | | - <script> |
42 | | - const handle = document.getElementById("resize-handle"); |
43 | | - const textarea = document.getElementById("input"); |
44 | | - const canvasContainer = document.querySelector(".canvas-container"); |
45 | | - const canvas = document.getElementById("output"); |
46 | | - |
47 | | - let isResizing = false; |
48 | | - |
49 | | - handle.addEventListener("mousedown", (e) => { |
50 | | - isResizing = true; |
51 | | - document.addEventListener("mousemove", onMouseMove); |
52 | | - document.addEventListener("mouseup", () => { |
53 | | - isResizing = false; |
54 | | - document.removeEventListener("mousemove", onMouseMove); |
55 | | - }); |
56 | | - }); |
57 | | - |
58 | | - function onMouseMove(e) { |
59 | | - if (!isResizing) return; |
60 | | - let newWidth = e.clientX; |
61 | | - textarea.style.flex = `0 0 ${newWidth}px`; |
62 | | - canvasContainer.style.flex = `1`; |
63 | | - } |
64 | | - </script> |
| 47 | + |
| 48 | + <!--Resize containers script--> |
| 49 | + <script src="scripts/handleContainerResize.js"></script> |
65 | 50 |
|
66 | 51 | <!--Startup Code Mirror 5--> |
67 | 52 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css"> |
|
0 commit comments