Skip to content

Commit

Permalink
Merge branch 'dark-theme' of https://github.com/VladlenaCravcenco/ermac
Browse files Browse the repository at this point in the history
… into VladlenaCravcenco-dark-theme
  • Loading branch information
blokhin committed Apr 28, 2024
2 parents 24c1249 + 91d754e commit a35e573
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 79 deletions.
Binary file added .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion example_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<link rel="stylesheet" type="text/css" href="webassets/ermac.css" />
</head>
<body>



<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>
<script type="text/javascript">
// a very simple env loader
var to_load = [
Expand Down Expand Up @@ -39,5 +41,6 @@
head.appendChild(script);
}
</script>
<script src="./script.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions example_prod.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<link rel="stylesheet" type="text/css" href="webassets/ermac.css" />
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>
<script src="./script.js"></script>

<script type="text/javascript" src="ermac.min.js"></script>
</body>
Expand Down
Binary file added labs/.DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const options = {

top: '64px', // default: '32px'
right: 'unset', // default: '32px'
left: '32px', // default: 'unset'
time: '0.3s', // default: '0.3s'
mixColor: '#fff', // default: '#fff'
backgroundColor: '#fff', // default: '#fff'
buttonColorDark: '#100f2c', // default: '#100f2c'
buttonColorLight: '#fff', // default: '#fff'
saveInCookies: true, // default: true,
label: '🌓', // default: ''
autoMatchOsTheme: true // default: true

}

const darkmode = new Darkmode(options);
darkmode.showWidget();

Loading

0 comments on commit a35e573

Please sign in to comment.