diff --git a/GoogleSearch/GoogleSearch/__init__.py b/GoogleSearch/GoogleSearch/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/GoogleSearch/GoogleSearch/asgi.py b/GoogleSearch/GoogleSearch/asgi.py new file mode 100644 index 0000000..07cf612 --- /dev/null +++ b/GoogleSearch/GoogleSearch/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for GoogleSearch 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/6.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'GoogleSearch.settings') + +application = get_asgi_application() diff --git a/GoogleSearch/GoogleSearch/core/static/images/camera.png b/GoogleSearch/GoogleSearch/core/static/images/camera.png new file mode 100644 index 0000000..4ecc705 Binary files /dev/null and b/GoogleSearch/GoogleSearch/core/static/images/camera.png differ diff --git a/GoogleSearch/GoogleSearch/core/static/images/google-logo.png b/GoogleSearch/GoogleSearch/core/static/images/google-logo.png new file mode 100644 index 0000000..ed8841b Binary files /dev/null and b/GoogleSearch/GoogleSearch/core/static/images/google-logo.png differ diff --git a/GoogleSearch/GoogleSearch/core/static/images/microphone.png b/GoogleSearch/GoogleSearch/core/static/images/microphone.png new file mode 100644 index 0000000..adbf033 Binary files /dev/null and b/GoogleSearch/GoogleSearch/core/static/images/microphone.png differ diff --git a/GoogleSearch/GoogleSearch/core/static/images/termsOfService.svg b/GoogleSearch/GoogleSearch/core/static/images/termsOfService.svg new file mode 100644 index 0000000..883e2d6 --- /dev/null +++ b/GoogleSearch/GoogleSearch/core/static/images/termsOfService.svg @@ -0,0 +1 @@ +scene_password_manager_welcome diff --git a/GoogleSearch/GoogleSearch/settings.py b/GoogleSearch/GoogleSearch/settings.py new file mode 100644 index 0000000..a9fd4e2 --- /dev/null +++ b/GoogleSearch/GoogleSearch/settings.py @@ -0,0 +1,89 @@ +""" +Django settings for GoogleSearch project. + +Generated by 'django-admin startproject' using Django 6.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/6.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/6.0/ref/settings/ +""" + +from pathlib import Path + +BASE_DIR = Path(__file__).resolve().parent.parent + +SECRET_KEY = 'django-insecure-bscl*!7)&-s1hq61h!u995&io81$(r=&9+^1j5eujguv-7h+0-' +DEBUG = True +ALLOWED_HOSTS = [] + +INSTALLED_APPS = [ + 'core', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +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 = 'GoogleSearch.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR / 'templates'], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'GoogleSearch.wsgi.application' + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + +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', + }, +] + +LANGUAGE_CODE = 'en-us' +TIME_ZONE = 'UTC' +USE_I18N = True +USE_TZ = True + +STATIC_URL = 'static/' + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' \ No newline at end of file diff --git a/GoogleSearch/GoogleSearch/static/css/style.css b/GoogleSearch/GoogleSearch/static/css/style.css new file mode 100644 index 0000000..5354d6d --- /dev/null +++ b/GoogleSearch/GoogleSearch/static/css/style.css @@ -0,0 +1,331 @@ +body { + margin: 0; + font-family: 'Roboto', sans-serif; + background: #ffffff; + color: #202124; + min-height: 100vh; +} + +a { + text-decoration: none; + color: #202124; +} + +.theme-toggle { + position: fixed; + top: 12px; + left: 12px; + z-index: 1000; + border: none; + background: #f1f3f4; + border-radius: 50%; + width: 38px; + height: 38px; + cursor: pointer; +} + +.top-header { + display: flex; + justify-content: flex-end; + align-items: center; + padding: 14px 20px; + font-size: 13px; +} + +.top-right { + display: flex; + align-items: center; + gap: 16px; +} + +.apps-icon { + font-size: 20px; + color: #5f6368; + cursor: pointer; +} + +.sign-in-btn { + background: #1a73e8; + color: white; + border: none; + border-radius: 4px; + padding: 9px 18px; + font-size: 14px; + cursor: pointer; +} + +.home-page { + min-height: calc(100vh - 140px); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: -70px; + text-align: center; +} + +.google-logo { + width: 272px; + max-width: 90%; + display: block; + margin: 0 auto 24px; +} + +.search-form { + width: 100%; + max-width: 584px; + text-align: center; +} + +.search-box { + width: 100%; + display: flex; + align-items: center; + box-sizing: border-box; + border: 1px solid #dfe1e5; + border-radius: 24px; + height: 46px; + padding: 0 14px; + background: white; + box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08); +} + +.search-box:hover { + box-shadow: 0 2px 10px rgba(32, 33, 36, 0.14); +} + +.search-icon { + color: #9aa0a6; + font-size: 20px; +} + +.search-input { + flex: 1; + border: none; + outline: none; + font-size: 16px; + padding: 0 12px; + background: transparent; +} + +.search-img-icon { + width: 22px; + height: 22px; + margin-left: 10px; + object-fit: contain; + cursor: pointer; +} + +.buttons-area { + margin-top: 28px; + display: flex; + justify-content: center; + gap: 12px; + flex-wrap: wrap; +} + +.search-btn { + background: #f8f9fa; + border: 1px solid #f8f9fa; + color: #3c4043; + font-size: 14px; + padding: 10px 16px; + border-radius: 4px; + cursor: pointer; +} + +.search-btn:hover { + border: 1px solid #dadce0; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); +} + +.google-offered { + margin-top: 24px; + font-size: 13px; + color: #4d5156; +} + +.google-offered a { + color: #1a0dab; +} + +.footer { + position: fixed; + left: 0; + right: 0; + bottom: 0; + background: #f2f2f2; + color: #70757a; + font-size: 14px; +} + +.footer-country { + padding: 15px 30px; + border-bottom: 1px solid #dadce0; + text-align: left; +} + +.footer-links { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px 30px; + gap: 10px; + flex-wrap: wrap; +} + +.footer-left, +.footer-right { + display: flex; + flex-wrap: wrap; + gap: 20px; +} + +.terms-page { + max-width: 1200px; + margin: 30px auto 60px; + padding: 0 20px 40px; +} + +.terms-content-wrapper { + display: flex; + align-items: center; + justify-content: center; + gap: 50px; + flex-wrap: wrap; +} + +.terms-image-section { + flex: 1; + min-width: 320px; + text-align: center; +} + +.terms-image { + width: 100%; + max-width: 520px; + display: block; + margin: 0 auto; +} + +.terms-text-section { + flex: 1.1; + min-width: 320px; + max-width: 560px; + padding-top: 20px; +} + +.terms-text-section h1 { + font-size: 34px; + margin-bottom: 10px; + font-weight: 400; +} + +.terms-date { + color: #5f6368; + font-size: 14px; + margin-bottom: 12px; +} + +.terms-links { + margin-bottom: 22px; + font-size: 14px; +} + +.terms-links a { + color: #1a73e8; +} + +.terms-text-section h2 { + font-size: 24px; + font-weight: 500; + margin-bottom: 14px; +} + +.terms-text-section p { + font-size: 15px; + line-height: 1.8; + margin-bottom: 16px; + color: #3c4043; +} + +.back-home-link { + display: inline-block; + margin-top: 10px; + color: #1a73e8; + font-weight: 500; +} + +.dark-mode { + background: #202124; + color: #e8eaed; +} + +.dark-mode a { + color: #e8eaed; +} + +.dark-mode .search-box { + background: #303134; + border-color: #5f6368; +} + +.dark-mode .search-input { + color: white; +} + +.dark-mode .search-btn { + background: #303134; + color: #e8eaed; + border-color: #303134; +} + +.dark-mode .footer { + background: #171717; + color: #9aa0a6; +} + +.dark-mode .terms-text-section p, +.dark-mode .terms-date { + color: #e8eaed; +} + +.dark-mode .theme-toggle { + background: #3c4043; + color: white; +} + +@media (max-width: 768px) { + .google-logo { + width: 200px; + } + + .home-page { + margin-top: -30px; + padding: 0 16px; + } + + .search-form { + max-width: 100%; + } + + .search-box { + width: 100%; + } + + .footer-links { + flex-direction: column; + align-items: flex-start; + } + + .terms-content-wrapper { + flex-direction: column; + gap: 20px; + } + + .terms-text-section, + .terms-image-section { + min-width: unset; + width: 100%; + } +} \ No newline at end of file diff --git a/GoogleSearch/GoogleSearch/urls.py b/GoogleSearch/GoogleSearch/urls.py new file mode 100644 index 0000000..89dbf36 --- /dev/null +++ b/GoogleSearch/GoogleSearch/urls.py @@ -0,0 +1,24 @@ +""" +URL configuration for GoogleSearch project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/6.0/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, include + +urlpatterns = [ + path('', include('core.urls')), + path('admin/', admin.site.urls), +] \ No newline at end of file diff --git a/GoogleSearch/GoogleSearch/wsgi.py b/GoogleSearch/GoogleSearch/wsgi.py new file mode 100644 index 0000000..48684be --- /dev/null +++ b/GoogleSearch/GoogleSearch/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for GoogleSearch 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/6.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'GoogleSearch.settings') + +application = get_wsgi_application() diff --git a/GoogleSearch/core/__init__.py b/GoogleSearch/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/GoogleSearch/core/admin.py b/GoogleSearch/core/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/GoogleSearch/core/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/GoogleSearch/core/apps.py b/GoogleSearch/core/apps.py new file mode 100644 index 0000000..26f78a8 --- /dev/null +++ b/GoogleSearch/core/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CoreConfig(AppConfig): + name = 'core' diff --git a/GoogleSearch/core/migrations/__init__.py b/GoogleSearch/core/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/GoogleSearch/core/models.py b/GoogleSearch/core/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/GoogleSearch/core/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/GoogleSearch/core/static/css/style.css b/GoogleSearch/core/static/css/style.css new file mode 100644 index 0000000..4e32013 --- /dev/null +++ b/GoogleSearch/core/static/css/style.css @@ -0,0 +1,158 @@ +body { + margin: 0; + font-family: 'Roboto', sans-serif; + background: #fff; +} + +/* 🌙 زر الوضع */ +.theme-toggle { + position: fixed; + top: 10px; + left: 10px; + border: none; + background: #f1f3f4; + padding: 8px 12px; + border-radius: 20px; + cursor: pointer; +} + +/* HEADER */ +.top-header { + display: flex; + justify-content: flex-end; + padding: 15px 20px; +} + +.top-right { + display: flex; + align-items: center; + gap: 15px; +} + +.sign-in-btn { + background: #1a73e8; + color: white; + border: none; + padding: 8px 16px; + border-radius: 4px; +} + +/* HOME */ +.home-page { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin-top: 120px; +} + +.google-logo { + width: 270px; + margin-bottom: 25px; +} + +.search-box { + width: 500px; + border: 1px solid #dfe1e5; + border-radius: 25px; + padding: 10px 15px; + display: flex; + align-items: center; +} + +.search-input { + flex: 1; + border: none; + outline: none; + font-size: 16px; +} + +.search-img-icon { + width: 20px; + margin-left: 10px; +} + +.buttons-area { + margin-top: 20px; +} + +.search-btn { + padding: 10px 14px; + margin: 5px; + border: 1px solid #f8f9fa; + background: #f8f9fa; + cursor: pointer; +} + +/* FOOTER */ +.footer { + position: fixed; + bottom: 0; + width: 100%; + background: #f2f2f2; +} + +.footer-country { + padding: 10px 20px; + border-bottom: 1px solid #ddd; +} + +.footer-links { + display: flex; + justify-content: space-between; + padding: 10px 20px; +} + +/* TERMS */ +.terms-page { + padding: 40px; +} + +.terms-content-wrapper { + display: flex; + align-items: center; + justify-content: center; + gap: 40px; +} + +.terms-image { + width: 400px; +} + +.terms-text-section { + max-width: 500px; +} + +.back-home-link { + display: block; + margin-top: 20px; + color: blue; +} + +/* 🌙 DARK MODE */ +.dark-mode { + background: #202124; + color: #e8eaed; +} + +.dark-mode a { + color: #e8eaed; +} + +.dark-mode .search-box { + background: #303134; + border-color: #5f6368; +} + +.dark-mode .search-input { + color: white; +} + +.dark-mode .search-btn { + background: #303134; + color: #e8eaed; +} + +.dark-mode .footer { + background: #171717; +} \ No newline at end of file diff --git a/GoogleSearch/core/static/images/camera.png b/GoogleSearch/core/static/images/camera.png new file mode 100644 index 0000000..4ecc705 Binary files /dev/null and b/GoogleSearch/core/static/images/camera.png differ diff --git a/GoogleSearch/core/static/images/google-logo.png b/GoogleSearch/core/static/images/google-logo.png new file mode 100644 index 0000000..ed8841b Binary files /dev/null and b/GoogleSearch/core/static/images/google-logo.png differ diff --git a/GoogleSearch/core/static/images/microphone.png b/GoogleSearch/core/static/images/microphone.png new file mode 100644 index 0000000..adbf033 Binary files /dev/null and b/GoogleSearch/core/static/images/microphone.png differ diff --git a/GoogleSearch/core/static/images/tos_main_illustration.svg b/GoogleSearch/core/static/images/tos_main_illustration.svg new file mode 100644 index 0000000..883e2d6 --- /dev/null +++ b/GoogleSearch/core/static/images/tos_main_illustration.svg @@ -0,0 +1 @@ +scene_password_manager_welcome diff --git a/GoogleSearch/core/templates/core/base.html b/GoogleSearch/core/templates/core/base.html new file mode 100644 index 0000000..deeb9bc --- /dev/null +++ b/GoogleSearch/core/templates/core/base.html @@ -0,0 +1,45 @@ +{% load static %} + + + + + + {% block title %}Google{% endblock %} + + + + + + + + + +
+
+ Gmail + Images + apps + +
+
+ {% block content %}{% endblock %} + + + + \ No newline at end of file diff --git a/GoogleSearch/core/templates/core/home.html b/GoogleSearch/core/templates/core/home.html new file mode 100644 index 0000000..80ec1ee --- /dev/null +++ b/GoogleSearch/core/templates/core/home.html @@ -0,0 +1,33 @@ +{% extends 'core/base.html' %} +{% load static %} + +{% block title %}Google{% endblock %} + +{% block content %} + + +
+ + +
+ + +
+ + +
+
+ +

