Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"type": "subscription",
"url": "hhttps://coreui.io/pricing/?framework=bootstrap"
"url": "https://coreui.io/pricing/?framework=bootstrap"
}
],
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/js/color-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' || storedTheme !== 'dark') {
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
Expand Down
1 change: 0 additions & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Chart.defaults.plugins.tooltip.enabled = false
Chart.defaults.plugins.tooltip.mode = 'index'
Chart.defaults.plugins.tooltip.position = 'nearest'
Chart.defaults.plugins.tooltip.external = coreui.ChartJS.customTooltips
Chart.defaults.defaultFontColor = coreui.Utils.getStyle('--cui-body-color')

document.documentElement.addEventListener('ColorSchemeChange', () => {
cardChart1.data.datasets[0].pointBackgroundColor = coreui.Utils.getStyle('--cui-primary')
Expand Down
1 change: 0 additions & 1 deletion src/js/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Chart.defaults.plugins.tooltip.enabled = false
Chart.defaults.plugins.tooltip.mode = 'index'
Chart.defaults.plugins.tooltip.position = 'nearest'
Chart.defaults.plugins.tooltip.external = coreui.ChartJS.customTooltips
Chart.defaults.defaultFontColor = coreui.Utils.getStyle('--cui-body-color')

document.documentElement.addEventListener('ColorSchemeChange', () => {
cardChart1.data.datasets[0].pointBackgroundColor = coreui.Utils.getStyle('--cui-primary')
Expand Down
2 changes: 0 additions & 2 deletions src/views/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ <h4 class="pt-3">Oops! You're lost.</h4>
});

</script>
<script>
</script>
</body>
</html>
2 changes: 0 additions & 2 deletions src/views/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,5 @@ <h4 class="pt-3">Houston, we have a problem!</h4>
});

</script>
<script>
</script>
</body>
</html>
28 changes: 25 additions & 3 deletions src/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ <h1>Login</h1>
</div>
<div class="row">
<div class="col-6">
<button class="btn btn-primary px-4" type="button">Login</button>
<button class="btn btn-primary px-4" type="button" id="loginBtn">
<span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
<span class="btn-text">Login</span>
</button>
</div>
<div class="col-6 text-end">
<button class="btn btn-link px-0" type="button">Forgot password?</button>
Expand Down Expand Up @@ -101,9 +104,28 @@ <h2>Sign up</h2>
header.classList.toggle('shadow-sm', document.documentElement.scrollTop > 0);
}
});

// Login button loading state example
const loginBtn = document.getElementById('loginBtn');
if (loginBtn) {
loginBtn.addEventListener('click', function() {
const spinner = this.querySelector('.spinner-border');
const btnText = this.querySelector('.btn-text');

// Show loading state
spinner.classList.remove('d-none');
btnText.textContent = 'Logging in...';
this.disabled = true;

// Simulate API call (remove this in production)
setTimeout(() => {
spinner.classList.add('d-none');
btnText.textContent = 'Login';
this.disabled = false;
}, 2000);
});
}

</script>
<script>
</script>
</body>
</html>
28 changes: 25 additions & 3 deletions src/views/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ <h1>Register</h1>
</svg></span>
<input class="form-control" type="password" placeholder="Repeat password">
</div>
<button class="btn btn-block btn-success" type="button">Create Account</button>
<button class="btn btn-block btn-success" type="button" id="registerBtn">
<span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>
<span class="btn-text">Create Account</span>
</button>
</div>
</div>
</div>
Expand All @@ -96,9 +99,28 @@ <h1>Register</h1>
header.classList.toggle('shadow-sm', document.documentElement.scrollTop > 0);
}
});

// Register button loading state example
const registerBtn = document.getElementById('registerBtn');
if (registerBtn) {
registerBtn.addEventListener('click', function() {
const spinner = this.querySelector('.spinner-border');
const btnText = this.querySelector('.btn-text');

// Show loading state
spinner.classList.remove('d-none');
btnText.textContent = 'Creating Account...';
this.disabled = true;

// Simulate API call (remove this in production)
setTimeout(() => {
spinner.classList.add('d-none');
btnText.textContent = 'Create Account';
this.disabled = false;
}, 2000);
});
}

</script>
<script>
</script>
</body>
</html>