13 Commits

Author SHA1 Message Date
vlnst
6f984fe7fd
Add "word-wrap: break-word" for links (#159)
Co-authored-by: Ftonans <77411099+Ftonans@users.noreply.github.com>
2024-11-15 03:08:31 -05:00
httpjamesm
4c971f3121
Add theme support using environment variable (#145)
* Add theme support using environment variable

* Propagate theme variable to template in options.go

Propagate the `theme` variable from the environment to the template in `src/routes/options.go`

* Retrieve the `theme` variable from the environment using `os.Getenv("THEME")`
* Set the `theme` variable in the `gin.H` map when rendering the `home.html` template


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/httpjamesm/AnonymousOverflow/pull/145?shareId=6397c9b4-9450-425c-bbbe-019425965d2b).

* Move all theme environment variable logic to a utils function

Move theme environment variable logic to a utils function and update routes to use it.

* Add `GetThemeFromEnv` function in `src/utils/theme.go` to derive the theme from environment variables and default to "auto" if not set.
* Update `src/routes/home.go` to import and use `GetThemeFromEnv` in the `GetHome` function.
* Update `src/routes/options.go` to import and use `GetThemeFromEnv` in the `ChangeOptions` function.
* Update `src/routes/question.go` to import and use `GetThemeFromEnv` in the `ViewQuestion` function.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/httpjamesm/AnonymousOverflow/pull/145?shareId=a0dab6f3-027c-4f6e-85fe-60e7675d0e70).

* fix: imports removed by copilot

* fix: override theme in posthome

* style: reduced repetition in themes with common vars
2024-07-25 10:50:06 -07:00
httpjamesm
e409176642
media query theme (#139)
* feat: use css media query to derive theme

* fix: rename alt for toggle images

* feat: remove no-cache middleware
2024-06-20 00:18:22 -04:00
McSinyx
e020639a3b
Set maximum width to 40rem across screen sizes (#111)
* Set maximum width to 40rem across screen sizes

Some rules are removed to correct the bounding box size
in browser inspector and fix the overflow on the x-axis.

* Remove unused div.parent

(The diff should be viewed --ignore-all-space)
2024-04-25 01:09:43 -04:00
Patrick Wu
3a508ddbd4
A fix and a small refactor (#114)
1. fix code not visible in light theme;
2. use hex code instead of rgb code for all.
2024-04-24 12:49:26 -04:00
httpjamesm
01b960cd43
fix: add stackoverflow flex classes (#88) 2024-03-09 11:20:10 -05:00
httpjamesm
9e806186b7
style: narrower questions on mobile (#54) 2023-08-21 02:02:04 -04:00
httpjamesm
84ba0886cd feat: show answer comments under collapsible 2022-12-28 22:48:02 -05:00
httpjamesm
14b11b7f14 style: fix syntax highlighting in light mode 2022-12-28 18:52:38 -05:00
httpjamesm
7ec73f8af8 feat: image loading and theme icon on homepage, fix view button color var 2022-12-28 12:37:04 -05:00
httpjamesm
90e873d9e2 style: make links more readable in light 2022-12-28 12:02:29 -05:00
httpjamesm
3d53fd5806 feat: import theme icons, set color vars, option cookie 2022-12-28 11:49:14 -05:00
httpjamesm
2ae093b43d feat: home page with URL conversion endpoint
style: mobile optimization
2022-12-27 23:39:34 -05:00