-
Notifications
You must be signed in to change notification settings - Fork 0
Adhoc theme #77
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
Open
JackHowa
wants to merge
6
commits into
main
Choose a base branch
from
adhoc-theme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adhoc theme #77
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ad956b1
refactor: redesign landing page with Material Design 3 theme system a…
JackHowa eefdb9a
refactor: improve color picker UX with enhanced theme generation and …
JackHowa 915026a
refactor: remove Roboto font from font stack, use system fonts only
JackHowa d819692
refactor: enhance Content-Security-Policy to allow inline scripts and…
JackHowa 97c32b6
refactor: add dynamic on-primary color calculation for improved contr…
JackHowa b11648d
refactor: update default theme color from purple to orange with adjus…
JackHowa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,324 @@ | ||
| * { | ||
| margin: 0; | ||
| padding: 0; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| :root { | ||
| /* setting color scheme for light/dark text */ | ||
| color-scheme: light dark; | ||
| --light-color: #ffcfb8; | ||
| --dark-color: #113134; | ||
| --md-primary: #ea6a00; | ||
| --md-primary-light: #ff8a33; | ||
| --md-primary-dark: #b85200; | ||
| --md-surface: #ffffff; | ||
| --md-surface-container: #f3edf7; | ||
| --md-surface-container-high: #ece6f0; | ||
| --md-on-surface: #1c1b1f; | ||
| --md-on-surface-variant: #49454f; | ||
| --md-outline: #79747e; | ||
| --md-background: #fef7ff; | ||
| --md-on-primary: #ffffff; | ||
| } | ||
|
|
||
| html { | ||
| --primary-color: var(--dark-color); | ||
| --secondary-color: var(--light-color); | ||
| font-family: -apple-system, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
| background: var(--md-background); | ||
| min-height: 100vh; | ||
| transition: background 0.3s ease; | ||
| } | ||
|
|
||
| background-color: var(--primary-color); | ||
| text-align: center; | ||
| body { | ||
| min-height: 100vh; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| padding: 20px; | ||
| overscroll-behavior: none; | ||
| } | ||
|
|
||
| .theme-picker { | ||
| position: fixed; | ||
| width: 100%; | ||
| height: 100%; | ||
| margin: 0; | ||
| padding: 0; | ||
| /* system specific font */ | ||
| font-family: -apple-system, system-ui, "Helvetica Neue", "Helvetica", "Arial", | ||
| sans-serif; | ||
| top: 20px; | ||
| right: 20px; | ||
| background: var(--md-surface-container-high); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. surface container higher so it's more visible https://m3.material.io/blog/tone-based-surface-color-m3 |
||
| backdrop-filter: blur(10px); | ||
| border-radius: 16px; | ||
| padding: 16px; | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15); | ||
| z-index: 1000; | ||
| max-width: 200px; | ||
| transform: translateX(0); | ||
| transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; | ||
| opacity: 1; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: light) { | ||
| html { | ||
| --primary-color: var(--light-color); | ||
| --secondary-color: var(--dark-color); | ||
| } | ||
| .theme-picker.hidden { | ||
| transform: translateX(calc(100% + 20px)); | ||
| opacity: 0; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| overscroll-behavior: none; | ||
| .theme-fab { | ||
| position: fixed; | ||
| bottom: 24px; | ||
| right: 24px; | ||
| width: 56px; | ||
| height: 56px; | ||
| background: var(--md-primary); | ||
| border: none; | ||
| border-radius: 16px; | ||
| color: white; | ||
| cursor: pointer; | ||
| box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3); | ||
| z-index: 999; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); | ||
| font-size: 24px; | ||
| } | ||
|
|
||
| main { | ||
| margin: 0; | ||
| height: 90vh; | ||
| .theme-fab:hover { | ||
| background: var(--md-primary-light); | ||
| box-shadow: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3); | ||
| } | ||
|
|
||
| .theme-fab:active { | ||
| transform: scale(0.95); | ||
| } | ||
|
|
||
| .theme-fab .material-icons { | ||
| font-size: 24px; | ||
| } | ||
|
|
||
| .theme-picker h3 { | ||
| font-size: 14px; | ||
| font-weight: 500; | ||
| color: var(--md-on-surface); | ||
| margin-bottom: 12px; | ||
| text-align: left; | ||
| } | ||
|
|
||
| .color-input-group { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 8px; | ||
| align-items: center; | ||
| margin-bottom: 12px; | ||
| } | ||
|
|
||
| .color-input { | ||
| width: 48px; | ||
| height: 48px; | ||
| border: 2px solid #e0e0e0; | ||
| border-radius: 50%; | ||
| cursor: pointer; | ||
| transition: transform 0.2s ease; | ||
| } | ||
|
|
||
| .color-input:hover { | ||
| transform: scale(1.1); | ||
| } | ||
|
|
||
| .color-label { | ||
| font-size: 12px; | ||
| color: var(--md-on-surface-variant); | ||
| } | ||
|
|
||
| .preset-label { | ||
| font-size: 11px; | ||
| color: var(--md-on-surface-variant); | ||
| margin-bottom: 8px; | ||
| text-align: left; | ||
| } | ||
|
|
||
| .preset-colors { | ||
| display: grid; | ||
| grid-template-columns: repeat(4, 1fr); | ||
| gap: 8px; | ||
| } | ||
|
|
||
| .preset-btn { | ||
| width: 40px; | ||
| height: 40px; | ||
| border: none; | ||
| border-radius: 50%; | ||
| cursor: pointer; | ||
| transition: transform 0.2s ease; | ||
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
| } | ||
|
|
||
| .preset-btn:hover { | ||
| transform: scale(1.15); | ||
| } | ||
|
|
||
| main { | ||
| width: 100%; | ||
| max-width: 480px; | ||
| background: var(--md-surface); | ||
| border-radius: 28px; | ||
| padding: 48px 32px; | ||
| box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15); | ||
| text-align: center; | ||
| } | ||
|
|
||
| .avatar { | ||
| width: 88px; | ||
| height: 88px; | ||
| background: var(--md-primary); | ||
| border-radius: 50%; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| padding: 0 10vw 0 10vw; | ||
| font-size: 40px; | ||
| font-weight: 500; | ||
| color: var(--md-on-primary); | ||
| margin-bottom: 24px; | ||
| transition: background 0.3s ease; | ||
| box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15); | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 5vmax; | ||
| margin: 0; | ||
| padding: 0 0 1rem 0; | ||
| font-size: 32px; | ||
| font-weight: 400; | ||
| color: var(--md-on-surface); | ||
| letter-spacing: 0; | ||
| margin-bottom: 8px; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 3vmax; | ||
| margin: 0; | ||
| padding: 0 0 1rem 0; | ||
| font-size: 16px; | ||
| font-weight: 400; | ||
| color: var(--md-on-surface-variant); | ||
| margin-bottom: 32px; | ||
| line-height: 24px; | ||
| } | ||
|
|
||
| a { | ||
| padding: 1rem; | ||
| font-size: 3vmax; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 8px; | ||
| width: 100%; | ||
| height: 56px; | ||
| border-radius: 100px; | ||
| font-size: 14px; | ||
| font-weight: 500; | ||
| letter-spacing: 0.1px; | ||
| text-decoration: none; | ||
| transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); | ||
| margin-bottom: 12px; | ||
| } | ||
|
|
||
| /* setting text color of links to match other canvastext */ | ||
| color: var(--canvastext); | ||
| text-align: center; | ||
| margin: 1rem 0; | ||
| /* seems to cause the border I want via apple */ | ||
| border-radius: 980px; | ||
| border: 5px solid var(--secondary-color); | ||
| a:first-of-type { | ||
| background: var(--md-primary); | ||
| color: var(--md-on-primary); | ||
| border: none; | ||
| box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3); | ||
| } | ||
|
|
||
| a:first-of-type:hover, | ||
| a:first-of-type:focus { | ||
| background: var(--md-primary-light); | ||
| box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 2px 6px 2px rgba(0, 0, 0, 0.15); | ||
| } | ||
|
|
||
| a:last-of-type { | ||
| background: transparent; | ||
| color: var(--md-primary); | ||
| border: 1px solid var(--md-outline); | ||
| } | ||
|
|
||
| a:last-of-type:hover, | ||
| a:last-of-type:focus { | ||
| background: rgba(103, 80, 164, 0.08); | ||
| } | ||
|
|
||
| a:active { | ||
| transform: scale(0.98); | ||
| } | ||
|
|
||
| .material-icons { | ||
| font-size: 18px; | ||
| } | ||
|
|
||
| @media (max-width: 640px) { | ||
| .theme-picker { | ||
| top: 10px; | ||
| right: 10px; | ||
| padding: 12px; | ||
| } | ||
|
|
||
| .theme-fab { | ||
| bottom: 16px; | ||
| right: 16px; | ||
| } | ||
|
|
||
| main { | ||
| padding: 40px 24px; | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 28px; | ||
| } | ||
| } | ||
|
|
||
| a:hover, a:focus { | ||
| font-weight: bold; | ||
| border-style: dashed; | ||
| @media (prefers-color-scheme: dark) { | ||
| :root { | ||
| --md-primary: #ffb68a; | ||
| --md-primary-light: #ffd0b0; | ||
| --md-primary-dark: #ea6a00; | ||
| --md-surface: #1c1b1f; | ||
| --md-surface-container: #211f26; | ||
| --md-surface-container-high: #2b2930; | ||
| --md-on-surface: #e6e1e5; | ||
| --md-on-surface-variant: #cac4d0; | ||
| --md-outline: #938f99; | ||
| --md-background: #141218; | ||
| --md-on-primary: #4a2800; | ||
| } | ||
|
|
||
| .theme-picker { | ||
| background: var(--md-surface-container-high); | ||
| } | ||
|
|
||
| .theme-picker h3 { | ||
| color: var(--md-on-surface); | ||
| } | ||
|
|
||
| .color-label { | ||
| color: var(--md-on-surface-variant); | ||
| } | ||
|
|
||
| .preset-label { | ||
| color: var(--md-outline); | ||
| } | ||
|
|
||
| .theme-fab { | ||
| background: var(--md-primary); | ||
| color: #381e72; | ||
| } | ||
|
|
||
| .theme-fab:hover { | ||
| background: var(--md-primary-light); | ||
| } | ||
|
|
||
| main { | ||
| background: var(--md-surface); | ||
| } | ||
|
|
||
| h1 { | ||
| color: var(--md-on-surface); | ||
| } | ||
|
|
||
| h2 { | ||
| color: var(--md-on-surface-variant); | ||
| } | ||
|
|
||
| a:first-of-type { | ||
| background: var(--md-primary); | ||
| color: var(--md-on-primary); | ||
| } | ||
|
|
||
| a:last-of-type { | ||
| color: var(--md-primary); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
material design variables originally set