Skip to content

Commit

Permalink
write html js views urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Ornamrr committed Aug 4, 2022
1 parent 84eb6a0 commit 2c994d3
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion acapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
from django.urls import path,include

urlpatterns = [
#path('' , include('game.urls')),
path('' , include('game.urls.index')),
path('admin/', admin.site.urls),
]
5 changes: 5 additions & 0 deletions game/static/js/dist/game.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AcGame{
constructor(id){

}
}
5 changes: 5 additions & 0 deletions game/static/js/src/zbase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AcGame{
constructor(id){

}
}
18 changes: 18 additions & 0 deletions game/templates/multiends/web.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% load static %}

<head>
<!-- jquery -->
<link rel="stylesheet" href="https://cdn.acwing.com/static/jquery-ui-dist/jquery-ui.min.css">
<script src="https://cdn.acwing.com/static/jquery/js/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="{% static 'css/game.css' %}">
<script src="{% static 'js/dist/game.js' %}"></script>
</head>

<body style="margin: 0">
<div id="ac_game_12345678"></div>
<script>
$(document).ready(function(){
let ac_game = AcGame("ac_game_12345678");
});
</script>
</body>
8 changes: 8 additions & 0 deletions game/urls/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.urls import path,include
from game.views.index import index
urlpatterns = [
path("", index, name="index"),
path("menu/",include("game.urls.menu.index")),
path("palyground/",include("game.urls.playground.index")),
path("settings/",include("game.urls.settings.index")),
]
Empty file added game/urls/menu/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions game/urls/menu/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.urls import path,include

urlpatterns = [
]
Empty file.
4 changes: 4 additions & 0 deletions game/urls/playground/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.urls import path,include

urlpatterns = [
]
Empty file added game/urls/settings/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions game/urls/settings/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.urls import path,include

urlpatterns = [
]
5 changes: 5 additions & 0 deletions game/views/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.shortcuts import render #render 在服务端渲染html

def index(request):
return render(request,"multiends/web.html")

Empty file added game/views/menu/__init__.py
Empty file.
Empty file.
Empty file added game/views/settings/__init__.py
Empty file.

0 comments on commit 2c994d3

Please sign in to comment.