diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..886649d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,13 @@ +name: tests +on: [pull_request, push] +env: + DATABASE_URL: sqlite:///cardie/db.sqlite3 +jobs: + test_project: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: pip install -r requirements.txt + - run: pip install -r requirements-dev.txt + - run: python cardie/manage.py test cardie diff --git a/cardie/cardie/settings.py b/cardie/cardie/settings.py index b7e1db0..ecb614c 100644 --- a/cardie/cardie/settings.py +++ b/cardie/cardie/settings.py @@ -22,6 +22,7 @@ "django-insecure-a_r$cp+uufzh*bdagc!fra@7n10c*ciuleve_4+-cs_bftbb9", ), DJANGO_ALLOWED_HOSTS=(list, ["localhost", "127.0.0.1"]), + ADMIN_PATH=(str, "admin/"), DATABASE_URL=(str, "sqlite:///db.sqlite3") ) # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -40,7 +41,11 @@ ALLOWED_HOSTS = env("DJANGO_ALLOWED_HOSTS") +ADMIN_PATH = env("ADMIN_PATH") +FIXTURE_DIRS = [ + os.path.join(BASE_DIR, "fixtures"), +] # Application definition INSTALLED_APPS = [ diff --git a/cardie/cardie/tests.py b/cardie/cardie/tests.py new file mode 100644 index 0000000..c201fc5 --- /dev/null +++ b/cardie/cardie/tests.py @@ -0,0 +1,21 @@ +from unittest import skip + +from django.test import Client, TestCase, override_settings + + +@override_settings(ADMIN_PATH="foo/") +class AdminTestCase(TestCase): + fixtures = ["server"] + + def setUp(self): + self.client = Client() + + def test_default_path_should_be_admin(self): + response = self.client.get("/admin/", follow=True) + self.assertEqual(response.status_code, 200) + + @skip("This test is failing. Is hard to test this because urls are populated.") + @override_settings(ADMIN_PATH="foo/") + def test_custom_path_should_be_foo(self): + response = self.client.get("/foo/", follow=True) + self.assertEqual(response.status_code, 200) diff --git a/cardie/cardie/urls.py b/cardie/cardie/urls.py index 07d8099..1b3e64e 100644 --- a/cardie/cardie/urls.py +++ b/cardie/cardie/urls.py @@ -14,11 +14,15 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ + +from django.conf import settings from django.contrib import admin -from django.urls import path, include +from django.urls import include, path + +ADMIN_PATH = settings.ADMIN_PATH urlpatterns = [ path("", include("main.urls")), path("auth/", include("authentication.urls")), - path('admin/', admin.site.urls), + path(ADMIN_PATH, admin.site.urls), ] diff --git a/cardie/fixtures/server.json b/cardie/fixtures/server.json new file mode 100644 index 0000000..4e3e1d6 --- /dev/null +++ b/cardie/fixtures/server.json @@ -0,0 +1,12 @@ +[ + { + "model": "main.server", + "pk": 1, + "fields": { + "ip": "127.0.0.1", + "production": true, + "allow_create_accounts": true, + "allow_sign_in": true + } + } +] diff --git a/cardie/main/context_processors.py b/cardie/main/context_processors.py index 48994eb..d1d3d87 100644 --- a/cardie/main/context_processors.py +++ b/cardie/main/context_processors.py @@ -1,17 +1,27 @@ from django.core.exceptions import ImproperlyConfigured +from django.conf import settings from .models import Server def server_context(request): server_context = Server.objects.first() - if server_context is None: - raise ImproperlyConfigured( - "No Server object found in the database. Tip: please add one." - ) + if settings.ADMIN_PATH not in request.path: + if server_context is None: + raise ImproperlyConfigured( + "No Server object found in the database. Tip: please add one." + ) - return { - "server": { - "ip": server_context.ip, - "production": server_context.production, + return { + "server": { + "ip": server_context.ip, + "production": server_context.production + } + } + + else: + return { + "server": { + "ip": "", + "production": "" + } } - } diff --git a/cardie/main/templates/editor.html b/cardie/main/templates/editor.html index fba7d25..152d38e 100644 --- a/cardie/main/templates/editor.html +++ b/cardie/main/templates/editor.html @@ -36,6 +36,7 @@
Accent color
Create a Card
++ Create a Card +
Editor
++ Editor +
Privacy Policy
-Last updated 7/24/24
+Last updated 10/15/24
@@ -28,6 +28,8 @@
The date and time the Account was created
+Wallet data
+This is a field that reflects all of the Cards stored in a User's account
@@ -38,6 +40,17 @@
Card owner
Card data
This is a piece of JSON data which contains everything the card needs to be rendered.
+Card date created
+Card date last edited
++ Temporary Card +
+UUID
+Card data
+This is a piece of JSON data which contains everything the card needs to be rendered.
+Card date created
diff --git a/cardie/main/tests.py b/cardie/main/tests.py deleted file mode 100644 index 4929020..0000000 --- a/cardie/main/tests.py +++ /dev/null @@ -1,2 +0,0 @@ - -# Create your tests here. diff --git a/cardie/main/views.py b/cardie/main/views.py index 8b4100a..df1e010 100644 --- a/cardie/main/views.py +++ b/cardie/main/views.py @@ -7,7 +7,7 @@ from django.utils import timezone from django.views.decorators.csrf import csrf_exempt from main.icons import icons -from main.models import Card, Server, TempCard +from main.models import Card, TempCard def index(request): diff --git a/cardie/static/main/editor.css b/cardie/static/main/editor.css index 4980055..ba6b8dd 100644 --- a/cardie/static/main/editor.css +++ b/cardie/static/main/editor.css @@ -19,7 +19,7 @@ html { #editor_header_title_text { font-family: var(--default-font-family); font-size: clamp(3vh, 30px, 3vw); - color: white; + color: var(--default-text-color); margin: 0; padding: 0; @@ -37,23 +37,6 @@ html { margin-left: clamp(2vh, 20px, 2vw); } -#editor_header_name_button { - background-color: rgba(99, 99, 99, 0.4); - border: 2px solid rgba(145, 145, 145, 0.6); - border: none; - color: white; - - aspect-ratio: 1; - width: clamp(3vh, 30px, 3vw); - height: clamp(3vh, 30px, 3vw); - border-radius: 100px; - padding: 0; - - margin-top: auto; - margin-bottom: auto; - transition: var(--default-transition); -} - #editor_header_name_button:hover { scale: 1.1; background-color: rgba(99, 99, 99, 0.6); @@ -64,17 +47,17 @@ html { } #editor_header_name_text_cardname { - color: white; + color: var(--default-text-color); padding-left: clamp(1vh, 10px, 1vw); } #editor_header_name_text_username { - color: white; + color: var(--default-text-color); margin-left: clamp(0.8vh, 8px, 0.8vw); } #editor_status { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); font-size: clamp(1.4vh, 14px, 1.4vw); @@ -128,16 +111,6 @@ html { margin-right: auto; } -.text_item { - display: flex; - flex-direction: row-reverse; -} - -.link_item { - display: flex; - flex-direction: row-reverse; -} - @keyframes show-iconselector { from { opacity: 0; @@ -285,14 +258,14 @@ html { } .editor_iconselector_icon_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); text-align: center; margin-top: clamp(0.3vh, 3px, 0.3vw); } .editor_iconselector_icon_text { - color: white; + color: var(--default-text-color); font-family: "Noto Sans Mono", "Courier New", monospace; font-size: clamp(1vh, 10px, 1vw); text-align: center; @@ -490,4 +463,24 @@ html { margin-left: clamp(1.5vh, 15px, 1.5vw); margin-right: clamp(1vh, 10px, 1vw); +} + +@keyframes show-item { + from { + opacity: 0; + scale: 0.8; + } + + to { + opacity: 1; + scale: 1; + } +} + +.item { + animation: show-item 0.3s ease-in-out forwards; + + /* Starting properties for animation */ + opacity: 0; + scale: 0.8; } \ No newline at end of file diff --git a/cardie/static/main/footer.css b/cardie/static/main/footer.css index 94d8b3a..681e074 100644 --- a/cardie/static/main/footer.css +++ b/cardie/static/main/footer.css @@ -31,7 +31,7 @@ } .footer_main_button_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); } @@ -52,8 +52,8 @@ .footer_main_contents_link { font-family: var(--default-font-family); - font-size: clamp(1.4vh, 14px, 1.4vwS); - color: white; + font-size: clamp(1.4vh, 14px, 1.4vw); + color: var(--default-text-color); opacity: 0.7; text-decoration: none; transition: var(--default-transition); @@ -97,7 +97,7 @@ } .footer_warning_contents_title { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-weight: 600; @@ -107,10 +107,10 @@ } .footer_warning_contents_text { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; - font-size: clamp(1.2vh, 12pv, 1.2vw); + font-size: clamp(1.2vh, 12px, 1.2vw); margin: 0px; } @@ -149,7 +149,7 @@ } .footer_main_button_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); } @@ -170,8 +170,8 @@ .footer_main_contents_link { font-family: var(--default-font-family); - font-size: clamp(1.2vh, 12px, 1.2vwS); - color: white; + font-size: clamp(1.2vh, 12px, 1.2vw); + color: var(--default-text-color); opacity: 0.7; text-decoration: none; transition: var(--default-transition); @@ -215,7 +215,7 @@ } .footer_warning_contents_title { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-weight: 600; @@ -225,7 +225,7 @@ } .footer_warning_contents_text { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-size: 12px; @@ -249,14 +249,14 @@ .footer_main_contents_link:active { opacity: 1; scale: 0.95; - color: white; + color: var(--default-text-color); } .footer_main_contents_link:visited { - color: white; + color: var(--default-text-color); } .footer_warning_contents_text > a { - color: white; + color: var(--default-text-color); font-weight: 500; } \ No newline at end of file diff --git a/cardie/static/main/home.css b/cardie/static/main/home.css index f215595..de50d35 100644 --- a/cardie/static/main/home.css +++ b/cardie/static/main/home.css @@ -115,7 +115,7 @@ html { } .home_card_text_name { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); font-size: clamp(1.6vh, 16px, 1.6vw); @@ -124,7 +124,7 @@ html { } .home_card_text_uuid { - color: white; + color: var(--default-text-color); font-family: "Noto Sans Mono", "Courier New", monospace; font-size: clamp(1.2vh, 12px, 1.2vw); opacity: 0.7; diff --git a/cardie/static/main/index.css b/cardie/static/main/index.css index b289922..1b9131c 100644 --- a/cardie/static/main/index.css +++ b/cardie/static/main/index.css @@ -175,7 +175,7 @@ body, html { } -@media (max-width: 1000px) { +@media (max-width: 1000px) { /* Small Screens */ #home_card { @@ -210,4 +210,38 @@ body, html { margin-left: clamp(2vh, 20px, 2vw); } +} + +/* Properties for landscape mode */ + +@media (orientation: landscape) and (max-width: 1000px) { + + body, html { + scroll-snap-type: none; + scroll-snap-points-y: none; + overflow: auto; + } + + #welcome_box{ + padding-top: 10em; + scroll-snap-align: none; + } + #home_card{ + padding-top: 14em; + scroll-snap-align: none; + } + #home_editor{ + padding-top: 40em; + scroll-snap-align: none; + } + #home_editor_image{ + padding-top: 10em; + scroll-snap-align: none; + } + + #index_top_account_signin { + font-size: 0.8rem; + padding: 5px 10px; + margin-top: 20px; + } } \ No newline at end of file diff --git a/cardie/static/main/notifications.css b/cardie/static/main/notifications.css index 5a6ece3..b02c7cb 100644 --- a/cardie/static/main/notifications.css +++ b/cardie/static/main/notifications.css @@ -68,21 +68,21 @@ .notification_header { font-family: var(--default-font-family); font-weight: 600; - color: white; - font-size: clamp(2vh, 20px, 2vq); + color: var(--default-text-color); + font-size: clamp(2vh, 20px, 2vw); margin: 0; } .notification_body { font-family: var(--default-font-family); font-weight: 400; - color: white; + color: var(--default-text-color); font-size: clamp(1.6vh, 16px, 1.6vw); margin: 0; } .notification_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); margin-right: 10px; } \ No newline at end of file diff --git a/cardie/static/main/scripts/editor/editor_information.js b/cardie/static/main/scripts/editor/editor_information.js index ade3b9f..89d1ad9 100644 --- a/cardie/static/main/scripts/editor/editor_information.js +++ b/cardie/static/main/scripts/editor/editor_information.js @@ -3,12 +3,6 @@ var link_items = new Array(); var currently_editing_icon; var items_list; -function open_iconselector_foritem(event) { - let item = event.target.closest(".link_item, .text_item"); - currently_editing_icon = item; - show_iconselector(); -} - function editor_create_json() { let card_json = { "uuid": "unknown", diff --git a/cardie/static/main/scripts/editor/icons.js b/cardie/static/main/scripts/editor/icons.js index 7a75e26..6d0f257 100644 --- a/cardie/static/main/scripts/editor/icons.js +++ b/cardie/static/main/scripts/editor/icons.js @@ -1,5 +1,4 @@ -// TODO: Support {{ server_url }} -let icons_url = "http://127.0.0.1:8000/iconlist"; +let icons_url = `${server_ip}/iconlist`; const itemsData = []; // Array to store item data var icon_selected_item; diff --git a/cardie/static/main/ui.css b/cardie/static/main/ui.css index 486c6c3..a37ea30 100644 --- a/cardie/static/main/ui.css +++ b/cardie/static/main/ui.css @@ -74,16 +74,16 @@ } .ui_button_large:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); cursor: pointer; } .ui_button_large:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_large:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -112,16 +112,16 @@ } .ui_button_grid:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); cursor: pointer; } .ui_button_grid:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_grid:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -151,16 +151,16 @@ } .ui_button_icon:hover:enabled { - scale: 1.1; + scale: var(--default-hover-scale); cursor: pointer; } .ui_button_icon:active:enabled { - scale: 0.9; + scale: var(--default-active-scale); } .ui_button_icon:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -192,16 +192,16 @@ } .ui_button_smallicon:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); cursor: pointer; } .ui_button_smallicon:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_smallicon:disabled { - scale: 0.95; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -232,16 +232,16 @@ } .ui_button_small:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); cursor: pointer; } .ui_button_small:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_small:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -409,11 +409,11 @@ .ui_status_text:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } .ui_status_icon { - color: white; + color: var(--default-text-color); opacity: 0.8; } @@ -453,7 +453,7 @@ .ui_input_generic:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } @@ -624,12 +624,12 @@ .ui_link_generic:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } .ui_link_generic:active { opacity: 0.9; - scale: 0.95; + scale: var(--default-active-scale); } .ui_link_generic:visited { diff --git a/cardie/static/main/variables.css b/cardie/static/main/variables.css index 53852d5..f804092 100644 --- a/cardie/static/main/variables.css +++ b/cardie/static/main/variables.css @@ -1,17 +1,21 @@ :root { - background: rgb(37, 40, 49); + background: rgb(29, 32, 39); --default-background-color: #35374B; --default-font-family: "Noto Sans", sans-serif; --default-transition: 0.3s ease; - --default-text-color: white; + --default-text-color: rgba(255, 255, 255, 0.9); --color-primary: #35374B; --color-secondary: #344955; --color-tertiary: #50727B; --color-quaternary: #78A083; - --default-glass-background: rgba(180, 180, 180, 0.4); - --default-glass-border: rgba(167, 167, 167, 0.5) 2px solid; + --default-glass-background: rgba(92, 92, 92, 0.4); + --default-glass-border: rgba(132, 132, 132, 0.5) 1.5px solid; --default-glass-blur: blur(20px); + --default-active-scale: 0.95; + --default-disabled-scale: 0.90; + --default-hover-scale: 1.05; + } \ No newline at end of file diff --git a/cardie/staticfiles/main/editor.css b/cardie/staticfiles/main/editor.css index 4980055..ba6b8dd 100644 --- a/cardie/staticfiles/main/editor.css +++ b/cardie/staticfiles/main/editor.css @@ -19,7 +19,7 @@ html { #editor_header_title_text { font-family: var(--default-font-family); font-size: clamp(3vh, 30px, 3vw); - color: white; + color: var(--default-text-color); margin: 0; padding: 0; @@ -37,23 +37,6 @@ html { margin-left: clamp(2vh, 20px, 2vw); } -#editor_header_name_button { - background-color: rgba(99, 99, 99, 0.4); - border: 2px solid rgba(145, 145, 145, 0.6); - border: none; - color: white; - - aspect-ratio: 1; - width: clamp(3vh, 30px, 3vw); - height: clamp(3vh, 30px, 3vw); - border-radius: 100px; - padding: 0; - - margin-top: auto; - margin-bottom: auto; - transition: var(--default-transition); -} - #editor_header_name_button:hover { scale: 1.1; background-color: rgba(99, 99, 99, 0.6); @@ -64,17 +47,17 @@ html { } #editor_header_name_text_cardname { - color: white; + color: var(--default-text-color); padding-left: clamp(1vh, 10px, 1vw); } #editor_header_name_text_username { - color: white; + color: var(--default-text-color); margin-left: clamp(0.8vh, 8px, 0.8vw); } #editor_status { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); font-size: clamp(1.4vh, 14px, 1.4vw); @@ -128,16 +111,6 @@ html { margin-right: auto; } -.text_item { - display: flex; - flex-direction: row-reverse; -} - -.link_item { - display: flex; - flex-direction: row-reverse; -} - @keyframes show-iconselector { from { opacity: 0; @@ -285,14 +258,14 @@ html { } .editor_iconselector_icon_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); text-align: center; margin-top: clamp(0.3vh, 3px, 0.3vw); } .editor_iconselector_icon_text { - color: white; + color: var(--default-text-color); font-family: "Noto Sans Mono", "Courier New", monospace; font-size: clamp(1vh, 10px, 1vw); text-align: center; @@ -490,4 +463,24 @@ html { margin-left: clamp(1.5vh, 15px, 1.5vw); margin-right: clamp(1vh, 10px, 1vw); +} + +@keyframes show-item { + from { + opacity: 0; + scale: 0.8; + } + + to { + opacity: 1; + scale: 1; + } +} + +.item { + animation: show-item 0.3s ease-in-out forwards; + + /* Starting properties for animation */ + opacity: 0; + scale: 0.8; } \ No newline at end of file diff --git a/cardie/staticfiles/main/footer.css b/cardie/staticfiles/main/footer.css index 94d8b3a..681e074 100644 --- a/cardie/staticfiles/main/footer.css +++ b/cardie/staticfiles/main/footer.css @@ -31,7 +31,7 @@ } .footer_main_button_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); } @@ -52,8 +52,8 @@ .footer_main_contents_link { font-family: var(--default-font-family); - font-size: clamp(1.4vh, 14px, 1.4vwS); - color: white; + font-size: clamp(1.4vh, 14px, 1.4vw); + color: var(--default-text-color); opacity: 0.7; text-decoration: none; transition: var(--default-transition); @@ -97,7 +97,7 @@ } .footer_warning_contents_title { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-weight: 600; @@ -107,10 +107,10 @@ } .footer_warning_contents_text { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; - font-size: clamp(1.2vh, 12pv, 1.2vw); + font-size: clamp(1.2vh, 12px, 1.2vw); margin: 0px; } @@ -149,7 +149,7 @@ } .footer_main_button_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); } @@ -170,8 +170,8 @@ .footer_main_contents_link { font-family: var(--default-font-family); - font-size: clamp(1.2vh, 12px, 1.2vwS); - color: white; + font-size: clamp(1.2vh, 12px, 1.2vw); + color: var(--default-text-color); opacity: 0.7; text-decoration: none; transition: var(--default-transition); @@ -215,7 +215,7 @@ } .footer_warning_contents_title { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-weight: 600; @@ -225,7 +225,7 @@ } .footer_warning_contents_text { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); opacity: 0.7; font-size: 12px; @@ -249,14 +249,14 @@ .footer_main_contents_link:active { opacity: 1; scale: 0.95; - color: white; + color: var(--default-text-color); } .footer_main_contents_link:visited { - color: white; + color: var(--default-text-color); } .footer_warning_contents_text > a { - color: white; + color: var(--default-text-color); font-weight: 500; } \ No newline at end of file diff --git a/cardie/staticfiles/main/home.css b/cardie/staticfiles/main/home.css index f215595..de50d35 100644 --- a/cardie/staticfiles/main/home.css +++ b/cardie/staticfiles/main/home.css @@ -115,7 +115,7 @@ html { } .home_card_text_name { - color: white; + color: var(--default-text-color); font-family: var(--default-font-family); font-size: clamp(1.6vh, 16px, 1.6vw); @@ -124,7 +124,7 @@ html { } .home_card_text_uuid { - color: white; + color: var(--default-text-color); font-family: "Noto Sans Mono", "Courier New", monospace; font-size: clamp(1.2vh, 12px, 1.2vw); opacity: 0.7; diff --git a/cardie/staticfiles/main/images/home_cards.png b/cardie/staticfiles/main/images/home_cards.png index 6e6754c..34509ef 100644 Binary files a/cardie/staticfiles/main/images/home_cards.png and b/cardie/staticfiles/main/images/home_cards.png differ diff --git a/cardie/staticfiles/main/images/home_editor.png b/cardie/staticfiles/main/images/home_editor.png index ad2e60f..22f1e3d 100644 Binary files a/cardie/staticfiles/main/images/home_editor.png and b/cardie/staticfiles/main/images/home_editor.png differ diff --git a/cardie/staticfiles/main/index.css b/cardie/staticfiles/main/index.css index b289922..1b9131c 100644 --- a/cardie/staticfiles/main/index.css +++ b/cardie/staticfiles/main/index.css @@ -175,7 +175,7 @@ body, html { } -@media (max-width: 1000px) { +@media (max-width: 1000px) { /* Small Screens */ #home_card { @@ -210,4 +210,38 @@ body, html { margin-left: clamp(2vh, 20px, 2vw); } +} + +/* Properties for landscape mode */ + +@media (orientation: landscape) and (max-width: 1000px) { + + body, html { + scroll-snap-type: none; + scroll-snap-points-y: none; + overflow: auto; + } + + #welcome_box{ + padding-top: 10em; + scroll-snap-align: none; + } + #home_card{ + padding-top: 14em; + scroll-snap-align: none; + } + #home_editor{ + padding-top: 40em; + scroll-snap-align: none; + } + #home_editor_image{ + padding-top: 10em; + scroll-snap-align: none; + } + + #index_top_account_signin { + font-size: 0.8rem; + padding: 5px 10px; + margin-top: 20px; + } } \ No newline at end of file diff --git a/cardie/staticfiles/main/notifications.css b/cardie/staticfiles/main/notifications.css index 5a6ece3..b02c7cb 100644 --- a/cardie/staticfiles/main/notifications.css +++ b/cardie/staticfiles/main/notifications.css @@ -68,21 +68,21 @@ .notification_header { font-family: var(--default-font-family); font-weight: 600; - color: white; - font-size: clamp(2vh, 20px, 2vq); + color: var(--default-text-color); + font-size: clamp(2vh, 20px, 2vw); margin: 0; } .notification_body { font-family: var(--default-font-family); font-weight: 400; - color: white; + color: var(--default-text-color); font-size: clamp(1.6vh, 16px, 1.6vw); margin: 0; } .notification_icon { - color: white; + color: var(--default-text-color); font-size: clamp(3vh, 30px, 3vw); margin-right: 10px; } \ No newline at end of file diff --git a/cardie/staticfiles/main/scripts/editor/editor_information.js b/cardie/staticfiles/main/scripts/editor/editor_information.js index ade3b9f..89d1ad9 100644 --- a/cardie/staticfiles/main/scripts/editor/editor_information.js +++ b/cardie/staticfiles/main/scripts/editor/editor_information.js @@ -3,12 +3,6 @@ var link_items = new Array(); var currently_editing_icon; var items_list; -function open_iconselector_foritem(event) { - let item = event.target.closest(".link_item, .text_item"); - currently_editing_icon = item; - show_iconselector(); -} - function editor_create_json() { let card_json = { "uuid": "unknown", diff --git a/cardie/staticfiles/main/scripts/editor/icons.js b/cardie/staticfiles/main/scripts/editor/icons.js index 7a75e26..6d0f257 100644 --- a/cardie/staticfiles/main/scripts/editor/icons.js +++ b/cardie/staticfiles/main/scripts/editor/icons.js @@ -1,5 +1,4 @@ -// TODO: Support {{ server_url }} -let icons_url = "http://127.0.0.1:8000/iconlist"; +let icons_url = `${server_ip}/iconlist`; const itemsData = []; // Array to store item data var icon_selected_item; diff --git a/cardie/staticfiles/main/scripts/global/card.js b/cardie/staticfiles/main/scripts/global/card.js index d06c158..3e0ec2e 100644 --- a/cardie/staticfiles/main/scripts/global/card.js +++ b/cardie/staticfiles/main/scripts/global/card.js @@ -168,7 +168,6 @@ function card_set_layout(card_selector, layout) { } function card_set_font(card_selector, name) { - console.log(name) let font_style = get_font_style(name); load_font(font_style["header"]["name"], font_style["header"]["url"]); load_font(font_style["text"]["name"], font_style["text"]["url"]); diff --git a/cardie/staticfiles/main/ui.css b/cardie/staticfiles/main/ui.css index aacc607..a37ea30 100644 --- a/cardie/staticfiles/main/ui.css +++ b/cardie/staticfiles/main/ui.css @@ -74,15 +74,16 @@ } .ui_button_large:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); + cursor: pointer; } .ui_button_large:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_large:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -111,15 +112,16 @@ } .ui_button_grid:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); + cursor: pointer; } .ui_button_grid:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_grid:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -149,15 +151,16 @@ } .ui_button_icon:hover:enabled { - scale: 1.1; + scale: var(--default-hover-scale); + cursor: pointer; } .ui_button_icon:active:enabled { - scale: 0.9; + scale: var(--default-active-scale); } .ui_button_icon:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -189,15 +192,16 @@ } .ui_button_smallicon:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); + cursor: pointer; } .ui_button_smallicon:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_smallicon:disabled { - scale: 0.95; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -228,15 +232,16 @@ } .ui_button_small:hover:enabled { - scale: 1.05; + scale: var(--default-hover-scale); + cursor: pointer; } .ui_button_small:active:enabled { - scale: 0.95; + scale: var(--default-active-scale); } .ui_button_small:disabled { - scale: 0.9; + scale: var(--default-disabled-scale); opacity: 0.7; } @@ -404,11 +409,11 @@ .ui_status_text:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } .ui_status_icon { - color: white; + color: var(--default-text-color); opacity: 0.8; } @@ -448,7 +453,7 @@ .ui_input_generic:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } @@ -619,15 +624,15 @@ .ui_link_generic:hover { opacity: 1; - scale: 1.05; + scale: var(--default-hover-scale); } .ui_link_generic:active { opacity: 0.9; - scale: 0.95; + scale: var(--default-active-scale); } .ui_link_generic:visited { color: var(--default-text-color); text-decoration: none; -} \ No newline at end of file +} diff --git a/cardie/staticfiles/main/variables.css b/cardie/staticfiles/main/variables.css index 53852d5..f804092 100644 --- a/cardie/staticfiles/main/variables.css +++ b/cardie/staticfiles/main/variables.css @@ -1,17 +1,21 @@ :root { - background: rgb(37, 40, 49); + background: rgb(29, 32, 39); --default-background-color: #35374B; --default-font-family: "Noto Sans", sans-serif; --default-transition: 0.3s ease; - --default-text-color: white; + --default-text-color: rgba(255, 255, 255, 0.9); --color-primary: #35374B; --color-secondary: #344955; --color-tertiary: #50727B; --color-quaternary: #78A083; - --default-glass-background: rgba(180, 180, 180, 0.4); - --default-glass-border: rgba(167, 167, 167, 0.5) 2px solid; + --default-glass-background: rgba(92, 92, 92, 0.4); + --default-glass-border: rgba(132, 132, 132, 0.5) 1.5px solid; --default-glass-blur: blur(20px); + --default-active-scale: 0.95; + --default-disabled-scale: 0.90; + --default-hover-scale: 1.05; + } \ No newline at end of file