From 5184500e70eb797559da04cb0a53bb874314a7ca Mon Sep 17 00:00:00 2001 From: Matthew <mxw@cs.washington.edu> Date: Mon, 5 Feb 2024 20:39:00 -0800 Subject: [PATCH] Fix invalid CSS, resolve all `javac` warnings --- .gitignore | 1 + GenerateProducts.java | 5 +- GenerateSite.java | 18 +------ GenerateStaff.java | 5 +- Products.java | 3 -- Staff.java | 6 +-- assets/style.css | 106 ++++++++++++++++++++++-------------------- 7 files changed, 61 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 73a6866..cb5a086 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.class .DS_Store +*.html diff --git a/GenerateProducts.java b/GenerateProducts.java index 4b71b04..39f263b 100644 --- a/GenerateProducts.java +++ b/GenerateProducts.java @@ -1,9 +1,7 @@ import java.util.Arrays; -import java.util.stream.Stream; import java.util.List; import java.util.stream.Collectors; -import java.lang.reflect.Method; -import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.io.*; public class GenerateProducts { @@ -21,7 +19,6 @@ public class GenerateProducts { PrintStream out = new PrintStream(new FileOutputStream("index.html", true)); Method[] methods = products.getMethods(); - Stream<Method> stream1 = Arrays.stream(methods); List<Method> productList = Arrays.stream(methods) .filter(line -> line.getReturnType().equals(product)) .collect(Collectors.toList()); diff --git a/GenerateSite.java b/GenerateSite.java index 70c2519..93a1f9a 100644 --- a/GenerateSite.java +++ b/GenerateSite.java @@ -1,9 +1,3 @@ -import java.util.Arrays; -import java.util.stream.Stream; -import java.util.List; -import java.util.stream.Collectors; -import java.lang.reflect.Method; -import java.lang.reflect.Field; import java.io.*; public class GenerateSite { @@ -13,20 +7,10 @@ public class GenerateSite { public static final String itemEnd = "</li>"; public static void main(String[] args) throws Exception { - Class<?> staff = Staff.class; - Class<?> employee = Employee.class; - Object dummy = staff.getDeclaredConstructor().newInstance(); - clearFiles("."); clearFiles("staff"); PrintStream out = new PrintStream(new File("index.html")); - Method[] methods = staff.getMethods(); - Stream<Method> stream1 = Arrays.stream(methods); - List<Method> employeeList = Arrays.stream(methods) - .filter(line -> line.getReturnType().equals(employee)) - .collect(Collectors.toList()); - printHeader(out, "FAANG"); out.println(indent(2) + "<h1><span class=\"company\">FAANG</span><span class=\"slogan\">Insert Catchy Slogan Here</span></h1>"); @@ -34,7 +18,7 @@ public class GenerateSite { out.println(indent(3) + "<div class=\"left_col\">"); out.println(indent(4) + "<p class=\"tab\">Products</p>"); out.println(indent(4) + listStart); - + out.close(); GenerateProducts.main(null); diff --git a/GenerateStaff.java b/GenerateStaff.java index 7af9ef2..91d7ff3 100644 --- a/GenerateStaff.java +++ b/GenerateStaff.java @@ -1,9 +1,7 @@ import java.util.Arrays; -import java.util.stream.Stream; import java.util.List; import java.util.stream.Collectors; -import java.lang.reflect.Method; -import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.io.*; public class GenerateStaff { @@ -21,7 +19,6 @@ public class GenerateStaff { PrintStream out = new PrintStream(new FileOutputStream("index.html", true)); Method[] methods = staff.getMethods(); - Stream<Method> stream1 = Arrays.stream(methods); List<Method> employeeList = Arrays.stream(methods) .filter(line -> line.getReturnType().equals(employee)) .collect(Collectors.toList()); diff --git a/Products.java b/Products.java index f49ee13..ecbcfc8 100644 --- a/Products.java +++ b/Products.java @@ -1,9 +1,6 @@ -import java.io.*; - /* check out these products! */ public class Products { /* a good class, but not as good as cse391 */ public Product joshsProduct() { return new Product("Dirt", "The good stuff", "dirt.jpeg", 0.0); } } - diff --git a/Staff.java b/Staff.java index f3b3a79..62f9494 100644 --- a/Staff.java +++ b/Staff.java @@ -1,7 +1,5 @@ -import java.io.*; - public class Staff { - + public Employee faangPup() { return new Employee("Steve", "Company Pup", "Provides Moral Support", "pup.jpg"); } @@ -9,4 +7,4 @@ public class Staff { public Employee cjobes() { return new Employee("Colton", "Lead Naps Analyst", "What do you mean I'm not valuable to the company?", "colton.jpg"); } -} +} diff --git a/assets/style.css b/assets/style.css index 1de8f81..e6269bd 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,102 +1,106 @@ @font-face { - font-family: 'Manrope'; /*a name to be used later*/ - src: url('../fonts/Manrope-ExtraBold.otf'); /*URL to font*/ + font-family: "Manrope"; /*a name to be used later*/ + src: url("../fonts/Manrope-ExtraBold.otf"); /*URL to font*/ } @font-face { - font-family: 'Manrope-Var'; /*a name to be used later*/ - src: url('../fonts/Manrope-Light.otf'); /*URL to font*/ + font-family: "Manrope-Var"; /*a name to be used later*/ + src: url("../fonts/Manrope-Light.otf"); /*URL to font*/ } body { - width: 50%; - margin: auto; - padding: 0; + width: 50%; + margin: auto; + padding: 0; } h1 { - margin: 0; - padding: 0; - font-family: 'Manrope'; - font-size: 40pt; - text-align: center; - margin-top: 75px; - color: #363C74; + margin: 0; + padding: 0; + font-family: "Manrope"; + font-size: 40pt; + text-align: center; + margin-top: 75px; + color: #363c74; } p { - margin: 0; - padding: 0; - font-family: 'Manrope-Var'; - font-size: 27pt; + margin: 0; + padding: 0; + font-family: "Manrope-Var"; + font-size: 27pt; } li { - margin: 5px; + margin: 5px; } .tab { - font-family: 'Manrope-var'; - font-size: 15pt; - text-align: center; - padding-top: 10px; + font-family: "Manrope-var"; + font-size: 15pt; + text-align: center; + padding-top: 10px; } .company { - font-family: 'Manrope'; - font-size: 40pt; - padding-right: 20px; + font-family: "Manrope"; + font-size: 40pt; + padding-right: 20px; } .slogan { - font-family: 'Manrope-Var'; - font-size: 27pt; - color: #E8D3A2; + font-family: "Manrope-Var"; + font-size: 27pt; + color: #e8d3a2; } .entry { - font-family: 'Manrope'; - font-size: 15pt; - color: black; - text-decoration: none; + font-family: "Manrope"; + font-size: 15pt; + color: black; + text-decoration: none; } .entry:hover { - color: #E8D3A2; - text-decoration: none; + color: #e8d3a2; + text-decoration: none; } .entry:visited { - color: #363C74; - text-decoration: none; + color: #363c74; + text-decoration: none; } .entry:visited:hover { - color: #E8D3A2; - text-decoration: none; + color: #e8d3a2; + text-decoration: none; } .about { - font-family: 'Manrope'; - font-size: 15pt; - margin; 5px - color: black; - text-decoration: none; - line-height: 1em; + font-family: "Manrope"; + font-size: 15pt; + margin: 5px; + color: black; + text-decoration: none; + line-height: 1em; } .wrap { - margin:0 auto; + margin: 0 auto; } .left_col { - float:left; - width: 50%; + float: left; + width: 50%; } .right_col { - float:right; - width: 50%; + float: right; + width: 50%; } - +img { + display: block; + max-width: 100%; + height: auto; +} -- GitLab