├── CODEOWNERS.txt ├── .github ├── FUNDING.yml ├── workflows │ ├── my-workflow.yml │ ├── jekyll-docker.yml │ ├── blank.yml │ └── static.yml └── dependabot.yml ├── CITATION.cff ├── SECURITY.md ├── LICENSE ├── index.html ├── CONTRIBUTING.MD ├── README.md ├── style.css ├── CODE_OF_CONDUCT.md └── script.js /CODEOWNERS.txt: -------------------------------------------------------------------------------- 1 | 2 | @FabianaCampanari 3 | 4 | @FabianaCampanari owns all txt files 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | github: 3 | FabianaCampanari 4 | Custom: 5 | https://github.com/sponsors/FabianaCampanari/card 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/workflows/my-workflow.yml: -------------------------------------------------------------------------------- 1 | 2 | name: My Workflow 3 | on: [push] 4 | 5 | jobs: 6 | my-work: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v2 12 | 13 | - name: My Action 14 | uses: my-action@v1 15 | with: 16 | my_secret: ${{ secrets.GITHUB_TOKEN }} 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | title: Fabiana Campanari repository 3 | message: If you really want to cite this repository, here's how you should cite it. 4 | type: software 5 | authors: 6 | - given-names: Fabiana 7 | family-names: Campanari 8 | orcid: https://orcid.org/1234-5678-9101-1121 9 | repository-code: https://github.com/FabianaCampanari/Top-Trumps 10 | license: AGPL-3.0 license 11 | 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Please report a vulnerability. 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/jekyll-docker.yml: -------------------------------------------------------------------------------- 1 | name: Jekyll site CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Build the site in the jekyll/builder container 17 | run: | 18 | docker run \ 19 | -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ 20 | jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Fabiana Campanari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |Hello! I am very glad that you're interested in contributing to Fabiana Campanari's project. Whether you're an experienced programmer or making your first open source contribution, everyone is welcome!
4 | 5 |We ask that all contributors follow our Code of Conduct, which sets expectations for the community in terms of respectful and inclusive behavior.
20 | 21 |If you have any questions, feel free to open an Issue. We'll do our best to help you!
24 | 25 | 🌎One People. One World. One Spirit. We Are One! 26 | 27 | -------------------------------------------------------------------------------- /.github/workflows/static.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | 3 | name: Deploy static content to Pages 4 | 5 | on: 6 | # Runs on pushes targeting the default branch 7 | push: 8 | branches: ["main"] 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 14 | permissions: 15 | contents: read 16 | pages: write 17 | id-token: write 18 | 19 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 20 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: false 24 | 25 | jobs: 26 | # Single deploy job since we're just deploying 27 | deploy: 28 | environment: 29 | name: github-pages 30 | url: ${{ steps.deployment.outputs.page_url }} 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Checkout 34 | uses: actions/checkout@v4 35 | - name: Setup Pages 36 | uses: actions/configure-pages@v4 37 | - name: Upload artifact 38 | uses: actions/upload-pages-artifact@v2 39 | with: 40 | # Upload entire repository 41 | path: '.' 42 | - name: Deploy to GitHub Pages 43 | id: deployment 44 | uses: actions/deploy-pages@v3 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |🃏 Top-Trumps
5 |***< made with vibe, frequency & joy />*** 🪬
16 | 17 | # 18 | 19 | 🚀 [Let's Top Trump It !](https://fabianacampanari.github.io/Top-Trumps)
22 |
23 |
24 |
25 |
26 |
27 |
[💭 Get in Touch](https://share.hsforms.com/1ZACnVoYSTLC-NOoHcg22cgq9urk)
47 |
48 | #
49 |
50 |
51 |
52 | ####
📌 SPECS:
53 | 54 |[Copyright 2024 Fabiana Campanari. All Rights Reserved. Code released under the MIT license.](https://github.com/FabianaCampanari/Top-Trumps/blob/7e6a78b102c202e0a2ebe280db75669767fc78b0/LICENSE) 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "bundler" 4 | directory: "/updater" 5 | schedule: 6 | interval: "weekly" 7 | day: "sunday" 8 | time: "16:00" 9 | groups: 10 | aws-sdk: 11 | patterns: 12 | - "aws-sdk-*" 13 | dev-dependencies: 14 | dependency-type: "development" 15 | update-types: 16 | - "minor" 17 | - "patch" 18 | 19 | # Watch the per-ecosystem native helpers 20 | - package-ecosystem: "composer" 21 | directory: "/composer/helpers/v1" 22 | schedule: 23 | interval: "weekly" 24 | day: "sunday" 25 | time: "16:00" 26 | groups: 27 | dev-dependencies: 28 | dependency-type: "development" 29 | update-types: 30 | - "minor" 31 | - "patch" 32 | - package-ecosystem: "composer" 33 | directory: "/composer/helpers/v2" 34 | schedule: 35 | interval: "weekly" 36 | day: "sunday" 37 | time: "16:00" 38 | groups: 39 | dev-dependencies: 40 | dependency-type: "development" 41 | update-types: 42 | - "minor" 43 | - "patch" 44 | - package-ecosystem: "docker" 45 | directory: "/" 46 | schedule: 47 | interval: "weekly" 48 | day: "sunday" 49 | time: "16:00" 50 | - package-ecosystem: "docker" 51 | directory: "/go_modules" 52 | schedule: 53 | interval: "weekly" 54 | day: "sunday" 55 | time: "16:00" 56 | - package-ecosystem: "github-actions" 57 | directory: "/" 58 | schedule: 59 | interval: "weekly" 60 | day: "sunday" 61 | time: "16:00" 62 | - package-ecosystem: "gomod" 63 | directory: "/go_modules/helpers" 64 | schedule: 65 | interval: "weekly" 66 | day: "sunday" 67 | time: "16:00" 68 | - package-ecosystem: "mix" 69 | directory: "/hex/helpers" 70 | schedule: 71 | interval: "weekly" 72 | day: "sunday" 73 | time: "16:00" 74 | - package-ecosystem: "npm" 75 | directory: "/npm_and_yarn/helpers" 76 | schedule: 77 | interval: "weekly" 78 | day: "sunday" 79 | time: "16:00" 80 | groups: 81 | npm-dependencies: 82 | patterns: 83 | - "@npmcli/arborist" 84 | - "nock" 85 | - "npm" 86 | - "semver" 87 | exclude-patterns: 88 | - "detect-indent" # temp excluded due to https://github.com/dependabot/dependabot-core/pull/5683#issuecomment-1243468605 89 | yarn-dependencies: 90 | patterns: 91 | - "@dependabot/yarn-lib" 92 | pnpm-dependencies: 93 | patterns: 94 | - "@pnpm/lockfile-file" 95 | - "@pnpm/dependency-path" 96 | dev-dependencies: 97 | dependency-type: "development" 98 | update-types: 99 | - "minor" 100 | - "patch" 101 | ignore: 102 | - dependency-name: "npm" 103 | update-types: ["version-update:semver-major"] 104 | - package-ecosystem: "pip" 105 | directory: "/python/helpers" 106 | schedule: 107 | interval: "weekly" 108 | day: "sunday" 109 | time: "16:00" 110 | - package-ecosystem: "pub" 111 | directory: "/pub/helpers" 112 | schedule: 113 | interval: "weekly" 114 | day: "sunday" 115 | time: "16:00" 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | 2 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap"); 3 | 4 | @import url("https://images6.alphacoders.com/681/681840.jpg"); 5 | 6 | body { 7 | font-family: "Poppins", sans-serif; 8 | min-height: 854px; 9 | background-image: url("https://images5.alphacoders.com/430/430918.jpg"); 10 | background-color: #000000; 11 | background-size: cover; 12 | background-position: center top; 13 | background-repeat: no-repeat; 14 | padding-bottom: 20vh; 15 | } 16 | 17 | .container { 18 | text-align: center; 19 | padding: 20px; 20 | width: 550px; 21 | margin: 0 auto; 22 | } 23 | 24 | .page-title { 25 | color: #ffffff; 26 | font-family: "Permanent Marker", cursive; 27 | margin: 5px 0; 28 | font-size: 700; 29 | } 30 | 31 | button, 32 | .button-jogar { 33 | padding: 0.8rem 1.5rem; 34 | margin: 1rem 0; 35 | border-radius: 5px; 36 | border: none; 37 | font-size: 1rem; 38 | } 39 | 40 | .button-jogar:hover { 41 | cursor: pointer; 42 | transition: 0.5s; 43 | background: #280680; 44 | color: white; 45 | font-weight: bold; 46 | } 47 | 48 | h2 { 49 | color: white; 50 | } 51 | 52 | #carta-jogador h3 { 53 | text-align: center; 54 | } 55 | 56 | .carta-imagem { 57 | border: 1px solid black; 58 | height: 100px; 59 | margin: 10px; 60 | } 61 | 62 | .carta-imagem img { 63 | width: 100%; 64 | height: 100%; 65 | } 66 | 67 | .carta-status { 68 | height: 160px; 69 | margin: 2rem; 70 | color: white; 71 | z-index: 2; 72 | } 73 | 74 | .carta-status input { 75 | margin: 20px 10px; 76 | } 77 | 78 | .resultado-final { 79 | color: white; 80 | font-size: 2rem; 81 | text-transform: uppercase; 82 | font-weigth: bolder; 83 | padding: 1rem; 84 | border-radius: 5px; 85 | border: 1px solid #311b9250; 86 | background-image: url("https://images8.alphacoders.com/739/739036.jpg"); 87 | } 88 | 89 | .--spacing { 90 | margin-left: 2.5rem; 91 | } 92 | 93 | form { 94 | display: flex; 95 | flex-direction: column; 96 | } 97 | 98 | .wrapper { 99 | display: flex; 100 | justify-content: space-between; 101 | width: 100%; 102 | } 103 | 104 | .carta-subtitle { 105 | z-index: 2; 106 | position: absolute; 107 | top: 16px; 108 | left: 37px; 109 | font-weight: 800; 110 | text-transform: uppercase; 111 | } 112 | 113 | #cartas { 114 | width: 100%; 115 | display: flex; 116 | justify-content: space-between; 117 | } 118 | 119 | .carta-status p { 120 | margin-bottom: 2rem; 121 | } 122 | 123 | .card { 124 | width: 220px; 125 | height: 300px; 126 | background-image: url("https://images4.alphacoders.com/104/1044085.png"); 127 | background-size: 100%; 128 | background-position: bottom; 129 | padding: 20px; 130 | border-radius: 7px; 131 | box-shadow: 5px 5px 10px #00000050; 132 | } 133 | 134 | .card-imagem { 135 | width: 100%; 136 | height: 150px; 137 | object-fit: cover; 138 | border: 1px solid #f3e5f550; 139 | border-radius: 5px; 140 | } 141 | 142 | .card-info { 143 | width: 100%; 144 | height: 120px; 145 | background-color: #9575cd80; 146 | margin-top: 20px; 147 | border: 1px solid #f3e5f550; 148 | border-radius: 5px; 149 | } 150 | 151 | .info-titulo { 152 | margin-top: 0; 153 | margin-bottom: 0; 154 | color: white; 155 | text-transform: uppercase; 156 | font-size: 18px; 157 | padding: 4px 0; 158 | border-bottom: 1px solid #f3e5f550; 159 | } 160 | 161 | .opcoes { 162 | width: 100%; 163 | margin-top: 8px; 164 | display: flex; 165 | flex-direction: column; 166 | text-transform: uppercase; 167 | color: white; 168 | font-size: 15px; 169 | } 170 | 171 | .atributo { 172 | display: flex; 173 | justify-content: space-between; 174 | align-items: center; 175 | height: 25px; 176 | padding: 0 10px; 177 | } 178 | 179 | .pontuacao { 180 | background-color: #9575cd80; 181 | border-radius: 10px; 182 | line-height: 50px; 183 | color: white; 184 | background-image: url("https://images8.alphacoders.com/739/739036.jpg"); 185 | border-radius: 5px; 186 | display: flex; 187 | justify-content: space-around; 188 | } 189 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | https://linktr.ee/fabianacampanari . 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | var carta1 = { 2 | nome: "Elon Musk", 3 | imagem: 4 | "https://ted-conferences-speaker-photos-production.s3.amazonaws.com/c9bzt1ahc9iv09uth9oepbetmsuc", 5 | atributos: { 6 | creative: 5, 7 | innovative: 9, 8 | visionary: 8 9 | } 10 | }; 11 | 12 | var carta2 = { 13 | nome: "Steve Jobs", 14 | imagem: 15 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTzEKY_9tW45XK-CTtt4kqogy1sb8wHn3-GGarIKtR87naROY90z9NSQwJzSdPKev-qpKw&usqp=CAU", 16 | atributos: { 17 | creative: 7, 18 | visionary: 4, 19 | innovative: 5 20 | } 21 | }; 22 | 23 | var carta3 = { 24 | nome: "Bill Gates", 25 | imagem: 26 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT23Dx0SxHhzfpXijw-LCSKZLEx0ktL7wsPiaCgEx-oO0Df3rxt8-GZG-r1fzLWFIVc4K8&usqp=CAU", 27 | atributos: { 28 | creative: 8, 29 | visionary: 5, 30 | innovative: 4 31 | } 32 | }; 33 | 34 | var carta4 = { 35 | nome: "Mark Zuckerberg", 36 | imagem: 37 | "https://www.suno.com.br/wp-content/uploads/2018/11/Mark-Zuckerberg-2.jpg", 38 | atributos: { 39 | creative: 7, 40 | visionary: 7, 41 | innovative: 8 42 | } 43 | }; 44 | 45 | var carta5 = { 46 | nome: "Linus Torvalds", 47 | imagem: 48 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSfjV-kLn-RdVVIiX8E5GyPE_2P9SchxtxTow&usqp=CAU", 49 | atributos: { 50 | creative: 5, 51 | visionary: 9, 52 | innovative: 4 53 | } 54 | }; 55 | 56 | var carta6 = { 57 | nome: "Nilkola Tesla", 58 | imagem: 59 | "https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Tesla_circa_1890.jpeg/460px-Tesla_circa_1890.jpeg", 60 | atributos: { 61 | creative: 4, 62 | visionary: 4, 63 | innovative: 8 64 | } 65 | }; 66 | 67 | var carta7 = { 68 | nome: "Alan Cooper", 69 | imagem: 70 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQPrpySibpdUTbYA0WqBEmAQeO9g8z0CCLnqOhFBmbeNdfvfQjPmnqKGwZ5hH7zpZPJV0o&usqp=CAU", 71 | atributos: { 72 | creative: 5, 73 | visionary: 10, 74 | innovative: 7 75 | } 76 | }; 77 | 78 | var carta8 = { 79 | nome: "Alonzo Church", 80 | imagem: 81 | "https://upload.wikimedia.org/wikipedia/en/a/a6/Alonzo_Church.jpg", 82 | atributos: { 83 | creative: 8, 84 | visionary: 6, 85 | innovative: 7 86 | } 87 | }; 88 | 89 | var carta9 = { 90 | nome: "Richard Stallman", 91 | imagem: 92 | "https://usesthis.com/images/interviews/richard.stallman/portrait.jpg", 93 | atributos: { 94 | creative: 7, 95 | visionary: 5, 96 | innovative: 8 97 | } 98 | }; 99 | 100 | var carta10 = { 101 | nome: "James Gosling", 102 | imagem: 103 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTkYzdcGbJsNbK9AzWEvVoWfVrWfwwRtqynTHpKEW8IxqP054KLfAIetyAfZEQKtwXRihQ&usqp=CAU", 104 | atributos: { 105 | creative: 4, 106 | visionary: 8, 107 | innovative: 4 108 | } 109 | }; 110 | 111 | var carta11 = { 112 | nome: "Guido Van Rossum", 113 | imagem: "https://gvanrossum.github.io/images/GuidoByPeterAdams.jpg", 114 | atributos: { 115 | creative: 3, 116 | visionary: 5, 117 | innovative: 5 118 | } 119 | }; 120 | 121 | var carta12 = { 122 | nome: "Rasmus Lerdorf", 123 | imagem: 124 | "https://i.pinimg.com/474x/6d/e8/08/6de8084630cf02a5dbeb02a5e4c630c9--web-programming-languages-november-born.jpg", 125 | atributos: { 126 | creative: 6, 127 | visionary: 4, 128 | innovative: 7 129 | } 130 | }; 131 | 132 | var carta13 = { 133 | nome: "Ada Lovelace", 134 | imagem: 135 | "https://www.ufrgs.br/enigma/wp-content/uploads/2021/02/https-_dynaimage.cdn_.cnn_.com_cnn_x_357y_0w_539h_719c_crop_https3A2F2Fstamp.static.cnn_.io2F5bab86cf4db3d70020c01c3e2Fada2-e1613402491497.jpg", 136 | atributos: { 137 | creative: 7, 138 | visionary: 5, 139 | innovative: 5 140 | } 141 | }; 142 | 143 | var carta14 = { 144 | nome: "Anders Hejlsberg ", 145 | imagem: 146 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSxDD3zQcwA9KlnEw7J_HyLHBPpdTGTRTYRBiWNqA0mi3tNDi-QuxqY4RnNMdHkyXUaMSc&usqp=CAU", 147 | atributos: { 148 | creative: 6, 149 | visionary: 4, 150 | innovative: 9 151 | } 152 | }; 153 | 154 | var carta15 = { 155 | nome: "Grace Murray Hopper", 156 | imagem: 157 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTkJnlscWpWh4RFjHB5vjWG8WA8WKfumSCw0CJA_lyVx45a4JwvoA4skmvQQcYPSY5QUT0&usqp=CAU", 158 | atributos: { 159 | creative: 9, 160 | visionary: 6, 161 | innovative: 8 162 | } 163 | }; 164 | 165 | var carta16 = { 166 | nome: "Dennis Ritchie", 167 | imagem: 168 | "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTIPiqr5kCRqggHfGNKFSxiwtSE0nGJQbUt2cL2wQnVXrWeVHgBgpuyZFS7lVrfePxQV3A&usqp=CAU", 169 | atributos: { 170 | creative: 5, 171 | visionary: 6, 172 | innovative: 7 173 | } 174 | }; 175 | 176 | var cartasDoJogador = []; 177 | var cartasDaMaquina = []; 178 | 179 | var cartaMaquina; 180 | var cartaJogador; 181 | var cartas = [ 182 | carta1, 183 | carta2, 184 | carta3, 185 | carta4, 186 | carta5, 187 | carta6, 188 | carta7, 189 | carta8, 190 | carta9, 191 | carta10, 192 | carta11, 193 | carta12, 194 | carta13, 195 | carta14, 196 | carta15, 197 | carta16 198 | ]; 199 | // 0 1 2 200 | 201 | function sortearCarta() { 202 | var numeroCartaMaquina = parseInt(Math.random() * 16); 203 | cartaMaquina = cartas[numeroCartaMaquina]; 204 | 205 | var numeroCartaJogador = parseInt(Math.random() * 16); 206 | while (numeroCartaJogador == numeroCartaMaquina) { 207 | numeroCartaJogador = parseInt(Math.random() * 16); 208 | } 209 | cartaJogador = cartas[numeroCartaJogador]; 210 | console.log(cartaJogador); 211 | 212 | document.getElementById("btnSortear").disabled = true; 213 | document.getElementById("btnJogar").disabled = false; 214 | exibirCartaJogador(); 215 | } 216 | 217 | function obtemAtributoSelecionado() { 218 | var radioAtributo = document.getElementsByName("atributo"); 219 | for (var i = 0; i < radioAtributo.length; i++) { 220 | if (radioAtributo[i].checked) { 221 | return radioAtributo[i].value; 222 | } 223 | } 224 | } 225 | 226 | function jogar() { 227 | console.log("chamou"); 228 | var atributoSelecionado = obtemAtributoSelecionado(); 229 | var divResultado = document.getElementById("resultado"); 230 | 231 | if ( 232 | cartaJogador.atributos[atributoSelecionado] > 233 | cartaMaquina.atributos[atributoSelecionado] 234 | ) { 235 | htmlResultado = "
You Won!
"; 236 | cartasDoJogador.push(cartaMaquina); 237 | } else if ( 238 | cartaJogador.atributos[atributoSelecionado] < 239 | cartaMaquina.atributos[atributoSelecionado] 240 | ) { 241 | htmlResultado = "You Lost!
"; 242 | cartasDaMaquina.push(cartaJogador); 243 | } else { 244 | htmlResultado = "Tied!
"; 245 | } 246 | 247 | if (cartasDaMaquina.length == 5 || cartasDoJogador.length == 5) { 248 | document.getElementById("btnJogar").disabled = true; 249 | document.getElementById("btnProxima").disabled = true; 250 | document.getElementById("btnSortear").disabled = true; 251 | 252 | if (cartasDaMaquina.length == 5) { 253 | htmlResultado = `End of the game ! The winner was the machine by ${cartasDaMaquina.length} to ${cartasDoJogador.length}.
`; 254 | document.getElementById("btnReiniciar").innerHTML = 255 | ""; 256 | } else { 257 | htmlResultado = `End of the game ! The winner was you by ${cartasDoJogador.length} to ${cartasDaMaquina.length}.
`; 258 | document.getElementById("btnReiniciar").innerHTML = 259 | ""; 260 | } 261 | } else { 262 | document.getElementById("btnProxima").disabled = false; 263 | } 264 | 265 | divResultado.innerHTML = htmlResultado; 266 | 267 | document.getElementById("btnJogar").disabled = true; 268 | exibirCartaMaquina(); 269 | exibirPontuacao(); 270 | } 271 | 272 | function exibirCartaJogador() { 273 | var divCartaJogador = document.getElementById("carta-jogador"); 274 | 275 | divCartaJogador.innerHTML = ` 276 |${cartaJogador.nome}
280 | 281 |${cartaMaquina.nome}
301 | 302 |${atributo}
${cartaMaquina.atributos[atributo]}