chartManD commited on
Commit
ff983ec
·
1 Parent(s): 2f655e4

creado contador

Browse files
Files changed (3) hide show
  1. Dockerfile +0 -13
  2. app/index.php +27 -1
  3. app/main.css +12 -0
Dockerfile CHANGED
@@ -1,19 +1,6 @@
1
- # FROM debian:12.6
2
- # COPY ./app ./app
3
- # COPY entrypoint.sh entrypoint.sh
4
- # RUN chmod +x entrypoint.sh
5
- # EXPOSE 7860
6
- # EXPOSE 22
7
- # #WORKDIR app
8
- # #USER root
9
- # RUN cat /etc/passwd
10
- # ENTRYPOINT ["./entrypoint.sh"]
11
- # CMD ["bash"]
12
-
13
  FROM php
14
  COPY ./app ./app
15
  EXPOSE 7860
16
  WORKDIR app
17
- #USER root
18
  RUN cat /etc/passwd
19
  CMD ["php", "-S", "0.0.0.0:7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM php
2
  COPY ./app ./app
3
  EXPOSE 7860
4
  WORKDIR app
 
5
  RUN cat /etc/passwd
6
  CMD ["php", "-S", "0.0.0.0:7860"]
app/index.php CHANGED
@@ -1,13 +1,39 @@
1
  <?php
2
  $edad = 23;
3
  $nombre = "Norberto";
4
-
5
  ?>
6
 
7
  <html>
 
8
  <h1>Welcome to my crazy page</h1>
9
  <p>
10
  Hello, my name is <?php echo $nombre ?> and i'am <?php echo $edad ?> years old.
11
  </p>
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  </html>
 
1
  <?php
2
  $edad = 23;
3
  $nombre = "Norberto";
 
4
  ?>
5
 
6
  <html>
7
+ <link rel="stylesheet" href="main.css">
8
  <h1>Welcome to my crazy page</h1>
9
  <p>
10
  Hello, my name is <?php echo $nombre ?> and i'am <?php echo $edad ?> years old.
11
  </p>
12
 
13
+ <div class="contador">
14
+ <span class="numero">0</span>
15
+ <button onclick="actualizarNumero(true)">Aumenta</button>
16
+ <button onclick="actualizarNumero(false)">Disminuye</button>
17
+ </div>
18
+
19
+ <script>
20
+ let contenedorNumero = document.querySelector("numero");
21
+ let numeroActual= parseInt(contenedorNumero.textContent);
22
+
23
+ function actualizarNumero(aumenta) {
24
+ if (aumenta) {
25
+ numeroActual++;
26
+ mostrarNumero();
27
+ } else {
28
+ if (numeroActual == 0) {return}
29
+ numeroActual--;
30
+ mostrarNumero();
31
+ }
32
+ }
33
+
34
+ function mostrarNumero(){
35
+ contenedorNumero.textContent = numeroActual;
36
+ }
37
+ </script>
38
+
39
  </html>
app/main.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+
6
+ h1 {
7
+ text-align: center;
8
+ }
9
+
10
+ .contador {
11
+ text-align: center;
12
+ }