sanjeevarasa-satkunarasa / realfag.net

A website that uses OCR to help students find their questions
https://realfag.net/
1 stars 0 forks source link

Dark Mode #2

Closed sanjeevarasa-satkunarasa closed 4 months ago

sanjeevarasa-satkunarasa commented 5 months ago

On the main branch I have tried to make a button that changes the background color to a dark color, but only seem to affect the body not the nav.

purplehippo911 commented 5 months ago

Where's the code? :)

sanjeevarasa-satkunarasa commented 5 months ago

The code is on index.html and under the script folder, i think that @Artur8090 might have fixed the program but Im not sure

sanjeevarasa-satkunarasa commented 4 months ago

@Artur8090 the 010e1568706a534a7120d780d790f18511904613 commit does not fix the problem

smileysunshinesky commented 4 months ago

You need to create two CSS files. One for light mode styling and another for dark mode styling. Add toggle button to switch between light mode and dark mode.

Here is in in index.html file. <link rel="stylesheet" href="styles.css" id="theme-style">

<button onclick="toggleMode()">Toggle Dark Mode</button>

Here is JavaScript (dark-mode-script.js):

function toggleMode() {
  var themeStyle = document.getElementById("theme-style");
  if (themeStyle.getAttribute("href") === "styles.css") {
    themeStyle.href = "styles-dark.css";
  } else {
    themeStyle.href = "styles.css";
  }
}
sanjeevarasa-satkunarasa commented 4 months ago

You need to create two CSS files. One for light mode styling and another for dark mode styling. Add toggle button to switch between light mode and dark mode.

Here is in in index.html file. <link rel="stylesheet" href="styles.css" id="theme-style">

<button onclick="toggleMode()">Toggle Dark Mode</button>

Here is JavaScript (dark-mode-script.js):

function toggleMode() {
  var themeStyle = document.getElementById("theme-style");
  if (themeStyle.getAttribute("href") === "styles.css") {
    themeStyle.href = "styles-dark.css";
  } else {
    themeStyle.href = "styles.css";
  }
}

I cant seem to implement it into the program and having it function

smileysunshinesky commented 4 months ago

I haven't implemented it in your project. That's just my solution. Want to implement this in your project?

sanjeevarasa-satkunarasa commented 4 months ago

I haven't implemented it in your project. That's just my solution.

Want to implement this in your project?

Ye

smileysunshinesky commented 4 months ago

I fixed it. Can I contribute to this project?

sanjeevarasa-satkunarasa commented 4 months ago

I fixed it. Can I contribute to this project?

Ye why not, but you just have to tell us what ur going to before doing as it is a school project.

smileysunshinesky commented 4 months ago

Wow, that's really interesting. I have ample experience in developing school management systems. I can do anything according to your requirements. I have one example of my previous work. Please check it. https://drive.google.com/drive/folders/1WLc1aXWNZJi7Lko7tD4lMbzfxDIla9KD

smileysunshinesky commented 4 months ago

I've already merged, so you can check after git pull