Skip to content

Commit

Permalink
💄fix clone ui to fit myapp
Browse files Browse the repository at this point in the history
  • Loading branch information
TarradeMarc committed Jul 4, 2024
1 parent 32281f2 commit a4d7066
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions clone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN npm install express
RUN npm install body-parser
RUN npm install cookie-parser
ADD myapp.js /usr/app/myapp.js
ADD files/script.js /usr/app/files/script.js
USER nobody
EXPOSE 2000
CMD [ "node", "myapp.js" ]
22 changes: 22 additions & 0 deletions clone/files/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
document.addEventListener('DOMContentLoaded', function() {
const welcomeText = document.querySelector('.full-width');

welcomeText.addEventListener('mouseover', function(event) {
const target = event.target;
if (target.classList.contains('letter')) {
target.style.color = 'red'; // Change the color of the letter hovered over
} else {
welcomeText.style.color = 'red'; // Change the color of the whole text
}
});

welcomeText.addEventListener('mouseout', function(event) {
const target = event.target;
if (target.classList.contains('letter')) {
target.style.color = ''; // Reset the color of the letter
} else {
welcomeText.style.color = ''; // Reset the color of the whole text
}
});
});

5 changes: 4 additions & 1 deletion clone/myapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ app.use((req, res, next) => {
})

const homepage=`
<div class="full-width">CLONE</div>
<div class="full-width">
${'CLONE'.split('').map(letter => `<span class="letter">${letter}</span>`).join('')}
</div>
<div align="center"><button type="button" onclick="window.location.href='/login'">Login</button></div>
<script src="/script.js"></script>
`

const css = `
Expand Down

0 comments on commit a4d7066

Please sign in to comment.