Skip to content

New logo, dark mode on landing page #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2024
Merged
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<p align="center">
<img src ="https://raw.githubusercontent.com/json-api-dotnet/JsonApiDotNetCore/master/logo.png" />
</p>
<a href="https://www.jsonapi.net"><img src="docs/home/assets/img/logo.svg" style="height: 345px; width: 345px"/></a>

# JsonApiDotNetCore
A framework for building [JSON:API](http://jsonapi.org/) compliant REST APIs using .NET Core and Entity Framework Core. Includes support for [Atomic Operations](https://jsonapi.org/ext/atomic/).
Expand Down
16 changes: 16 additions & 0 deletions docs/home/assets/dark-mode.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
html {
background-color: #171717 !important;
filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%);
-webkit-filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%);
}

body {
background-color: #FFF !important;
}

img,
video,
body * [style*="background-image"] {
filter: hue-rotate(180deg) contrast(100%) invert(100%);
-webkit-filter: hue-rotate(180deg) contrast(100%) invert(100%);
}
8 changes: 8 additions & 0 deletions docs/home/assets/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -603,3 +603,11 @@ div[sponsor]:hover {
padding: 3px 0;
}
}

/*--------------------------------------------------------------
# Theme selection
--------------------------------------------------------------*/
.btn-theme:focus,
.btn-theme:active {
box-shadow: none !important;
}
29 changes: 29 additions & 0 deletions docs/home/assets/home.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
function setTheme(theme) {
const darkModeStyleSheet = document.getElementById('dark-mode-style-sheet');
const activeTheme = document.getElementById('active-theme');

if (theme === "auto") {
darkModeStyleSheet.disabled = !window.matchMedia("(prefers-color-scheme: dark)").matches;
activeTheme.className = "bi-circle-half";
}
else if (theme === "dark") {
darkModeStyleSheet.disabled = false;
activeTheme.className = "bi bi-moon";
} else if (theme === "light") {
darkModeStyleSheet.disabled = true;
activeTheme.className = "bi bi-sun";
}

localStorage.setItem("theme", theme)
}

$('.theme-choice').click(function () {
setTheme(this.dataset.theme);
})

function initTheme() {
const theme = localStorage.getItem("theme") || "auto";
setTheme(theme);
}

!(function($) {
"use strict";

Expand Down Expand Up @@ -89,6 +117,7 @@
}
$(window).on('load', function() {
aos_init();
initTheme();
});

})(jQuery);
Binary file modified docs/home/assets/img/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/home/assets/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/home/assets/img/logo.png
Binary file not shown.
163 changes: 163 additions & 0 deletions docs/home/assets/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 29 additions & 1 deletion docs/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,41 @@
<link href="favicon.ico" rel="apple-touch-icon">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
<link href="https://unpkg.com/[email protected]/css/boxicons.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.4.0/styles/default.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.css" rel="stylesheet">
<link href="styles/home.css" rel="stylesheet">
<link href="styles/icofont.min.css" rel="stylesheet">
<link href="styles/dark-mode.css" rel="stylesheet" id="dark-mode-style-sheet" disabled>
<script>
// Running this early to prevent an initial white flash on page load when dark mode is the default theme.
const darkModeStyleSheet = document.getElementById('dark-mode-style-sheet');
const theme = localStorage.getItem("theme") || "auto";

if (theme === "auto") {
darkModeStyleSheet.disabled = !window.matchMedia("(prefers-color-scheme: dark)").matches;
}
else if (theme === "dark") {
darkModeStyleSheet.disabled = false;
} else if (theme === "light") {
darkModeStyleSheet.disabled = true;
}
</script>
</head>
<body>
<div class="container-xl">
<div class="dropdown p-3 float-right">
<a class="btn btn-theme dropdown-toggle" href="#" role="button" id="themeSelector" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i id="active-theme"></i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="themeSelector">
<a class="dropdown-item theme-choice" data-theme="light" href="#"><i class="bi bi-sun"></i> Light</a>
<a class="dropdown-item theme-choice" data-theme="dark" href="#"><i class="bi bi-moon"></i> Dark</a>
<a class="dropdown-item theme-choice" data-theme="auto" href="#"><i class="bi-circle-half"></i> Auto</a>
</div>
</div>
</div>
<section id="hero" class="d-flex align-items-center">
<div class="container">
<div class="row">
Expand All @@ -31,7 +59,7 @@ <h2>
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/" target="_blank" class="btn-get-started">Contribute on GitHub</a>
</div>
<div class="col-lg-5 order-1 order-lg-2 hero-img">
<img src="styles/img/logo.png" class="img-fluid animated" alt="project logo">
<img src="styles/img/logo.svg" class="img-fluid animated" alt="project logo">
</div>
</div>
</div>
Expand Down
Binary file removed logo.png
Binary file not shown.
Binary file added package-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>See https://github.com/json-api-dotnet/JsonApiDotNetCore/releases.</PackageReleaseNotes>
<PackageIcon>logo.png</PackageIcon>
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>PackageReadme.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\logo.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\package-icon.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\PackageReadme.md" Visible="false" Pack="True" PackagePath="" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>See https://github.com/json-api-dotnet/JsonApiDotNetCore/releases.</PackageReleaseNotes>
<PackageIcon>logo.png</PackageIcon>
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>PackageReadme.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/json-api-dotnet/JsonApiDotNetCore</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\logo.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\package-icon.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\PackageReadme.md" Visible="false" Pack="True" PackagePath="" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>See https://github.com/json-api-dotnet/JsonApiDotNetCore/releases.</PackageReleaseNotes>
<PackageIcon>logo.png</PackageIcon>
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>PackageReadme.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\logo.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\package-icon.png" Visible="false" Pack="True" PackagePath="" />
<None Include="..\..\PackageReadme.md" Visible="false" Pack="True" PackagePath="" />
</ItemGroup>

Expand Down
Loading