Skip to content

LAB-Templates-CSS-101 #20

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file.
16 changes: 16 additions & 0 deletions CssProject/CssProject/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for CssProject project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CssProject.settings')

application = get_asgi_application()
124 changes: 124 additions & 0 deletions CssProject/CssProject/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
"""
Django settings for CssProject project.

Generated by 'django-admin startproject' using Django 5.1.2.

For more information on this file, see
https://docs.djangoproject.com/en/5.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.1/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-0)i$qpw51-bnj-f2ax22yu=kccg#+-%y53sou*l=#8l7b+w8*z'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'Main',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'CssProject.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'CssProject.wsgi.application'


# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/5.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = 'static/'

# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
24 changes: 24 additions & 0 deletions CssProject/CssProject/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
URL configuration for CssProject project.

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include("Main.urls")),
]
16 changes: 16 additions & 0 deletions CssProject/CssProject/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for CssProject project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CssProject.settings')

application = get_wsgi_application()
Empty file added CssProject/Main/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions CssProject/Main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions CssProject/Main/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class MainConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Main'
Empty file.
3 changes: 3 additions & 0 deletions CssProject/Main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions CssProject/Main/static/css/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
55 changes: 55 additions & 0 deletions CssProject/Main/static/css/styles1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
font-family: 'Times New Roman', Times, serif;
}
h1{
position: absolute;
top: 10px;
left: 10px;
font-size: 20px;
font-style: normal;

}

h3{
font-size: 20px;
font-style: italic;
padding: 10px;
margin: 10px;
}

.container{
display: flex;
justify-content: center;
align-items: center;
width: 500px;
height: 150px;

background-color: aquamarine;
border-radius: 20px;

}

.header{
position: relative;
top: 0;
left: 0;

}

.item{
background-color: black;
color: antiquewhite;
padding: 10px;
margin: 10px;
font-size: 20px;
text-align: center;


flex: 1;
border-radius: 20px;
}
85 changes: 85 additions & 0 deletions CssProject/Main/static/css/styles_2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
body {
font-family: 'Times New Roman', Times, serif;
background-color: #f0f0f0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}

header {
text-align: center;
padding: 10px;
background-color: #007bff;
color: #fff;
border-radius: 10px 10px 0 0;
margin-bottom: 20px;
}

h1 {
font-size: 1.8rem;
transition: color 0.3s ease;
}

h1:hover {
color: #ffcc00;
}

section {
padding: 20px;
margin: 10px;
border-radius: 10px;
background-color: #ffffff;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

ul li {
transition: transform 0.3s ease;
}

ul li:hover {
transform: scale(1.05);
}

footer {
background-color: #f8f9fa;
padding: 15px;
border-radius: 0 0 10px 10px;
text-align: center;
}

footer a {
color: #007bff;
text-decoration: none;
transition: color 0.3s ease;
}

footer a:hover {
color: #0056b3;
}

@media (max-width: 768px) {
body {
padding: 10px;
}

h1 {
font-size: 1.5rem;
}

section {
padding: 15px;
}
}

@media (max-width: 480px) {
h1 {
font-size: 1.2rem;
}

footer span {
display: block;
font-size: 0.9rem;
}
}
Loading