Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
william-maillard committed Sep 25, 2023
1 parent 5c9ed05 commit fb04938
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 16 deletions.
Binary file modified Dessin-1.0.jar
Binary file not shown.
30 changes: 15 additions & 15 deletions Dessin-1.0.jar.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f0f0f0;

background-image: url(../img/bacground.jpg);
background-size: 100vw 100vh;
background-repeat: repeat-x;
}

#cheerpjDisplay {
background-color: rgba(255, 255, 255, 0.5);
color: #fff;
padding: 20px;
position: absolute;
border-radius: 20px;
border: none;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.5);;
}
Binary file added assets/img/bacground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/favicon.ico
Binary file not shown.
Binary file added assets/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions assets/js/center_element.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Get the element
function center(id) {
const element = document.getElementById(id);

// Get the width and height of the element
const elementWidth = element.offsetWidth;
const elementHeight = element.offsetHeight;

// Calculate the center of the window
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const centerX = (windowWidth - elementWidth) / 2;
const centerY = (windowHeight - elementHeight) / 2;

// Set the element's position to be centered
element.style.left = `${centerX}px`;
element.style.top = `${centerY}px`;
}


center('cheerpjDisplay')
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

<head>
<meta charset="utf-8" />
<title>CheerpJ test</title>
<title>Drawing App</title>
<script src="https://cjrtnc.leaningtech.com/2.3/loader.js"></script>
<link rel="shortcut icon" href="/drawing_app/assets/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/drawing_app/assets/css/main.css">
</head>

<body></body>
Expand Down

0 comments on commit fb04938

Please sign in to comment.