| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <!DOCTYPE html>
- <html lang="en">
-
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Canvas App</title>
- <style>
- body {
- margin: 0;
- height: 100vh;
- background: #e0e0e0;
- font-family: Arial, sans-serif;
- overflow: hidden;
- position: relative;
- }
-
- .canvas-container {
- height: 100vh;
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 20px;
- box-sizing: border-box;
- }
-
- canvas {
- background: #ffffff;
- box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
- border-radius: 8px;
- max-width: 100%;
- max-height: 100%;
- }
-
- /* Burger Menu Button */
- .menu-button {
- position: absolute;
- top: 20px;
- right: 20px;
- width: 50px;
- height: 50px;
- background: white;
- border: none;
- border-radius: 50%;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- cursor: pointer;
- z-index: 100;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28px;
- color: #333;
- }
-
- /* Drawer */
- .drawer {
- position: absolute;
- top: 0;
- right: -500px;
- /* Fully hidden when closed */
- width: 300px;
- height: 100vh;
- background: white;
- box-shadow: -6px 0 25px rgba(0, 0, 0, 0.18);
- transition: right 0.35s cubic-bezier(0.32, 0.72, 0, 1);
- padding: 20px 24px;
- z-index: 200;
- overflow-y: auto;
- }
-
- .drawer.open {
- right: 0;
- }
-
- .drawer-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24px;
- }
-
- .drawer h2 {
- margin: 0;
- color: #222;
- }
-
- .close-button {
- background: none;
- border: none;
- font-size: 28px;
- color: #666;
- cursor: pointer;
- width: 40px;
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 50%;
- }
-
- .close-button:hover {
- background: #f0f0f0;
- color: #333;
- }
-
- .control {
- margin-bottom: 28px;
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
-
- label {
- font-weight: 600;
- color: #333;
- }
-
- input[type="color"] {
- width: 80px;
- height: 60px;
- padding: 4px;
- border: 2px solid #ddd;
- border-radius: 8px;
- cursor: pointer;
- }
-
- input[type="range"] {
- width: 100%;
- accent-color: #0066ff;
- }
-
- .value {
- font-family: monospace;
- background: #f5f5f5;
- padding: 6px 12px;
- border-radius: 6px;
- align-self: flex-start;
- font-weight: bold;
- }
- </style>
- </head>
-
- <body>
- <!-- Canvas Area -->
- <div class="canvas-container">
- <canvas id="canvas" width="450" height="450"></canvas>
- </div>
-
- <!-- Burger Menu Button -->
- <button class="menu-button" id="menuButton">☰</button>
-
- <!-- Sliding Drawer -->
- <div class="drawer" id="drawer">
- <div class="drawer-header">
- <h2>Brush Settings</h2>
- <button class="close-button" id="closeButton">×</button>
- </div>
-
- <!-- Color Picker -->
- <div class="control">
- <label for="colorPicker">Color</label>
- <input type="color" id="colorPicker" value="#eaafff">
- </div>
-
- <!-- density -->
- <div class="control">
- <label for="densitySlider">Smoothness</label>
- <input type="range" id="densitySlider" min="1" max="50" value="35">
- <span id="densityValue" class="value">35</span>
- </div>
-
- <!-- width -->
- <div class="control">
- <label for="widthSlider">Width</label>
- <input type="range" id="widthSlider" min="1" max="50" value="35">
- <span id="widthValue" class="value">35</span>
- </div>
- </div>
-
- <script type="module" src="main.js"></script>
- </body>
-
- </html>
|