-
-
Notifications
You must be signed in to change notification settings - Fork 319
London | 26-ITP-May | Tomislav Dukez | Sprint 3 | Quote Generator #1282
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
tomdu3
wants to merge
9
commits into
CodeYourFuture:main
Choose a base branch
from
tomdu3:coursework/sprint-3/1-quote-generator
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.
+371
−7
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
48bd066
update html
tomdu3 b3e29b9
add function, dom elements and event listener for quotes
tomdu3 12932cd
refactor: update DOM selectors to use IDs instead of classes for quot…
tomdu3 36729c1
add fonts and new elements on the page
tomdu3 19a0791
add styling cartoonish flashcard design and polka dot background
tomdu3 cc2b5d2
add autoplay functionality to the quote generator with toggle control
tomdu3 8f4225d
add styled autoplay toggle switch with effect
tomdu3 f598f04
fix: trigger initial quote display when autoplay is enabled
tomdu3 f748d37
refactor: update DOM element selection to use getElementById instead …
tomdu3 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
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
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 +1,290 @@ | ||
| /** Write your CSS in here **/ | ||
| :root { | ||
| /* Fonts */ | ||
| --font-sans: | ||
| "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; | ||
| --font-serif: "Lora", Georgia, serif; | ||
| /* Colours */ | ||
| --bg-yellow: oklch(0.93 0.16 90); | ||
| --bg-pink-dots: oklch(0.68 0.23 330); | ||
| --card-bg: oklch(0.96 0.06 200); | ||
| --text-dark: oklch(0.12 0.04 240); | ||
| --accent-yellow: oklch(0.88 0.21 95); | ||
| --btn-pink: oklch(0.65 0.25 330); | ||
| --btn-orange: oklch(0.75 0.22 50); | ||
| } | ||
|
|
||
| /* Reset */ | ||
| * { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| min-height: 100dvh; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| font-family: var(--font-sans); | ||
|
|
||
| /* Cartoonish Polka Dot Wallpaper Background */ | ||
| background-color: var(--bg-yellow); | ||
| background-image: | ||
| radial-gradient(var(--bg-pink-dots) 20%, transparent 20%), | ||
| radial-gradient(var(--bg-pink-dots) 20%, transparent 20%); | ||
| background-size: 40px 40px; | ||
| background-position: | ||
| 0 0, | ||
| 20px 20px; | ||
|
|
||
| overflow-x: hidden; | ||
| } | ||
|
|
||
| /* App container */ | ||
| .app-container { | ||
| display: grid; | ||
| place-items: center; | ||
| width: 100%; | ||
| padding: 2rem 1.5rem; | ||
| } | ||
|
|
||
| /* Funky Cartoon Flashcard */ | ||
| .flashcard { | ||
| position: relative; | ||
| background-color: var(--card-bg); | ||
| width: 100%; | ||
| max-width: 580px; | ||
| min-height: 340px; | ||
| border-radius: 28px; | ||
| padding: 3.5rem 3rem 3rem 3.5rem; | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: space-between; | ||
| gap: 2.5rem; | ||
|
|
||
| border: 4px solid var(--text-dark); | ||
| box-shadow: 12px 12px 0px var(--text-dark); | ||
|
|
||
| transform: rotate(-1deg); | ||
| transition: | ||
| transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), | ||
| box-shadow 0.2s ease; | ||
| } | ||
|
|
||
| /* Wiggle on hover */ | ||
| .flashcard:hover { | ||
| transform: rotate(1deg) scale(1.02); | ||
| box-shadow: 16px 16px 0px var(--text-dark); | ||
| } | ||
|
|
||
| /* Double quote */ | ||
| .quote-symbol { | ||
| font-family: var(--font-serif); | ||
| font-size: 14rem; | ||
| line-height: 1; | ||
| color: var(--text-dark) | ||
| opacity: 0.18; | ||
| position: absolute; | ||
| top: -2.5rem; | ||
| left: 1rem; | ||
| user-select: none; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| /* Card Content Area */ | ||
| .flashcard-content { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 2rem; | ||
| position: relative; | ||
| z-index: 1; | ||
| } | ||
|
|
||
| /* Quote Text Style */ | ||
| #quote { | ||
| font-family: var(--font-sans); | ||
| font-size: clamp(1.2rem, 1rem + 1.2vw, 2.3rem); | ||
| font-weight: 850; | ||
| line-height: 1.3; | ||
| color: var(--text-dark); | ||
| margin: 0; | ||
| text-wrap: pretty; | ||
| } | ||
|
|
||
| /* Author badge */ | ||
| #author { | ||
| font-family: var(--font-sans); | ||
| font-size: 0.95rem; | ||
| font-weight: 800; | ||
| text-transform: uppercase; | ||
| letter-spacing: 0.05em; | ||
| color: var(--text-dark); | ||
| margin: 0; | ||
| align-self: flex-end; | ||
|
|
||
| /* Badge styling */ | ||
| background-color: var(--accent-yellow); | ||
| padding: 0.6rem 1.2rem; | ||
| border: 3px solid var(--text-dark); | ||
| border-radius: 12px; | ||
| box-shadow: 4px 4px 0px var(--text-dark); | ||
| transform: rotate(2deg); | ||
| transition: transform 0.2s ease; | ||
| } | ||
|
|
||
| #author:hover { | ||
| transform: rotate(-2deg) scale(1.05); | ||
| } | ||
|
|
||
| /* Action button area */ | ||
| .flashcard-actions { | ||
| display: flex; | ||
| flex-flow: row wrap; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| gap: 1.5rem; | ||
| position: relative; | ||
| z-index: 1; | ||
| } | ||
|
|
||
| /* Autoplay control layout and badge */ | ||
| .autoplay-control { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 0.75rem; | ||
| background-color: var(--accent-yellow); | ||
| border: 3px solid var(--text-dark); | ||
| border-radius: 16px; | ||
| padding: 0.5rem 1rem; | ||
| box-shadow: 4px 4px 0px var(--text-dark); | ||
| transform: rotate(-1deg); | ||
| transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); | ||
| } | ||
|
|
||
| .autoplay-control:hover { | ||
| transform: rotate(1deg) scale(1.03); | ||
| } | ||
|
|
||
| /* Toggle Switch */ | ||
| .toggle-switch { | ||
| position: relative; | ||
| display: inline-block; | ||
| width: 54px; | ||
| height: 30px; | ||
| } | ||
|
|
||
| .toggle-switch input { | ||
| opacity: 0; | ||
| width: 0; | ||
| height: 0; | ||
| } | ||
|
|
||
| .slider { | ||
| position: absolute; | ||
| cursor: pointer; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| background-color: oklch(0.9 0.02 240); | ||
| border: 3px solid var(--text-dark); | ||
| border-radius: 34px; | ||
| transition: background-color 0.2s ease; | ||
| } | ||
|
|
||
| .slider::before { | ||
| position: absolute; | ||
| content: ""; | ||
| height: 16px; | ||
| width: 16px; | ||
| left: 4px; | ||
| bottom: 4px; | ||
| background-color: var(--text-dark); | ||
| border-radius: 50%; | ||
| transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); | ||
| } | ||
|
|
||
| input:checked + .slider { | ||
| background-color: var(--btn-pink); | ||
| } | ||
|
|
||
| input:checked + .slider::before { | ||
| transform: translateX(24px); | ||
| background-color: oklch(1 0 0); | ||
| } | ||
|
|
||
| input:focus-visible + .slider { | ||
| outline: 2px solid var(--text-dark); | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| .autoplay-status { | ||
| font-family: var(--font-sans); | ||
| font-size: 0.85rem; | ||
| font-weight: 850; | ||
| text-transform: uppercase; | ||
| color: var(--text-dark); | ||
| letter-spacing: 0.05em; | ||
| user-select: none; | ||
| } | ||
|
|
||
|
|
||
| /* Pop Button */ | ||
| #new-quote { | ||
| font-family: var(--font-sans); | ||
| font-size: 1.1rem; | ||
| font-weight: 900; | ||
| color: oklch(1 0 0); | ||
| background-color: var(--btn-pink); | ||
| border: 3px solid var(--text-dark); | ||
| border-radius: 16px; | ||
| padding: 0.9rem 2.5rem; | ||
| cursor: pointer; | ||
| box-shadow: 5px 5px 0px var(--text-dark); | ||
| transition: | ||
| transform 0.1s ease, | ||
| box-shadow 0.1s ease, | ||
| background-color 0.2s ease; | ||
|
|
||
| text-transform: uppercase; | ||
| letter-spacing: 0.03em; | ||
| min-block-size: 48px; | ||
| } | ||
|
|
||
| #new-quote:hover { | ||
| background-color: var(--btn-orange); | ||
| transform: translate(-2px, -2px); | ||
| box-shadow: 7px 7px 0px var(--text-dark); | ||
| } | ||
|
|
||
| #new-quote:active { | ||
| transform: translate(3px, 3px); | ||
| box-shadow: 2px 2px 0px var(--text-dark); | ||
| } | ||
|
|
||
| /* Focus style */ | ||
| #new-quote:focus-visible { | ||
| outline: 3px solid var(--text-dark); | ||
| outline-offset: 4px; | ||
| } | ||
|
|
||
| /* Preferences for motion */ | ||
| @media (prefers-reduced-motion: reduce) { | ||
| .flashcard, | ||
| #author, | ||
| #new-quote, | ||
| .autoplay-control, | ||
| .slider, | ||
| .slider::before { | ||
| transition: none !important; | ||
| transform: none !important; | ||
| } | ||
| .flashcard:hover { | ||
| transform: none !important; | ||
| } | ||
| #new-quote:hover, | ||
| #new-quote:active { | ||
| transform: none !important; | ||
| box-shadow: 5px 5px 0px var(--text-dark) !important; | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.