+ Google offered in: + العربية +

+
+ + +{% endblock %} \ No newline at end of file diff --git a/GoogleSearch/core/templates/core/terms.html b/GoogleSearch/core/templates/core/terms.html new file mode 100644 index 0000000..fd3aca5 --- /dev/null +++ b/GoogleSearch/core/templates/core/terms.html @@ -0,0 +1,47 @@ +{% extends 'core/base.html' %} +{% load static %} + +{% block title %}Terms of Service{% endblock %} + +{% block content %} + + +
+
+
+ Terms of Service Illustration +
+ +
+

Google Terms of Service

+

Effective 5 January 2025

+ + + +

What’s covered in these terms

+ +

+ We know it’s tempting to skip these Terms of Service, but it’s important + to establish what you can expect from us as you use Google services, + and what we expect from you. +

+ +

+ These Terms of Service reflect the way Google’s business works, + the laws that apply to our company, and certain things that we’ve + always believed to be true. +

+ +

+ As a result, these Terms of Service help define Google’s relationship + with you as you interact with our services. +

+ + Back to Home +
+
+
+{% endblock %} \ No newline at end of file diff --git a/GoogleSearch/core/tests.py b/GoogleSearch/core/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/GoogleSearch/core/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/GoogleSearch/core/urls.py b/GoogleSearch/core/urls.py new file mode 100644 index 0000000..4a3620d --- /dev/null +++ b/GoogleSearch/core/urls.py @@ -0,0 +1,9 @@ +from django.urls import path +from . import views + +app_name = 'core' + +urlpatterns = [ + path('', views.home_view, name='home'), + path('terms/', views.terms_view, name='terms'), +] \ No newline at end of file diff --git a/GoogleSearch/core/views.py b/GoogleSearch/core/views.py new file mode 100644 index 0000000..eb58712 --- /dev/null +++ b/GoogleSearch/core/views.py @@ -0,0 +1,8 @@ +from django.shortcuts import render +from django.http import HttpResponse, HttpRequest + +def home_view(request: HttpRequest) -> HttpResponse: + return render(request, 'core/home.html') + +def terms_view(request: HttpRequest) -> HttpResponse: + return render(request, 'core/terms.html') \ No newline at end of file diff --git a/GoogleSearch/manage.py b/GoogleSearch/manage.py new file mode 100755 index 0000000..cad9c4a --- /dev/null +++ b/GoogleSearch/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'GoogleSearch.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()