Skip to content

Commit a9b98a1

Browse files
committed
feature #887 Add the website (javiereguiluz)
This PR was merged into the main branch. Discussion ---------- Add the website | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | - | License | MIT Commits ------- 9005e8c Add the website
2 parents f4498c0 + 9005e8c commit a9b98a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1270
-0
lines changed

ai.symfony.com/.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[{compose.yaml,compose.*.yaml}]
14+
indent_size = 2
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

ai.symfony.com/.env

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
18+
APP_ENV=dev
19+
APP_SECRET=
20+
###< symfony/framework-bundle ###
21+
22+
###> symfony/routing ###
23+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
24+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
25+
DEFAULT_URI=http://localhost
26+
###< symfony/routing ###

ai.symfony.com/.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
###> symfony/framework-bundle ###
3+
APP_SECRET=4b506fc7c15aed9da5ea5bbd753f40fe
4+
###< symfony/framework-bundle ###

ai.symfony.com/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###
11+
12+
###> symfony/asset-mapper ###
13+
/public/assets/
14+
/assets/vendor/
15+
###< symfony/asset-mapper ###

ai.symfony.com/assets/app.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import 'bootstrap';
2+
import 'bootstrap/dist/css/bootstrap.min.css';
3+
import './styles/app.css';
4+
5+
document.addEventListener('DOMContentLoaded', function() {
6+
new App();
7+
});
8+
9+
class App {
10+
constructor() {
11+
this.#initializeThemeSwitcher();
12+
}
13+
14+
#initializeThemeSwitcher() {
15+
const themeToggle = document.getElementById('themeToggle');
16+
const themeIcon = document.getElementById('themeIcon');
17+
const html = document.documentElement;
18+
19+
const icons = {
20+
auto: document.getElementById('icon-theme-auto').content,
21+
light: document.getElementById('icon-theme-light').content,
22+
dark: document.getElementById('icon-theme-dark').content,
23+
};
24+
25+
const getStoredTheme = () => localStorage.getItem('theme') || 'auto';
26+
const setStoredTheme = (theme) => localStorage.setItem('theme', theme);
27+
28+
const setTheme = (theme) => {
29+
const themeToApply = 'auto' === theme
30+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
31+
: theme;
32+
html.setAttribute('data-bs-theme', themeToApply);
33+
};
34+
35+
const updateIcon = (theme) => {
36+
themeIcon.replaceChildren(icons[theme].firstElementChild.cloneNode(true));
37+
};
38+
39+
const cycleTheme = () => {
40+
const currentTheme = getStoredTheme();
41+
let nextTheme;
42+
43+
if ('auto' === currentTheme) {
44+
nextTheme = 'light';
45+
} else if ('light' === currentTheme) {
46+
nextTheme = 'dark';
47+
} else {
48+
nextTheme = 'auto';
49+
}
50+
51+
setStoredTheme(nextTheme);
52+
setTheme(nextTheme);
53+
updateIcon(nextTheme);
54+
};
55+
56+
const storedTheme = getStoredTheme();
57+
updateIcon(storedTheme);
58+
59+
themeToggle.addEventListener('click', cycleTheme);
60+
61+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
62+
if ('auto' === getStoredTheme()) {
63+
setTheme('auto');
64+
}
65+
});
66+
}
67+
}
38.2 KB
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)