Skip to content

Commit d858438

Browse files
committed
added bruckbuster game
1 parent 80bac0c commit d858438

File tree

113 files changed

+2943
-1
lines changed

Some content is hidden

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

113 files changed

+2943
-1
lines changed

assets/brick.png

17.7 KB
Loading

brickbuster/blog/__init__.py

Whitespace-only changes.

brickbuster/blog/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django.contrib import admin
2+
from .models import Post
3+
4+
admin.site.register(Post)

brickbuster/blog/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BlogConfig(AppConfig):
5+
name = 'blog'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 3.1 on 2020-08-08 08:57
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
import django.utils.timezone
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='Post',
20+
fields=[
21+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22+
('title', models.CharField(max_length=100)),
23+
('content', models.TextField()),
24+
('date_posted', models.DateTimeField(default=django.utils.timezone.now)),
25+
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
26+
],
27+
),
28+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 3.1 on 2021-04-05 15:18
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('blog', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='post',
15+
name='content',
16+
),
17+
migrations.RemoveField(
18+
model_name='post',
19+
name='title',
20+
),
21+
migrations.AddField(
22+
model_name='post',
23+
name='score',
24+
field=models.IntegerField(default=0),
25+
),
26+
]

brickbuster/blog/migrations/__init__.py

Whitespace-only changes.

