Skip to content

Commit

Permalink
web fast login
Browse files Browse the repository at this point in the history
  • Loading branch information
Ornamrr committed Aug 11, 2022
1 parent fca57f4 commit c18c7e5
Show file tree
Hide file tree
Showing 34 changed files with 1,762 additions and 88 deletions.
11 changes: 11 additions & 0 deletions acapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
}
}

CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
},
}
USER_AGENTS_CACHE = 'default'


# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
4 changes: 3 additions & 1 deletion game/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib import admin

from game.models.player.player import Player
# Register your models here.

admin.site.register(Player)
25 changes: 25 additions & 0 deletions game/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.8 on 2022-08-10 12:02

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Player',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('photo', models.URLField(blank=True, max_length=256)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
18 changes: 18 additions & 0 deletions game/migrations/0002_player_openid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.8 on 2022-08-11 08:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('game', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='player',
name='openid',
field=models.CharField(blank=True, default='', max_length=50, null=True),
),
]
Empty file added game/models/player/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions game/models/player/player.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.db import models
from django.contrib.auth.models import User

class Player(models.Model):
user = models.OneToOneField(User,on_delete=models.CASCADE)
photo = models.URLField (max_length=256,blank=True)
openid = models.CharField(default="",max_length=50,blank=True,null=True)

def __str__(self):
return str(self.user)
137 changes: 130 additions & 7 deletions game/static/css/game.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,159 @@
.ac-game-settings {
width: 100%;
height: 100%;
background-image: url("/static/image/menu/paper1.jpg");
background-size: 100% 100%;
}

.ac-game-settings-login {
height: 41vh;
width: 20vw;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.7);
border-radius: 5px;

}

.ac-game-settings-title {
color: aliceblue;
font-size: 3vh;
text-align: center;
height: 7vh;
padding-top: 2vh;
margin-bottom: 2vh;
}


.ac-game-settings-register {
height: 49vh;
width: 20vw;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.7);
border-radius: 5px;

}

.ac-game-settings-username {
display: block;
height: 7vh;

}

.ac-game-settings-password {
display: block;
height: 7vh;
}

.ac-game-settings-item {
width: 100%;
height: 100%;
}

.ac-game-settings-item>input {
width: 90%;
line-height: 3vh;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.ac-game-settings-submit {
display: block;
height: 7vh;
}

.ac-game-settings-item>button {
color: azure;
width: 90%;
line-height: 3vh;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: cadetblue;
border: 5px;
}

.ac-game-settings-error-message {
color: crimson;
font-size: 0.8vh;
display: inline;
float: left;
padding: 1vw;
}

.ac-game-settings-option {
color: white;
font-size: 2vh;
display: inline;
float: right;
padding-right: 1vw;
cursor: pointer;
}

.ac-game-settings-acwing {
display: block;
height: 7vh;
}

.ac-game-settings-acwing>img {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
display: block;
text-align: center;
}

.ac-game-settings-acwing>div {
color: whitesmoke;
font-size: 1.5vh;
text-align: center;

}


.ac-game-menu {
width: 100%;
height: 100%;
background-image: url("/static/image/menu/paper1.jpg");
background-size: 100% 100%;
}

.ac-game-menu-field{
.ac-game-menu-field {
width: 20vw;
position: relative;
top:40%;
left:50%;
top: 40%;
left: 50%;
}

.ac-game-menu-field-item{
.ac-game-menu-field-item {
color: aliceblue;
height: 6vh;
width: 18vw;
font-size: 4vh;
font-style: italic;
text-align: center;
background-color: rgba(39,21,28,0.6);
background-color: rgba(39, 21, 28, 0.6);
border-radius: 10px;
letter-spacing: 0.5vw;
cursor: pointer;
}

.ac-game-menu-field-item:hover{
.ac-game-menu-field-item:hover {
transform: scale(1.2);
transition: 100ms;
}

.ac-game-playground{
.ac-game-playground {
width: 100%;
height: 100%;
user-select: none;
Expand Down
Loading

0 comments on commit c18c7e5

Please sign in to comment.