ricoramiro2

change2DarkTheme

Mar 8th, 2022
670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.88 KB | None | 0 0
  1.  
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5.     <head>
  6.         <meta name='viewport' content='width=device-width, initial-scale=1'>
  7.         <title>html Editor</title>
  8.     </head>
  9.     <body>
  10.         <div class='logo'>
  11.             <b>
  12.                 <span class='brackets left'><</span>
  13.                 <span>html</span>
  14.                 <span class='brackets right'>></span>
  15.             </b>
  16.             Editor
  17.         </div>
  18.  
  19.         <p class='sample'>This is the simple example of how HTML Editor works. You can change the code if you want.</p>
  20.        
  21.         <button id='button' onClick='changeTheme()'>Reeks Too Kool Dark Theme</button>
  22.  
  23.  
  24. <style>
  25. @import url('https://fonts.googleapis.com/css?family=&display=swap');
  26. @import url('https://fonts.googleapis.com/css2?family=Advent+Pro&display=swap');
  27.  
  28. html, button{
  29.     font-family: Quicksand, sans-serif;
  30. }
  31.  
  32. body{
  33.     background: white;
  34.     color:#555;
  35.     text-align: center;
  36. }
  37.  
  38. .logo{
  39.     margin-top:30%;
  40.     font-size:30px;
  41.     font-weight:normal;
  42. }
  43.  
  44. .brackets{
  45.     font-family: Advent Pro, sans-serif;
  46. }
  47.  
  48. .left{
  49.     color:tomato;
  50. }
  51.  
  52. .right{
  53.     color:dodgerblue;
  54. }
  55.  
  56. .sample{
  57.     padding:20px;
  58.     font-size:18px;
  59.     background: inherit;
  60.     color:inherit;
  61. }
  62.  
  63. #button{
  64.     margin-top:10px;
  65.     background:dodgerblue;
  66.     color:white;
  67.     width:80%;
  68.     height:60px;
  69.     font-size: 20px;
  70.     outline: none;
  71.     border:5px solid deepskyblue;
  72.     border-radius: 5px;
  73. }
  74.  
  75. #button:active{
  76.     transform: scale(0.95);
  77. }
  78.        
  79. </style>
  80.  
  81. <script>
  82. function changeTheme(){
  83.     if(document.getElementById('button').innerHTML==='Dark Theme'){
  84.         document.body.style.background='#074b83';
  85.         document.body.style.color='#aaa';
  86.         document.getElementById('button').innerHTML='Light Theme';
  87.     }
  88.     else{
  89.         document.body.style.background='#06233a';
  90.         document.body.style.color='#074b83';
  91.         document.getElementById('button').innerHTML='Dark Theme';
  92.     }
  93. }
  94.        
  95. </script>
  96.  
  97.  
  98. </body>
  99. </html>
  100.  
  101.        
Advertisement
Add Comment
Please, Sign In to add comment