brickbuster/blog/models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from django.db import models
2+
from django.utils import timezone
3+
from django.contrib.auth.models import User
4+
from django.urls import reverse
5+
from PIL import Image
6+
7+
class Post(models.Model):
8+
date_posted = models.DateTimeField(default=timezone.now)
9+
author = models.ForeignKey(User, on_delete=models.CASCADE)
10+
score = models.IntegerField(default=0)
11+
12+
def __str__(self):
13+
return self.title
14+
15+
def get_absolute_url(self):
16+
return reverse('post-detail', kwargs={'pk': self.pk})
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.content-section{
2+
/* margin-left: 100px; */
3+
display: flex;
4+
justify-content: space-around;
5+
}
6+
.introduction{
7+
width: 40%;
8+
/* margin-right: 70px; */
9+
}
10+
.common-questions h1{
11+
padding-right: 30px;
12+
display: inline-block;
13+
font-size: 30px;
14+
margin-bottom: 18px;
15+
border-bottom: 2px solid red;
16+
font-weight: bold;
17+
}
18+
.common-questions h2{
19+
font-weight: bold;
20+
font-size: 20px;
21+
margin: 0;
22+
}
23+
.common-questions p{
24+
font-size: 18px;
25+
}
26+
.common-questions *{
27+
/* color: #D1FFFD; */
28+
}
29+
.common-questions{
30+
max-width: 50%;
31+
}
32+
.question-container{
33+
/* border-left: 1px solid white; */
34+
margin-left: 5px;
35+
}
36+
.introduction h1{
37+
text-transform: uppercase;
38+
margin-bottom: 80px;
39+
background-color: rgba(10, 10, 10, 0.5);
40+
}
41+
.introduction p{
42+
margin-right: 2px;
43+
background-color: rgba(10, 10, 10, 0.5);
44+
display: inline;
45+
font-size: 26px;
46+
}
47+
img{
48+
position: absolute;
49+
height: 55%;
50+
bottom: 100px;
51+
left: 5%;
52+
z-index: -1;
53+
max-width: 90%;
54+
object-fit: contain;
55+
}
56+
#community{
57+
position: absolute;
58+
bottom: 230px;
59+
left: 170px;
60+
}
61+
footer{
62+
background-color:
63+
}
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
.main{
2+
margin: 0 auto;
3+
margin-top: 30px;
4+
}
5+
.game{
6+
/* border: 1px solid red; */
7+
padding: 15px;
8+
display: flex;
9+
justify-content: center;
10+
}
11+
.score-and-info{
12+
margin-left: 30px;
13+
display: flex;
14+
flex-direction: column;
15+
justify-content: space-between;
16+
}
17+
.game-info{
18+
display: flex;
19+
flex-direction: column;
20+
justify-content: center;
21+
}
22+
.set-difficulty{
23+
margin-top: 30px;
24+
height: 30px;
25+
width: 100%;
26+
display: flex;
27+
justify-content: space-between;
28+
align-items: center;
29+
}
30+
.set-difficulty button{
31+
width: 100%;
32+
}
33+
button{
34+
font-family: pixelated;
35+
color: white;
36+
background-color: black;
37+
transition-duration: 1s;
38+
height: 30px;
39+
}
40+
button:focus{
41+
outline: none;
42+
}
43+
44+
@keyframes opacityOnAndOff {
45+
0% {
46+
opacity: 0;
47+
}
48+
25%{
49+
opacity: 1;
50+
}
51+
100% {
52+
opacity: 0;
53+
}
54+
}
55+
56+
.game-over{
57+
opacity: 0;
58+
text-align: center;
59+
width: 179.5px;
60+
position: absolute;
61+
left: -299px;
62+
background-color: black;
63+
font-size: 18px;
64+
line-height: 29.5px;
65+
height: 29.5px;
66+
z-index: 2;
67+
transition-duration: 1s;
68+
}
69+
.score-saved{
70+
opacity: 0;
71+
text-align: center;
72+
width: 179.5px;
73+
position: absolute;
74+
left: -299px;
75+
background-color: #01B6DA;
76+
font-size: 18px;
77+
line-height: 29.5px;
78+
height: 29.5px;
79+
z-index: 2;
80+
transition-duration: 1s;
81+
animation-delay: 1s;
82+
animation-duration: 4s;
83+
}
84+
.table-dimmed{
85+
opacity: 0.6;
86+
}
87+
.btn-dimmed{
88+
color: #C9C9C9 !important;
89+
background-color: #5A5A5A !important;
90+
}
91+
.set-difficulty #normal{
92+
background-color: #26C485;
93+
}
94+
.set-difficulty #hard{
95+
background-color: #FF934F;
96+
}
97+
.set-difficulty #insane{
98+
background-color: #FF4242;
99+
}
100+
.game-control{
101+
height: 50px;
102+
width: 100%;
103+
display: flex;
104+
justify-content: space-between;
105+
align-items: center;
106+
}
107+
.game-control a{
108+
width: 48%;
109+
}
110+
.game-control #button_reset{
111+
width: 48%;
112+
}
113+
.game-control #button_start{
114+
width: 48%;
115+
}
116+
117+
.game-control button:active{
118+
font-size: 16px;
119+
transition-duration: 0.3s;
120+
}
121+
table{
122+
transition-duration: 0.5s;
123+
border-collapse: collapse;
124+
}
125+
.table-main{
126+
background: linear-gradient(180deg, rgba(39,36,61,1) 0%, rgba(32,32,101,1) 38%, rgba(180,255,249,1) 100%);
127+
}
128+
.table-sub{
129+
margin: 0 auto;
130+
background: linear-gradient(180deg, #27243d 0%, #212063 100%);
131+
}
132+
td{
133+
box-sizing: border-box;
134+
height: 30px;
135+
width: 30px;
136+
border: 1px solid white;
137+
margin-left: -1px;
138+
margin-bottom: -15px;
139+
}
140+
141+
.score span{
142+
font-size: 18px;
143+
}
144+
.wine{
145+
background-color: #700548 !important;
146+
}
147+
.sand{
148+
background-color: #F7E6AA !important;
149+
}
150+
.green{
151+
background-color: #43AA8B !important;
152+
}
153+
.blue{
154+
background-color: #5863F8 !important;
155+
}
156+
.orange{
157+
background-color: #CF5C36 !important;
158+
}
159+
.pink{
160+
background-color: #CFA2E2 !important;
161+
}

0 commit comments

Comments
 (0)